<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>
<?rfc-ext include-index="no" ?>
<!--<?rfc strict="no"?> -->

<rfc
     docName="draft-wwlh-netconf-list-pagination-nc-01"
     category="std"
     ipr="trust200902">

  <front>
    <title abbrev="NETCONF Pagination Support"> NETCONF Extensions to Support
    List Pagination</title>

    <author fullname="Kent Watsen" initials="K." surname="Watsen">
      <organization>Watsen Network</organization>
      <address>
        <email>kent+ietf@watsen.net</email>
      </address>
    </author>
    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>
          <city>Nanjing</city>
          <region>Jiangsu</region>
          <code>210012</code>
          <country>China</country>
        </postal>
        <email>bill.wu@huawei.com</email>
      </address>
    </author>
    <author fullname="Olof Hagsand" initials="O." surname="Hagsand">
      <organization>Netgate</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 year="2020"/>
    <area>OPS Area</area>
    <workgroup>NETCONF Working Group</workgroup>

    <abstract>
      <t>In some circumstance, a server may contain many instances of a
      particular YANG list or leaf-list. Retrieval of the entire list or
      leaf-list at once can be extremely inefficient.</t>

      <t>This document defines a YANG data model with "get-pageable-list" RPC
      to allow a client to iterate through a large list, in a manner that is
      most efficient for the application.</t>

      <t>The YANG data model in this document conforms to the Network
      Management Datastore Architecture defined in RFC 8342.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>There is a need for standard mechanisms to control the filtering,
      sorting, and retrieval of data from the server. A server may contain
      many instances of a particular YANG list. Retrieval of the entire list
      or leaf-list at once can be extremely inefficient.</t>

      <t>This document defines a YANG module for Pagination mechanisms which
      allow a client to iterate through a large list or leaf-list, in a manner
      that is most efficient for the application.</t>

    <t>While the pagination mechanism defined in this document is designed
      for the NETCONF protocol <xref target="RFC6241"/>, the RPC MAY be
        used by the RESTCONF protocol <xref target="RFC8040"/> if the
          RESTCONF server implements the "ietf-yang-list-pagination" module.</t>

      <t>The YANG data model in this document conforms to the Network
        Management Datastore Architecture defined in <xref target="RFC8342"/></t>

      <section title="Terminology">
        <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>

    <!-- intro -->

    <section title="NETCONF operation">
      <t>This document define a new operation -- &lt;get-list-pagination&gt;
      to support YANG based pagination. This operation is similar to the
        &lt;get-data&gt; <xref target="RFC8526"/> in that it takes an input parameter to
      indicate the datastore that is the source of the data to be
      retrieved.</t>

      <section title="The &lt;get-list-pagination&gt; operation">
        <t>The &lt;get-pageable-list&gt; operation uses enhanced filtering
        features to retrieve data from a specific NMDA datastore. This
        operation is similar to &lt;get-data&gt; operation defined in
        <xref target="RFC8526"/> and have the flexibility to select the different source
        datastore.</t>

        <figure>
          <artwork>    +---x get-pageable-list
       +---w input
       |  +---w datastore?     string
       |  +---w (filter-spec)?
       |  |  +--:(subtree-filter)
       |  |  |  +---w subtree-filter?          &lt;anydata&gt;
       |  |  +--:(xpath-filter)
       |  |     +---w xpath-filter?            yang:xpath1.0 {nc:xpath}?
       |  +---w config-filter?                 boolean
       |  +---w (origin-filters)? {origin}?
       |  |  +--:(origin-filter)
       |  |  |  +---w origin-filter*           or:origin-ref
       |  |  +--:(negated-origin-filter)
       |  |     +---w negated-origin-filter*   or:origin-ref
       |  +---w max-depth?                     union
       |  +---w with-origin?                   empty {origin}?
       |  +---w with-defaults?                 with-defaults-mode
       |  +---w list-target    string
       |  +---w count?         union
       |  +---w skip?          union
       |  +---w direction?     enumeration
       |  +---w sort?          string
       |  +---w where?         string
       +--ro output
          +--ro collection?   &lt;anyxml&gt;</artwork>
        </figure>

        <t>The "datastore" parameter indicates the datastore that is the
        source of the data to be retrieved. This is a "datastore"
        identity.</t>

        <t>The &lt;get-pageable-list&gt; operation accepts a content filter
        parameter, similar to the "filter" parameter of &lt;get-config&gt;,
        but uses explicit nodes for list filtering or leaf-list filtering.</t>

        <t>The "config-filter" parameter can be used to retrieve only "config
        true" or "config false" nodes.</t>

        <t>The "origin-filter" parameter, which can be present multiple times,
        selects nodes equal to or derived from any of the given values. The
        "negated-origin-filter", which can be present multiple times, selects
        nodes that are not equal to or derived from any of the given values.
        The "origin-filter" and "negated-origin-filter" parameters cannot be
        used together.</t>

        <t>The "max-depth" parameter can be used by the client to limit the
        number of subtree levels that are returned in the reply.</t>

        <t>The "with-origin" parameter can be used to request the server to
        include "origin" metadata annotations in its response, as detailed in
        the NMDA. The 'with-origin' parameter is only valid for an operational
          datastore. See section 3.1.1.1 of <xref target="RFC8526"/> for the behavior of the
        "with-origin" parameter for &lt;operational&gt;.</t>

        <t>The "with-default"parameter can be used to control whether default
        data is returned by the server. The 'with-default' parameter is only
          valid for an operational datastore. See section 3.1.1.2 of <xref target="RFC8526"/>
        for the behavior of the "with-defaults" parameter for
        &lt;operational&gt;.</t>

        <t>The "list-target" parameter is used to specify that YANG list that
        will be retrieved. This must be a path expression used to represent a
        list data node.</t>

        <t>The "count" parameter can be used to specify the maximum number of
        list entries to return. The value of the "count" parameter is either
        an integer greater than or equal to 1, or the string "unbounded". The
        string "unbounded" is the default value.</t>

        <t>The "skip" parameter can be used to specify the first list item to
        return in response to NETCONF/Request requests on instances of a
        particular YANG list. YANG list instances are numbered with
        consecutive integers from 1 to the number of YANG list instances.</t>

        <t>The value of the "skip" parameter is an integer greater than or
        equal to 1. The default value is 1.</t>

        <t>If the "where" parameter is specified, the "skip" parameter MUST
        start with a set of selected list resources picked by using "where"
        parameter and specify the first list item resource to return.</t>

        <t>The "direction" parameter can be used to specify the direction
        relative to the &lsquo;sort' order through list or leaf-list.</t>

        <t>The "sort" parameter is used to indicates how the entries in a list
        are to be sorted. By default, the value of the "sort" is default,
        i.e., for 'ordered-by user' lists and leaf-lists, the default order is
        the user-configured order; for 'ordered-by system' lists and
        leaf-lists, the default order is specified by the system.</t>

        <t>The "where" parameter is used to specify the boolean filter to
        select data instances to return from the list or leaf-list target. The
        filter element contains boolean XPATH expression. The filter output is
        a set of selected list items. The server determines which node
        instances are included (or potentially included) in the filter output,
        and which node instances are excluded (pruned) from the filter
        output.</t>

        <t>The selected list instances are numbered with consecutive integers
        from 1 to the number of list instances.</t>

        <t>The expected processing order: filter -&gt; sort -&gt; direction
        -&gt; skip -&gt; count.</t>
      </section>
    </section>

    <section title="YANG Module for List Pagination">
      <t>The "ietf-netconf-list-pagination" 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>
      <figure>
        <artwork>&lt;CODE BEGINS&gt; file "ietf-netconf-list-pagination@2020-10-30.yang"
module ietf-netconf-list-pagination {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination";
  prefix ycoll;

  import ietf-netconf {
    prefix nc;
    reference
      "RFC 6241: Network Configuration Protocol (NETCONF)";
  }
  import ietf-netconf-with-defaults {
    prefix ncwd;
    reference
      "RFC 6243: With-defaults Capability for NETCONF";
  }
  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-datastores {
    prefix ds;
    reference
      "RFC 8342: Network Management Datastore Architecture
       (NMDA)";
  }
  import ietf-origin {
    prefix or;
    reference
      "RFC 8342: Network Management Datastore Architecture
       (NMDA)";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
     WG List:  &lt;mailto:netconf@ietf.org&gt;

     Editor:

     Editor:

     Editor:   ";
  description
    "This module define a new operation -- &lt;get-collection&gt;
     to support YANG based pagination.

     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.

     Copyright (c) 2019 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 Simplified 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 8526; see
     the RFC itself for full legal notices.";

  revision 2020-10-30 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: YANG Based Pagination.";
  }

  feature origin {
    description
      "Indicates that the server supports the 'origin' annotation.";
    reference
      "RFC 8342: Network Management Datastore Architecture (NMDA)";
  }

  feature with-defaults {
    description
      "NETCONF :with-defaults capability.  If the server advertises
       the :with-defaults capability for a session, then this
       feature must also be enabled for that session.  Otherwise,
       this feature must not be enabled.";
    reference
      "RFC 6243: With-defaults Capability for NETCONF, Section 4; and
       RFC 8526: NETCONF Extensions to Support the Network Management
       Datastore Architecture, Section 3.1.1.2";
  }

  rpc get-pagable-list {
    description
      "Use enhanced filtering features to retrieve data from a
       specific NMDA datastore. The content returned by get-data
       must satisfy all filters, i.e., the filter criteria are
       logically ANDed.

       Any ancestor nodes (including list keys) of nodes selected by
       the filters are included in the response.

       The 'with-origin' parameter is only valid for an operational
       datastore.  If 'with-origin' is used with an invalid
       datastore, then the server MUST return an &lt;rpc-error&gt; element
       with an &lt;error-tag&gt; value of 'invalid-value'.

       The 'with-defaults' parameter only applies to the operational
       datastore if the NETCONF :with-defaults and
       :with-operational-defaults capabilities are both advertised.
       If the 'with-defaults' parameter is present in a request for
       which it is not supported, then the server MUST return an
       &lt;rpc-error&gt; element with an &lt;error-tag&gt; value of
       'invalid-value'.";
    input {
      leaf datastore {
        type ds:datastore-ref;
        mandatory true;
        description
          "Datastore from which to retrieve data.

           If the datastore is not supported by the server, then
           the server MUST return an &lt;rpc-error&gt; element with an
           &lt;error-tag&gt; value of 'invalid-value'.";
      }
      choice filter-spec {
        description
          "The content filter specification for this request.";
        anydata subtree-filter {
          description
            "This parameter identifies the portions of the
             target datastore to retrieve.";
          reference
            "RFC 6241: Network Configuration Protocol (NETCONF),
                       Section 6";
        }
        leaf xpath-filter {
          if-feature "nc:xpath";
          type yang:xpath1.0;
          description
            "This parameter contains an XPath expression identifying
             the portions of the target datastore to retrieve.

             If the expression returns a node-set, all nodes in the
             node-set are selected by the filter.  Otherwise, if the
             expression does not return a node-set, then the
             &lt;get-data&gt; operation fails.

             The expression is evaluated in the following XPath
             context:

               o  The set of namespace declarations are those in
                  scope on the 'xpath-filter' leaf element.

               o  The set of variable bindings is empty.

               o  The function library is the core function library,
                  and the XPath functions are defined in Section 10
                  of RFC 7950.

               o  The context node is the root node of the target
                  datastore.";
        }
      }
      leaf config-filter {
        type boolean;
        description
          "Filter for nodes with the given value for their 'config'
           property.  When this leaf is set to 'true', only 'config
           true' nodes are selected, and when set to 'false', only
           'config false' nodes are selected.  If this leaf is not
           present, no nodes are filtered.";
      }
      choice origin-filters {
        when 'derived-from-or-self(datastore, "ds:operational")';
        if-feature "origin";
        description
          "Filters configuration nodes based on the 'origin'
           annotation.  Configuration nodes that do not have an
           'origin' annotation are treated as if they have the
           'origin' annotation 'or:unknown'.

           System state nodes are not affected by origin-filters and
           thus not filtered.  Note that system state nodes can be
           filtered with the 'config-filter' leaf.";
        leaf-list origin-filter {
          type or:origin-ref;
          description
            "Filter based on the 'origin' annotation.  A
             configuration node matches the filter if its 'origin'
             annotation is derived from or equal to any of the given
             filter values.";
        }
        leaf-list negated-origin-filter {
          type or:origin-ref;
          description
            "Filter based on the 'origin' annotation.  A
             configuration node matches the filter if its 'origin'
             annotation is neither derived from nor equal to any of
             the given filter values.";
        }
      }
      leaf max-depth {
        type union {
          type uint16 {
            range "1..65535";
          }
          type enumeration {
            enum unbounded {
              description
                "All descendant nodes are included.";
            }
          }
        }
        default "unbounded";
        description
          "For each node selected by the filters, this parameter
           selects how many conceptual subtree levels should be
           returned in the reply.  If the depth is 1, the reply
           includes just the selected nodes but no children.  If the
           depth is 'unbounded', all descendant nodes are included.";
      }
      leaf with-origin {
        when 'derived-from-or-self(../datastore, "ds:operational")';
        if-feature "origin";
        type empty;
        description
          "If this parameter is present, the server will return
           the 'origin' annotation for the nodes that have one.";
      }
      uses ncwd:with-defaults-parameters {
        if-feature "with-defaults";
      }
      leaf list-target {
        description
          "Identifies the list object that is being retrieved.
           This must be a path expression used to represent
           a list data node or leaf-list data node. ";
        mandatory true;
        type string;
      }
      leaf count {
        type union {
          type uint32;
          type string {
            pattern 'unbounded';
          }
        }
        default "unbounded";
        description
          "The maximum number of list entries to return. The
           value of the 'count' parameter is either an integer
           greater than or equal to 1, or the string 'unbounded'.
           The string 'unbounded' is the default value.";
      }
      leaf skip {
        type union {
          type uint32;
          type string {
            pattern 'none';
          }
        }
        default "none";
        description
          "The first list item to return.
           the 'skip' parameter is either an integer greater than
           or equal to 1, or the string 'unbounded'.  The string
           'unbounded' is the default value.";
      }
      leaf direction {
        type enumeration {
          enum forward;
          enum reverse;
        }
        default "forward";
        description
          "Direction relative to the &lsquo;sort' order through list
           or leaf-list. It can be forward direction or reverse
           direction.";
      }
      leaf sort {
        type union {
          type string {
            length "1..max" {
              description
                "The name of a descendent node to sort on.  For
                 &lsquo;Config false&rsquo; lists and leaf-lists, the node SHOULD
                  have the &rsquo;TBD&rsquo; extension indicating that it has been
                  indexed, enabling efficient sorts.";
            }
          }
          type enumeration {
            enum default {
              description
                "Indicates that the &lsquo;default&rsquo; order is assumed.  For
                 &lsquo;ordered-by user&rsquo; lists and leaf-lists, the default order
                 is the user-configured order.  For 'ordered-by system&rsquo;
                 lists and leaf-lists, the default order is specified by the
                 system.";
            }
          }
        }
        default "default";
        description
          "Indicates how the entries in a list are to be sorted.";
      }
      leaf where {
        type yang:xpath1.0;
        description
          "The boolean filter to select data instances to return from
           the list or leaf-list target.  The Xpath expression MAY be
           constrained either server-wide, by datastore, by &lsquo;config&rsquo;
           status, or per list or leaf-list.  Details regarding how
           constraints are communicated are TBD.  This parameter
           is optional; no filtering is applied when it is not
           specified.";
      }
    }
    output {
      anyxml pageable-list {
        description
          "Return the list entries that were requested and matched
           the filter criteria (if any). An empty data container
           indicates that the request did not produce any results.";
      }
    }
  }
}
&lt;CODE ENDS&gt;</artwork>
      </figure>
    </section>

    <section title="IANA Considerations">
      <section title='The "IETF XML" Registry'>

          <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>
          <t>
        <figure align="center">
          <artwork>  URI: urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination
  Registrant Contact: The IESG.
  XML: N/A, the requested URI is an XML namespace.</artwork>
        </figure>
          </t>
        </section>

                  <section title='The "YANG Module Names" Registry'>
          <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>
          <t>
        <figure align="center">
          <artwork>  name: ietf-restconf-list-pagination
  namespace: urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination
  prefix: rlpg
  RFC: xxxx</artwork>
        </figure>
      </t>
      </section>

    </section>

    <section anchor="security" title="Security Considerations">
      <section title="The &quot;ietf-netconf-list-pagination&quot; YANG Module">
        <t>The YANG module defined in this document extends the base operations
          for NETCONF <xref target="RFC6241"/> and 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"/> apply to the new
        &lt;get-list-pagination&gt; RPC operations defined in this document.</t>
    </section>
    </section>

  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119.xml"?>
      <?rfc include="reference.RFC.3688.xml"?>
      <?rfc include="reference.RFC.6020.xml"?>
      <?rfc include="reference.RFC.6241.xml"?>
      <?rfc include="reference.RFC.6242.xml"?>
      <?rfc include="reference.RFC.6243.xml"?>
      <?rfc include="reference.RFC.6991.xml"?>
      <?rfc include="reference.RFC.7950.xml"?>
      <?rfc include="reference.RFC.8174.xml"?>
      <?rfc include="reference.RFC.8341.xml"?>
      <?rfc include="reference.RFC.8342.xml"?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.8040.xml"?>
      <?rfc include="reference.RFC.8446.xml"?>
      <?rfc include="reference.RFC.8526.xml"?>
      <!-- <?rfc include="reference.RFC.8340.xml"?> Tree Diagrams -->
      <!--<?rfc include="reference.RFC.6991.xml"?> YANG Types-->
      <!--<?rfc include="reference.RFC.8341.xml"?> NACM-->
    </references>

    <section title="Open Issues">
      <t>Cursors (i.e.,stable result sets) are related to the topic of dynamic
      changing lists between two queries. How cursors can be supported using
      "feature"?</t>
    </section>

    <section title="Example YANG Module">
      <t>The example YANG module used in this document is supposed to
      illustrate certain features and not supposed to be complete, valid YANG
      modules.</t>

      <t>YANG tree diagram for the "example-module" module: <figure>
          <artwork>module: example-module
  +--rw admins
  |  +--rw admin* [name]
  |     +--rw name             string
  |     +--rw access?          enumeration
  |     +--rw email-address?   email-address
  |     +--rw password?        ianach:crypt-hash
  |     +--ro status*           string
  |     +--rw preference
  |     |  +--rw number*   uint8
  |     +--rw skill* [name]
  |        +--rw name    string
  |        +--rw rank?   uint8
  +--rw rulebase
  |  +--rw rule* [name]
  |     +--rw name      string
  |     +--rw match?    string
  |     +--rw action?   enumeration
  +--rw device-logs
  |  +--ro device-log* []
  |     +--ro device-id?        string
  |     +--ro time-received?    yang:timestamp
  |     +--ro time-generated?   yang:timestamp
  |     +--ro message?          string
  +--rw audit-logs
  |  +--ro audit-log* [log-creation]
  |     +--ro source-ip?      inet:ip-address
  |     +--ro log-creation?   yang:timestamp
  |     +--ro request?        string
  |     +--ro outcome?        boolean
  +--rw prefixes
     +--rw prefix-list* [ip-prefix masklength-lower masklength-upper]
        +--rw ip-prefix           inet:ip-prefix
        +--rw masklength-lower    uint8
        +--rw masklength-upper    uint8</artwork>
        </figure></t>

      <section title="&quot;example-module&quot; YANG Module">
        <t><figure>
            <artwork>module example-module {
  yang-version 1.1;
  namespace "http://example.com/ns/example-module";
  prefix exm;

  import iana-crypt-hash {
    prefix ianach;
  }
  import ietf-inet-types {
    prefix inet;
  }
  import ietf-yang-types {
    prefix yang;
  }

  organization
    "Example, Inc.";
  contact
    "support at example.com";
  description
    "Example Data Model Module.";

  revision 2020-10-06 {
    description
      "Initial version.";
    reference
      "example.com document 1-4673.";
  }

  container admins {
    description
      "Admin Group configuration.";
    list admin {
      key "name";
      description
        "List of admins for admin group configuration.";
      ordered-by system;
      leaf name {
        type string {
          length "1 .. max";
        }
        description
          "The name of the admin.";
      }
      leaf access {
        type enumeration {
          enum permit {
            description
              "Permit access privilege.";
          }
          enum deny {
            description
              "Deny access privilege.";
          }
          enum limited {
            description
              "Limited access privilege.";
          }
        }
        default "permit";
        description
          "The Access privilege type for this admin.";
      }
      leaf email-address {
        type inet:email-address;
        description
          "Contact email of the admin.";
      }
      leaf password {
        type ianach:crypt-hash;
        description
          "The password for this entry.";
      }
      leaf-list status {
        type string;
        config false;
        description
          "The status for this entry.";
      }
      container preference {
        leaf-list number {
          type uint8;
          description
            "Defines the perference numbers for the admin.";
        }
        description
          "Preference parameters.";
      }
      list skill {
        key "name";
        description
          "Represents one 'sill' resource within one
           'admin' resource.";
        leaf name {
          type string {
            length "1 .. max";
          }
          description
            "The name of the skill.";
        }
        leaf rank {
          type uint16;
          description
            "The rank identifying the rank on
             the skill.";
        }
      }
    }
  }
  container rulebase {
    description
      "Rule base configuration";
    list rule {
      key "name";
      description
        "List of rules for rulebase.";
      ordered-by user;
      leaf name {
        type string {
          length "1 .. max";
        }
        description
          "The name of the rule.";
      }
      leaf match {
        type string {
          length "1 .. max";
        }
        description
          "The rules in this rulebase determine what fields will be
           matched upon before any action is taken on them.";
      }
      leaf action {
        type enumeration {
          enum forwarding {
            description
              "Specify forwarding behavior per rule entry.";
          }
          enum logging {
            description
              "Specify logging behavior per rule entry.";
          }
        }
        default "logging";
        description
          "Defintion of the action for this rule entry.";
      }
    }
  }
  container device-logs {
    description
      "Device log configuration";
    list device-log {
      description
        "List of device logs.";
      config false;
      leaf device-id {
        type string;
        description
          "The device id of the device log.";
      }
      leaf time-received {
        type yang:date-and-time;
        description
          "The timestamp value at the time this
           log was received.";
      }
      leaf time-generated {
        type yang:date-and-time;
        description
          "The timestamp value at the time this
           log was generated.";
      }
      leaf message {
        type string;
        description
          "Message given at start of login session.";
      }
    }
  }
  container audit-logs {
    description
      "Audit log configuration";
    list audit-log {
      key "log-creation";
      description
        "List of audit logs.";
      config false;
      leaf source-ip {
        type inet:ip-address;
        description
          "The IP address of the targeted object.";
      }
      leaf log-creation {
        type yang:date-and-time;
        description
          "The timestamp value at the time this
           log was created.";
      }
      leaf request {
        type string;
        description
          "Request type of audit log.";
      }
      leaf outcome {
        type boolean;
        default "true";
        description
          "Indicate the audit log is retrieved sucessfully or not.";
      }
    }
  }
  container prefixes {
    description
      "Enclosing container for the list of prefixes in a policy
       prefix list";
    list prefix-list {
      key "ip-prefix masklength-lower masklength-upper";
      description
        "List of prefixes in the prefix set";
      leaf ip-prefix {
        type inet:ip-prefix;
        mandatory true;
        description
          "The prefix member in CIDR notation -- while the
           prefix may be either IPv4 or IPv6, most
           implementations require all members of the prefix set
           to be the same address family.  Mixing address types in
           the same prefix set is likely to cause an error.";
      }
      leaf masklength-lower {
        type uint8;
        description
          "Masklength range lower bound.";
      }
      leaf masklength-upper {
        type uint8 {
          range "1..128";
        }
        must '../masklength-upper &gt;= ../masklength-lower' {
          error-message "The upper bound should not be lessthan lower bound.";
        }
        description
          "Masklength range upper bound.

           The combination of masklength-lower and masklength-upper
           define a range for the mask length, or single 'exact'
           length if masklength-lower and masklenght-upper are equal.

           Example: 10.3.192.0/21 through 10.3.192.0/24 would be
           expressed as prefix: 10.3.192.0/21,
                        masklength-lower=21,
                        masklength-upper=24

           Example: 10.3.192.0/21 (an exact match) would be
           expressed as prefix: 10.3.192.0/21,
                        masklength-lower=21,
                        masklength-upper=21";
      }
    }
  }
}</artwork>
          </figure></t>
      </section>

      <section title="Data-Set for example-module">
        <figure>
          <artwork>  &lt;admins xmlns="http://example.com/ns/example-module"&gt; 
    &lt;admin&gt; 
      &lt;name&gt;Alice&lt;/name&gt;  
      &lt;access&gt;permit&lt;/access&gt;  
      &lt;email-address&gt;alice@example.com&lt;/email-address&gt;  
      &lt;password&gt;$0$1543&lt;/password&gt;
      &lt;status&gt;Available&lt;/status&gt;  
      &lt;preference&gt; 
        &lt;number&gt;1&lt;/number&gt;  
        &lt;number&gt;2&lt;/number&gt; 
      &lt;/preference&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Customer Service&lt;/name&gt;  
        &lt;rank&gt;99&lt;/rank&gt; 
      &lt;/skill&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Problem Solving&lt;/name&gt;  
        &lt;rank&gt;90&lt;/rank&gt; 
      &lt;/skill&gt; 
    &lt;/admin&gt;  
    &lt;admin&gt; 
      &lt;name&gt;Bob&lt;/name&gt;  
      &lt;access&gt;limited&lt;/access&gt;  
      &lt;email-address&gt;bob@example.com&lt;/email-address&gt;  
      &lt;password&gt;$0$2789&lt;/password&gt; 
      &lt;status&gt;Busy&lt;/status&gt; 
      &lt;preference&gt; 
        &lt;number&gt;2&lt;/number&gt;  
        &lt;number&gt;3&lt;/number&gt; 
      &lt;/preference&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Problem Solving&lt;/name&gt;  
        &lt;rank&gt;98&lt;/rank&gt; 
      &lt;/skill&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Conflict Resolution&lt;/name&gt;  
        &lt;rank&gt;93&lt;/rank&gt; 
      &lt;/skill&gt; 
    &lt;/admin&gt;  
    &lt;admin&gt; 
      &lt;name&gt;Joe&lt;/name&gt;  
      &lt;access&gt;permit&lt;/access&gt;  
      &lt;email-address&gt;joe@example.com&lt;/email-address&gt;  
      &lt;password&gt;$0$6523&lt;/password&gt;
      &lt;status&gt;Do Not Disturb&lt;/status&gt;  
      &lt;preference&gt; 
        &lt;number&gt;1&lt;/number&gt;  
        &lt;number&gt;4&lt;/number&gt; 
      &lt;/preference&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Management&lt;/name&gt;  
        &lt;rank&gt;96&lt;/rank&gt; 
      &lt;/skill&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Collaboration&lt;/name&gt;  
        &lt;rank&gt;92&lt;/rank&gt; 
      &lt;/skill&gt; 
    &lt;/admin&gt;  
    &lt;admin&gt; 
      &lt;name&gt;Frank&lt;/name&gt;  
      &lt;access&gt;deny&lt;/access&gt;  
      &lt;email-address&gt;frank@example.com&lt;/email-address&gt;  
      &lt;password&gt;$0$4030&lt;/password&gt;  
      &lt;status&gt;Offline&lt;/status&gt; 
      &lt;preference&gt; 
        &lt;number&gt;5&lt;/number&gt;  
        &lt;number&gt;9&lt;/number&gt; 
      &lt;/preference&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Organization&lt;/name&gt;  
        &lt;rank&gt;90&lt;/rank&gt; 
      &lt;/skill&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Negotiation&lt;/name&gt;  
        &lt;rank&gt;80&lt;/rank&gt; 
      &lt;/skill&gt; 
    &lt;/admin&gt;  
    &lt;admin&gt; 
      &lt;name&gt;Tom&lt;/name&gt;  
      &lt;access&gt;permit&lt;/access&gt;  
      &lt;email-address&gt;tom@example.com&lt;/email-address&gt;  
      &lt;password&gt;$0$2376&lt;/password&gt;
      &lt;status&gt;Do Not Disturb&lt;/status&gt;   
      &lt;preference&gt; 
        &lt;number&gt;2&lt;/number&gt;  
        &lt;number&gt;5&lt;/number&gt; 
      &lt;/preference&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Adaptability.&lt;/name&gt;  
        &lt;rank&gt;98&lt;/rank&gt; 
      &lt;/skill&gt;  
      &lt;skill&gt; 
        &lt;name&gt;Active Listening&lt;/name&gt;  
        &lt;rank&gt;85&lt;/rank&gt; 
      &lt;/skill&gt; 
    &lt;/admin&gt; 
  &lt;/admins&gt;  
  &lt;rulebase  xmlns="http://example.com/ns/example-module"&gt; 
    &lt;rule&gt; 
      &lt;name&gt;SvrA-http&lt;/name&gt;  
      &lt;match&gt;92.0.2.0/24&lt;/match&gt;  
      &lt;action&gt;forwarding&lt;/action&gt; 
    &lt;/rule&gt;  
    &lt;rule&gt; 
      &lt;name&gt;SvrA-ftp&lt;/name&gt;  
      &lt;match&gt;203.0.113.1/32&lt;/match&gt;  
      &lt;action&gt;forwarding&lt;/action&gt; 
    &lt;/rule&gt;  
    &lt;rule&gt; 
      &lt;name&gt;p2p&lt;/name&gt;  
      &lt;match&gt;p2p&lt;/match&gt;  
      &lt;action&gt;logging&lt;/action&gt; 
    &lt;/rule&gt;  
    &lt;rule&gt; 
      &lt;name&gt;any&lt;/name&gt;  
      &lt;match&gt;any&lt;/match&gt;  
      &lt;action&gt;logging&lt;/action&gt; 
    &lt;/rule&gt;  
    &lt;rule&gt; 
      &lt;name&gt;SvrA-tcp&lt;/name&gt;  
      &lt;match&gt;80&lt;/match&gt;  
      &lt;action&gt;forwarding&lt;/action&gt; 
    &lt;/rule&gt; 
  &lt;/rulebase&gt;  
  &lt;device-logs  xmlns="http://example.com/ns/example-module"&gt; 
    &lt;device-log&gt; 
      &lt;device-id&gt;Cloud-IoT-Device-A&lt;/device-id&gt;  
      &lt;time-received&gt;2020-07-08T12:38:32Z&lt;/time-received&gt;  
      &lt;time-generated&gt;2020-07-08T12:37:12Z&lt;/time-generated&gt;  
      &lt;message&gt;Upload contains 6 datapoints&lt;/message&gt; 
    &lt;/device-log&gt;  
    &lt;device-log&gt; 
      &lt;device-id&gt;Cloud-IoT-Device-B&lt;/device-id&gt;  
      &lt;time-received&gt;2020-07-08T16:20:54Z&lt;/time-received&gt;  
      &lt;time-generated&gt;2020-07-08T16:20:14Z&lt;/time-generated&gt;  
      &lt;message&gt;Upload successful&lt;/message&gt; 
    &lt;/device-log&gt;  
    &lt;device-log&gt; 
      &lt;device-id&gt;Cloud-IoT-Device-C&lt;/device-id&gt;  
      &lt;time-received&gt;2020-07-08T17:30:34Z&lt;/time-received&gt;  
      &lt;time-generated&gt;2020-07-08T17:30:12Z&lt;/time-generated&gt;  
      &lt;message&gt;Receive a configuration update&lt;/message&gt; 
    &lt;/device-log&gt;  
    &lt;device-log&gt; 
      &lt;device-id&gt;Cloud-IoT-Device-D&lt;/device-id&gt;  
      &lt;time-received&gt;2020-07-08T18:40:13Z&lt;/time-received&gt;  
      &lt;time-generated&gt;2020-07-08T18:40:00Z&lt;/time-generated&gt;  
      &lt;message&gt;Keep-alive ping sent to server&lt;/message&gt; 
    &lt;/device-log&gt;  
    &lt;device-log&gt; 
      &lt;device-id&gt;Cloud-IoT-Device-E&lt;/device-id&gt;  
      &lt;time-received&gt;2020-07-08T19:48:34Z&lt;/time-received&gt;  
      &lt;time-generated&gt;2020-07-08T19:48:00Z&lt;/time-generated&gt;  
      &lt;message&gt;Uploading data to DataPoint&lt;/message&gt; 
    &lt;/device-log&gt; 
  &lt;/device-logs&gt;  
  &lt;audit-logs  xmlns="http://example.com/ns/example-module"&gt; 
    &lt;audit-log&gt; 
      &lt;source-ip&gt;192.168.0.92&lt;/source-ip&gt;  
      &lt;log-creation&gt;2020-11-01T06:47:59Z&lt;/log-creation&gt;  
      &lt;request&gt;User-logged-out&lt;/request&gt;  
      &lt;outcome&gt;true&lt;/outcome&gt; 
    &lt;/audit-log&gt;  
    &lt;audit-log&gt; 
      &lt;source-ip&gt;192.168.0.92&lt;/source-ip&gt;  
      &lt;log-creation&gt;2020-11-01T06:49:03Z&lt;/log-creation&gt;  
      &lt;request&gt;User-logged-in&lt;/request&gt;  
      &lt;outcome&gt;true&lt;/outcome&gt; 
    &lt;/audit-log&gt;  
    &lt;audit-log&gt; 
      &lt;source-ip&gt;192.168.0.92&lt;/source-ip&gt;  
      &lt;log-creation&gt;2020-11-01T06:51:34Z&lt;/log-creation&gt;  
      &lt;request&gt;Patron-card-viewed&lt;/request&gt;  
      &lt;outcome&gt;false&lt;/outcome&gt; 
    &lt;/audit-log&gt;  
    &lt;audit-log&gt; 
      &lt;source-ip&gt;192.168.0.92&lt;/source-ip&gt;  
      &lt;log-creation&gt;2020-11-01T06:53:01Z&lt;/log-creation&gt;  
      &lt;request&gt;User-logged-out&lt;/request&gt;  
      &lt;outcome&gt;true&lt;/outcome&gt; 
    &lt;/audit-log&gt;  
    &lt;audit-log&gt; 
      &lt;source-ip&gt;192.168.0.92&lt;/source-ip&gt;  
      &lt;log-creation&gt;2020-11-01T06:56:22Z&lt;/log-creation&gt;  
      &lt;request&gt;User-logged-in&lt;/request&gt;  
      &lt;outcome&gt;false&lt;/outcome&gt; 
    &lt;/audit-log&gt; 
  &lt;/audit-logs&gt;  
  &lt;prefixes  xmlns="http://example.com/ns/example-module"&gt; 
    &lt;prefix-list&gt; 
      &lt;ip-prefix&gt;10.0.0.0 8&lt;/ip-prefix&gt;  
      &lt;masklength-lower&gt;17&lt;/masklength-lower&gt;  
      &lt;masklength-upper&gt;18&lt;/masklength-upper&gt; 
    &lt;/prefix-list&gt;  
    &lt;prefix-list&gt; 
      &lt;ip-prefix&gt;2000:1::&lt;/ip-prefix&gt;  
      &lt;masklength-lower&gt;48&lt;/masklength-lower&gt;  
      &lt;masklength-upper&gt;48&lt;/masklength-upper&gt; 
    &lt;/prefix-list&gt;  
    &lt;prefix-list&gt; 
      &lt;ip-prefix&gt;2000:2::&lt;/ip-prefix&gt;  
      &lt;masklength-lower&gt;48&lt;/masklength-lower&gt;  
      &lt;masklength-upper&gt;48&lt;/masklength-upper&gt; 
    &lt;/prefix-list&gt;  
    &lt;prefix-list&gt; 
      &lt;ip-prefix&gt;2000:3::&lt;/ip-prefix&gt;  
      &lt;masklength-lower&gt;16&lt;/masklength-lower&gt;  
      &lt;masklength-upper&gt;16&lt;/masklength-upper&gt; 
    &lt;/prefix-list&gt;  
    &lt;prefix-list&gt; 
      &lt;ip-prefix&gt;::&lt;/ip-prefix&gt;  
      &lt;masklength-lower&gt;0&lt;/masklength-lower&gt;  
      &lt;masklength-upper&gt;128&lt;/masklength-upper&gt; 
    &lt;/prefix-list&gt; 
  &lt;/prefixes&gt; </artwork>
        </figure>
      </section>
    </section>

    <section title="NETCONF YANG Collection Examples">
      <t>The examples within this document use the "example-module" YANG
      module defined in Appendix A.</t>

      <section title="&quot;count&quot; Parameter">
        <t>In this example, the client requests the first two "skill"
        resources for a given admin resource:</t>

        <figure>
          <artwork>Request from NETCONF client
&lt;netconf:rpc netconf:message-id="101"
                xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get-pageable-list
          xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
       &lt;datastore&gt;running&lt;/datastore&gt;
       &lt;list-target&gt;admins/admin[name=Bob]/skill&lt;/list-target&gt;
       &lt;count&gt;2&lt;/count&gt;
      &lt;/get-pageable-list&gt;
    &lt;/netconf:rpc&gt;

   Response from NETCONF server
      &lt;netconf:rpc-reply netconf:message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
       &lt;pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Problem Solving&lt;/name&gt;
          &lt;rank&gt;98&lt;/rank&gt;
          ...
        &lt;/skill&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Conflict Resolution&lt;/name&gt;
          &lt;rank&gt;93&lt;/rank&gt;
          ...
        &lt;/skill&gt;
      &lt;/pageable-list&gt;
     &lt;/netconf:rpc-reply&gt;</artwork>
        </figure>
      </section>

      <section title="&quot;skip&quot; Parameter">
        <t>In this example, the client requests the next two skills resource,
        i.e., two skills resource starting from two.</t>

        <figure>
          <artwork>    Request from NETCONF client
   &lt;netconf:rpc netconf:message-id="101"
                xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get-pageable-list
          xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
      &lt;datastore&gt;running&lt;/datastore&gt;
     &lt;list-target&gt;admins/admin[name=Bob]/skill &lt;/list-target&gt;
     &lt;count&gt;2&lt;/count&gt;
     &lt;skip&gt;2&lt;/skip&gt;
      &lt;/get-pageable-list&gt;
    &lt;/netconf:rpc&gt;

   Response from NETCONF server
      &lt;netconf:rpc-reply netconf:message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
       &lt;pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Problem Solving&lt;/name&gt;
          &lt;rank&gt;98&lt;/rank&gt;
          ...
        &lt;/skill&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Conflict Resolution&lt;/name&gt;
          &lt;rank&gt;93&lt;/rank&gt;
          ...
        &lt;/skill&gt;
      &lt;/pageable-list&gt;
     &lt;/netconf:rpc-reply&gt;</artwork>
        </figure>
      </section>

      <section title="&quot;direction&quot; Parameter">
        <t>In this example, the client requests the first two "skill"
        resources in the forward direction for a given admin:</t>

        <figure>
          <artwork>Request from NETCONF client
  &lt;netconf:rpc netconf:message-id="101"
                xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get-pageable-list
          xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
     &lt;datastore&gt;running&lt;/datastore&gt;
     &lt;list-target&gt;admins/admin[name=Bob]/skill &lt;/list-target&gt;
     &lt;count&gt;2&lt;/count&gt;
     &lt;direction&gt;forward&lt;/direction&gt;
      &lt;/get-pageable-list&gt;
    &lt;/netconf:rpc&gt;

   Response from NETCONF server
      &lt;netconf:rpc-reply netconf:message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
       &lt;pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Problem Solving&lt;/name&gt;
          &lt;rank&gt;98&lt;/rank&gt;
          ...
        &lt;/skill&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Conflict Resolution&lt;/name&gt;
          &lt;rank&gt;93&lt;/rank&gt;
          ...
        &lt;/skill&gt;
      &lt;/pageable-list&gt;
     &lt;/netconf:rpc-reply&gt;</artwork>
        </figure>
      </section>

      <section title="&quot;sort&quot; Parameter">
        <t>In this example, the client requests the first 3 "skill" resources
        sorted by name for a given admin:</t>

        <figure>
          <artwork>   Request from NETCONF client
    &lt;netconf:rpc netconf:message-id="101"
                xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get-pageable-list
          xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
       &lt;datastore&gt;running&lt;/datastore&gt;
       &lt;list-target&gt;admins/admin[name=Bob]/skill &lt;/list-target&gt;
       &lt;count&gt;2&lt;/count&gt;
       &lt;sort&gt;name&lt;/sort&gt;
      &lt;/get-pageable-list&gt;
    &lt;/netconf:rpc&gt;

   Response from NETCONF server
      &lt;netconf:rpc-reply netconf:message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
        &lt;pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Problem Solving&lt;/name&gt;
          &lt;rank&gt;98&lt;/rank&gt;
          ...
        &lt;/skill&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Conflict Resolution&lt;/name&gt;
          &lt;rank&gt;93&lt;/rank&gt;
          ...
        &lt;/skill&gt;
      &lt;/pageable-list&gt;
     &lt;/netconf:rpc-reply&gt;</artwork>
        </figure>
      </section>

      <section title="Combination of &quot;where&quot; and &quot;count&quot; Parameters">
        <t>In this example, the client requests the first 2 "skill" resources
        from the selected skill resource list for a given admin:</t>

        <figure>
          <artwork>   Request from NETCONF client
    &lt;netconf:rpc netconf:message-id="101"
                xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get-pageable-list
          xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;datastore&gt;running&lt;/datastore&gt;
       &lt;list-target&gt;admins/admin[name=Bob]/skill &lt;/list-target&gt;
       &lt;count&gt;2&lt;/count&gt;
       &lt;where&gt;position&gt;=2 and position&lt;=9&lt;/where&gt;
      &lt;/get-pageable-list&gt;
    &lt;/netconf:rpc&gt;

   Response from NETCONF server
      &lt;netconf:rpc-reply netconf:message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
        &lt;pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Problem Solving&lt;/name&gt;
          &lt;rank&gt;98&lt;/rank&gt;
          ...
        &lt;/skill&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Conflict Resolution&lt;/name&gt;
          &lt;rank&gt;93&lt;/rank&gt;
          ...
        &lt;/skill&gt;
      &lt;/pageable-list&gt;
     &lt;/netconf:rpc-reply&gt;</artwork>
        </figure>
      </section>

      <section title="Combination of &quot;where&quot;, &quot;count&quot; and &quot;skip&quot; Parameters">
        <t>In this example, the client requests the first 2 "skill" resources
        from the selected "skill" resource list for a given admin:</t>

        <figure>
          <artwork>   Request from NETCONF client
   &lt;netconf:rpc netconf:message-id="101"
                xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get-pageable-list
          xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
      &lt;datastore&gt;running&lt;/datastore&gt;
       &lt;list-target&gt; admins/admin[name=Bob]/skill &lt;/list-target&gt;
       &lt;count&gt;2&lt;/count&gt;
       &lt;skip&gt;2&lt;/skip&gt;
       &lt;where&gt;position&gt;=2 and position&lt;=9&lt;/where&gt;
      &lt;/get-pageable-list&gt;
    &lt;/netconf:rpc&gt;

   Response from NETCONF server
      &lt;netconf:rpc-reply netconf:message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
       &lt;pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Problem Solving&lt;/name&gt;
          &lt;rank&gt;98&lt;/rank&gt;
          ...
        &lt;/skill&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Conflict Resolution&lt;/name&gt;
          &lt;rank&gt;93&lt;/rank&gt;
          ...
        &lt;/skill&gt;
      &lt;/pageable-list&gt;
     &lt;/netconf:rpc-reply&gt;</artwork>
        </figure>
      </section>

      <section title="Combination of &quot;where&quot;, &quot;count&quot;,&quot;skip&quot; and &quot;sort&quot; Parameters">
        <t>In this example, the client requests the first 2 "skill" resources
        from the selected skill resources list for a given admin:</t>

        <figure>
          <artwork>   Request from NETCONF client
    &lt;netconf:rpc netconf:message-id="101"
                xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get-pageable-list
          xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
       &lt;datastore&gt;running&lt;/datastore&gt;
       &lt;list-target&gt; admins/admin[name=Bob]/skill &lt;/list-target&gt;
       &lt;count&gt;2&lt;/count&gt;
       &lt;skip&gt;2&lt;/skip&gt;
       &lt;sort&gt;name&lt;/sort&gt;
       &lt;where&gt;[position&gt;=2 and position&lt;=9]&lt;/where&gt;
      &lt;/get-pageable-list&gt;
    &lt;/netconf:rpc&gt;

   Response from NETCONF server
      &lt;netconf:rpc-reply netconf:message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
        &lt;pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination"&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Problem Solving&lt;/name&gt;
          &lt;rank&gt;98&lt;/rank&gt;
          ...
        &lt;/skill&gt;
        &lt;skill xmlns="http://example.com/ns/example-module"&gt;
          &lt;name&gt;Conflict Resolution&lt;/name&gt;
          &lt;rank&gt;93&lt;/rank&gt;
          ...
        &lt;/skill&gt;
      &lt;/pageable-list&gt;
     &lt;/netconf:rpc-reply&gt;</artwork>
        </figure>
      </section>
    </section>

    <!--
    <section title="Contributors" numbered="no">
      <figure>
        <artwork>Per Andersson
perander@cisco.com

David Cornejo
dcornejo@gmail.com</artwork>
      </figure>
    </section>
    -->

    <section title="Acknowledgements" numbered="no">
      <t>This work has benefited from the discussions of restconf resource
      collection over the years, in particular,
      [I-D.ietf-netconf-restconf-collection] which provides enhanced filtering
      features for the retrieval of data nodes with the GET method and
      [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:<figure>
          <artwork>Andy Bierman
Martin Bj&ouml;rklund
Robert Varga</artwork>
        </figure></t>
    </section>

  </back>
</rfc>
