Skip to main content

RESTCONF Extensions to Support List Pagination
draft-wwlh-netconf-list-pagination-rc-00

The information below is for an old version of the document.
Document Type
This is an older version of an Internet-Draft whose latest revision state is "Replaced".
Authors Kent Watsen , Qin Wu , Olof Hagsand , Hongwei Li
Last updated 2020-11-02
Replaced by draft-ietf-netconf-list-pagination-rc
RFC stream (None)
Formats
Stream Stream state (No stream defined)
Consensus boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date (None)
Responsible AD (None)
Send notices to (None)
draft-wwlh-netconf-list-pagination-rc-00
NETCONF Working Group                                          K. Watsen
Internet-Draft                                            Watsen Network
Intended status: Standards Track                                   Q. Wu
Expires: May 6, 2021                                              Huawei
                                                              O. Hagsand

                                                                   H. Li
                                                                     HPE
                                                        November 2, 2020

             RESTCONF Extensions to Support List Pagination
                draft-wwlh-netconf-list-pagination-rc-00

Abstract

   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.

   Pagination mechanisms are needed to allow a client to iterate through
   a large list, in a manner that is most efficient for the application.

   This document Updates RFC 8040 to declare "list" and "leaf-list" as
   resource targets for the RESTCONF operations such as GET, POST
   operations.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on May 6, 2021.

Watsen, et al.             Expires May 6, 2021                  [Page 1]
Internet-Draft         RESTCONF Pagination Support         November 2020

Copyright Notice

   Copyright (c) 2020 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  RESTCONF Extensions . . . . . . . . . . . . . . . . . . . . .   4
     2.1.  RESTCONF Media Type . . . . . . . . . . . . . . . . . . .   4
     2.2.  New Resource Target . . . . . . . . . . . . . . . . . . .   4
   3.  YANG Module for List Pagination . . . . . . . . . . . . . . .   4
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   6
     4.1.  Registrations for New URI and YANG Module . . . . . . . .   6
     4.2.  Media Types . . . . . . . . . . . . . . . . . . . . . . .   6
       4.2.1.  Media Type "application/yang-collection+xml"  . . . .   6
       4.2.2.  Media Type "application/yang-collection+json" . . . .   7
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   9
   6.  Contributors  . . . . . . . . . . . . . . . . . . . . . . . .   9
   7.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   9
   8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   9
     8.1.  Normative References  . . . . . . . . . . . . . . . . . .   9
     8.2.  Informative References  . . . . . . . . . . . . . . . . .  11
   Appendix A.  RESTCONF YANG Collection Examples  . . . . . . . . .  11
     A.1.  "count" Parameter . . . . . . . . . . . . . . . . . . . .  11
     A.2.  "skip" Parameter  . . . . . . . . . . . . . . . . . . . .  12
     A.3.  "direction" Parameter . . . . . . . . . . . . . . . . . .  13
     A.4.  "sort" Parameter  . . . . . . . . . . . . . . . . . . . .  14
     A.5.  Combination of "where" and "count" Parameters . . . . . .  15
     A.6.  Combination of "where", "count" and "skip" Parameters . .  16
     A.7.  Combination of "where", "count","skip" and "sort"
           Parameters  . . . . . . . . . . . . . . . . . . . . . . .  17
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  18

Watsen, et al.             Expires May 6, 2021                  [Page 2]
Internet-Draft         RESTCONF Pagination Support         November 2020

1.  Introduction

   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.

   Pagination mechanisms are needed to allow a client to iterate through
   a large list, in a manner that is most efficient for the application.
   The RPC operation defined in [I-D.wwlh-netconf-list-pagination-nc]
   can be used by the RESTCONF protocol [RFC8040] if the RESTCONF server
   implements the "ietf-yang-list-pagination" module [I-D.wwlh-netconf-
   list-pagination-nc].

   This document Updates RFC 8040 to declare "list" and "leaf-list" as
   resource targets for the RESTCONF operations such as GET, POST
   operations.

1.1.  Terminology

   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 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

   The following terms are defined in [RFC8342] [RFC7950] and are not
   redefined here:

   o  server

   o  startup configuration datastore

   o  candidate configuration datastore

   o  running configuration datastore

   o  intended configuration datastore

   o  operational state datastore

   o  conventional configuration datastore

   o  datastore schema

   o  RPC operation

   The following terms are defined in this document as follows:

Watsen, et al.             Expires May 6, 2021                  [Page 3]
Internet-Draft         RESTCONF Pagination Support         November 2020

2.  RESTCONF Extensions

   This section describes the RESTCONF extensions needed to support the
   Pagination mechanism.

2.1.  RESTCONF Media Type

   The following resource type is defined in this document:

                  +-----------------+-----------------------------+
                  | Resource        | Media Type                  |
                  +-----------------+-----------------------------+
                  | YANG-Collection | application/yang-collection |
                  +-----------------+-----------------------------+
                              RESTCONF Media Type

2.2.  New Resource Target

   The "get-list-pagination" RPC operation defined in "ietf-yang-list-
   pagination" module [I-D.wwlh-netconf-list-pagination-nc] can use the
   RESTCONF target resource URI to identify the resource that will be
   filtered and returned.  A collection resource contains a set of data
   resources.  It is used to represent all instances or a subset of all
   instances in a YANG list or leaf-list.  A collection resource can be
   used as target resource and retrieved with the GET method or POST
   method.  The "ietf-restconf-list-pagination" YANG module contains the
   "yang-collection" yang data template with the "yang-data"extension
   which specifies the syntax and semantics of a "yang-collection" media
   type.

3.  YANG Module for List Pagination

   The "ietf-restconf-list-pagination" module defines conceptual
   definitions within groupings, which are not meant to be implemented
   as datastore contents by a server.

<CODE BEGINS> file "ietf-restconf-list-pagination@2020-010-30.yang"
module ietf-restconf-list-pagination {
  namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination";
  prefix rlpg;

  import ietf-restconf {
    prefix rc;
  }

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

Watsen, et al.             Expires May 6, 2021                  [Page 4]
Internet-Draft         RESTCONF Pagination Support         November 2020

    "WG Web:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>

     Editor:

     Editor:

     Editor:   ";
  description
    "This module contains conceptual YANG specifications
     for the RESTCONF Collection resource type.
     Note that the YANG definitions within this module do not
     represent configuration data of any kind.
     The YANG grouping statements provide a normative syntax
     for XML and JSON message encoding purposes.

     Copyright (c) 2015 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
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX; see
     the RFC itself for full legal notices.";

  revision 2015-01-30 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: RESTCONF Collection Resource.";
  }
  rc:yang-data yang-collection {
    uses collection;
  }

  grouping collection {
    description
      "Conceptual container representing the
       yang-collection resource type.";
    container yang-collection {
      description
        "Container representing the yang-collection
         resource type.";
    }

Watsen, et al.             Expires May 6, 2021                  [Page 5]
Internet-Draft         RESTCONF Pagination Support         November 2020

  }
}
<CODE ENDS>

4.  IANA Considerations

4.1.  Registrations for New URI and YANG Module

   This document registers one URI in the IETF XML Registry [RFC3688].
   The following registration has been made:

     URI: urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination
     Registrant Contact: The IESG.
     XML: N/A, the requested URI is an XML namespace.

   This document registers one YANG module in the YANG Module Names
   Registry [RFC6020].  The following registration has been made:

    name: ietf-restconf-list-pagination
    namespace: urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination
    prefix: rlpg
    RFC: xxxx

4.2.  Media Types

4.2.1.  Media Type "application/yang-collection+xml"

     Type name: application

     Subtype name: yang-collection+xml

     Required parameters: None

     Optional parameters: None

     Encoding considerations: 8-bit
        The "utf-8" charset is always used for this type.
        Each conceptual YANG data node is encoded according to the
        XML Encoding Rules and Canonical Format for the specific
        YANG data node type defined in [RFC7950].

     Security considerations: Security considerations related
        to the generation and consumption of RESTCONF messages
        are discussed in Section 5 of RFC 8072.
        Additional security considerations are specific to the
        semantics of particular YANG data models.  Each YANG module
        is expected to specify security considerations for the
        YANG data defined in that module.

Watsen, et al.             Expires May 6, 2021                  [Page 6]
Internet-Draft         RESTCONF Pagination Support         November 2020

     Interoperability considerations: RFC 8072 specifies the format
        of conforming messages and the interpretation thereof.

     Published specification: RFC 8072

     Applications that use this media type: Instance document
        data parsers used within a protocol or automation tool
        that utilize the YANG Patch data structure.

     Fragment identifier considerations: The syntax and semantics
        of fragment identifiers are the same as the syntax and semantics
        specified for the "application/xml" media type.

     Additional information:

        Deprecated alias names for this type: N/A
        Magic number(s): N/A
        File extension(s): None
        Macintosh file type code(s): "TEXT"

     Person & email address to contact for further information: See
        the Authors' Addresses section of RFC 8072.

     Intended usage: COMMON

     Restrictions on usage: N/A

     Author: See the Authors' Addresses section of RFC 8072.

     Change controller: Internet Engineering Task Force
        (mailto:iesg@ietf.org).

     Provisional registration? (standards tree only): no

4.2.2.  Media Type "application/yang-collection+json"

     Type name: application

     Subtype name: yang-collection+json

     Required parameters: None

     Optional parameters: None

     Encoding considerations: 8-bit
        The "utf-8" charset is always used for this type.
        Each conceptual YANG data node is encoded according to the
        XML Encoding Rules and Canonical Format for the specific

Watsen, et al.             Expires May 6, 2021                  [Page 7]
Internet-Draft         RESTCONF Pagination Support         November 2020

        YANG data node type defined in [RFC7950].

     Security considerations: Security considerations related
        to the generation and consumption of RESTCONF messages
        are discussed in Section 5 of RFC 8072.
        Additional security considerations are specific to the
        semantics of particular YANG data models.  Each YANG module
        is expected to specify security considerations for the
        YANG data defined in that module.

     Interoperability considerations: RFC 8072 specifies the format
        of conforming messages and the interpretation thereof.

     Published specification: RFC 8072

     Applications that use this media type: Instance document
        data parsers used within a protocol or automation tool
        that utilize the YANG Patch data structure.

     Fragment identifier considerations: The syntax and semantics
        of fragment identifiers are the same as the syntax and semantics
        specified for the "application/xml" media type.

     Additional information:

        Deprecated alias names for this type: N/A
        Magic number(s): N/A
        File extension(s): None
        Macintosh file type code(s): "TEXT"

     Person & email address to contact for further information: See
        the Authors' Addresses section of RFC 8072.

     Intended usage: COMMON

     Restrictions on usage: N/A

     Author: See the Authors' Addresses section of RFC 8072.

     Change controller: Internet Engineering Task Force
        (mailto:iesg@ietf.org).

     Provisional registration? (standards tree only): no

Watsen, et al.             Expires May 6, 2021                  [Page 8]
Internet-Draft         RESTCONF Pagination Support         November 2020

5.  Security Considerations

   The YANG module defined in this document extends the base operations
   for NETCONF [RFC6241] and RESTCONF [RFC8040].  The lowest NETCONF
   layer is the secure transport layer, and the mandatory-to-implement
   secure transport is Secure Shell (SSH) [RFC6242].  The lowest
   RESTCONF layer is HTTPS, and the mandatory-to-implement secure
   transport is TLS [RFC8446].

   The security constraints for the base RESTCONF protocol (see
   Section 12 of [RFC8040]) apply to the new RESTCONF target resources
   defined in this document.

6.  Contributors

   Per Andersson
   perander@cisco.com

   David Cornejo
   dcornejo@gmail.com

7.  Acknowledgements

   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.  The authors would like
   to thank the following for lively discussions on list:

   Andy Bierman
   Martin Bjoerklund
   Robert Varga

8.  References

8.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

Watsen, et al.             Expires May 6, 2021                  [Page 9]
Internet-Draft         RESTCONF Pagination Support         November 2020

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC6243]  Bierman, A. and B. Lengyel, "With-defaults Capability for
              NETCONF", RFC 6243, DOI 10.17487/RFC6243, June 2011,
              <https://www.rfc-editor.org/info/rfc6243>.

   [RFC6991]  Schoenwaelder, J., Ed., "Common YANG Data Types",
              RFC 6991, DOI 10.17487/RFC6991, July 2013,
              <https://www.rfc-editor.org/info/rfc6991>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8342]  Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
              and R. Wilton, "Network Management Datastore Architecture
              (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
              <https://www.rfc-editor.org/info/rfc8342>.

   [RFC8525]  Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K.,
              and R. Wilton, "YANG Library", RFC 8525,
              DOI 10.17487/RFC8525, March 2019,
              <https://www.rfc-editor.org/info/rfc8525>.

Watsen, et al.             Expires May 6, 2021                 [Page 10]
Internet-Draft         RESTCONF Pagination Support         November 2020

8.2.  Informative References

   [RFC8340]  Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
              BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
              <https://www.rfc-editor.org/info/rfc8340>.

Appendix A.  RESTCONF YANG Collection Examples

   The examples within this document use the "example-module" YANG
   module defined in Appendix A of [I-D.wwlh-netconf-list-pagination-
   nc].

A.1.  "count" Parameter

   In this example, the client requests the first two "skill" resources
   for a given admin resource:

Watsen, et al.             Expires May 6, 2021                 [Page 11]
Internet-Draft         RESTCONF Pagination Support         November 2020

   Request from the RESTCONF client:

      GET /restconf/data/example-module:get-list-pagination  HTTP/1.1
      Host: example.com
      Accept: application/yang-collection+xml
      <yang-collection
          xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
       <datastore>running</datastore>
       <list-target>admins/admin[name=Bob]/skill</list-target>
       <count>2</count>
      </yang-collection>
    </netconf:rpc>

      Response from the RESTCONF server:

      HTTP/1.1 200 OK
      Date: Thu, 26 Jan 2017 20:56:30 GMT
      Server: example-server
      Last-Modified: Thu, 26 Jan 2017 20:55:30 GMT
      Content-Type: application/yang-collection+xml

       <pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <skill xmlns="http://example.com/ns/example-module">
          <name>Problem Solving</name>
          <rank>98</rank>
          ...
        </skill>
        <skill xmlns="http://example.com/ns/example-module">
          <name>Conflict Resolution</name>
          <rank>93</rank>
          ...
        </skill>
      </pageable-list>
     </netconf:rpc-reply>

A.2.  "skip" Parameter

   In this example, the client requests the next two skills resource,
   i.e., two skills resource starting from two.

Watsen, et al.             Expires May 6, 2021                 [Page 12]
Internet-Draft         RESTCONF Pagination Support         November 2020

      GET /restconf/data/example-module:get-list-pagination  HTTP/1.1
      Host: example.com
      Accept: application/yang-collection+xml
      <yang-collection
          xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
      <datastore>running</datastore>
     <list-target>admins/admin[name=Bob]/skill</list-target>
     <count>2</count>
     <skip>2</skip>
      </yang-collection>
    </netconf:rpc>

      Response from the RESTCONF server:

      HTTP/1.1 200 OK
      Date: Thu, 26 Jan 2017 20:56:30 GMT
      Server: example-server
      Last-Modified: Thu, 26 Jan 2017 20:55:30 GMT
      Content-Type: application/yang-collection+xml
       <pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <skill xmlns="http://example.com/ns/example-module">
          <name>Problem Solving</name>
          <rank>98</rank>
          ...
        </skill>
        <skill xmlns="http://example.com/ns/example-module">
          <name>Conflict Resolution</name>
          <rank>93</rank>
          ...
        </skill>
      </pageable-list>
     </netconf:rpc-reply>

A.3.  "direction" Parameter

   In this example, the client requests the first two "skill" resources
   in the 'forwad' direction for a given admin:

Watsen, et al.             Expires May 6, 2021                 [Page 13]
Internet-Draft         RESTCONF Pagination Support         November 2020

      GET /restconf/data/example-module:get-list-pagination  HTTP/1.1
      Host: example.com
      Accept: application/yang-collection+xml
      <yang-collection
          xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
     <datastore>running</datastore>
     <list-target>admins/admin[name=Bob]/skill </list-target>
     <count>2</count>
     <direction>forward</direction>
      </yang-collection>
    </netconf:rpc>

      Response from the RESTCONF server:

      HTTP/1.1 200 OK
      Date: Thu, 26 Jan 2017 20:56:30 GMT
      Server: example-server
      Last-Modified: Thu, 26 Jan 2017 20:55:30 GMT
      Content-Type: application/yang-collection+xml
       <pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <skill xmlns="http://example.com/ns/example-module">
          <name>Problem Solving</name>
          <rank>98</rank>
          ...
        </skill>
        <skill xmlns="http://example.com/ns/example-module">
          <name>Conflict Resolution</name>
          <rank>93</rank>
          ...
        </skill>
      </pageable-list>
     </netconf:rpc-reply>

A.4.  "sort" Parameter

   In this example, the client requests the first 2 "skill" resources
   sorted by name for a given admin:

Watsen, et al.             Expires May 6, 2021                 [Page 14]
Internet-Draft         RESTCONF Pagination Support         November 2020

      GET /restconf/data/example-module:get-list-pagination  HTTP/1.1
      Host: example.com
      Accept: application/yang-collection+xml
      <yang-collection
          xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
       <datastore>running</datastore>
       <list-target>admins/admin[name=Bob]/skill </list-target>
       <count>2</count>
       <sort>name</sort>
      </yang-collection>
    </netconf:rpc>

      Response from the RESTCONF server:

      HTTP/1.1 200 OK
      Date: Thu, 26 Jan 2017 20:56:30 GMT
      Server: example-server
      Last-Modified: Thu, 26 Jan 2017 20:55:30 GMT
      Content-Type: application/yang-collection+xml
        <pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <skill xmlns="http://example.com/ns/example-module">
          <name>Problem Solving</name>
          <rank>98</rank>
          ...
        </skill>
        <skill xmlns="http://example.com/ns/example-module">
          <name>Conflict Resolution</name>
          <rank>93</rank>
          ...
        </skill>
      </pageable-list>
     </netconf:rpc-reply>

A.5.  Combination of "where" and "count" Parameters

   In this example, the client requests the first 2 "skill" resources
   from the selected skill resource list for a given admin:

Watsen, et al.             Expires May 6, 2021                 [Page 15]
Internet-Draft         RESTCONF Pagination Support         November 2020

      GET /restconf/data/example-module:get-list-pagination  HTTP/1.1
      Host: example.com
      Accept: application/yang-collection+xml
      <yang-collection
          xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <datastore>running</datastore>
       <list-target>admins/admin[name=Bob]/skill</list-target>
       <count>2</count>
      <where>[position>=2 and position<=9]</where>
      </yang-collection>
    </netconf:rpc>

      Response from the RESTCONF server:

      HTTP/1.1 200 OK
      Date: Thu, 26 Jan 2017 20:56:30 GMT
      Server: example-server
      Last-Modified: Thu, 26 Jan 2017 20:55:30 GMT
      Content-Type: application/yang-collection+xml
        <pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <skill xmlns="http://example.com/ns/example-module">
          <name>Problem Solving</name>
          <rank>98</rank>
          ...
        </skill>
        <skill xmlns="http://example.com/ns/example-module">
          <name>Conflict Resolution</name>
          <rank>93</rank>
          ...
        </skill>
      </pageable-list>
     </netconf:rpc-reply>

A.6.  Combination of "where", "count" and "skip" Parameters

   In this example, the client requests the first 2 "skill" resources
   from the selected "skill" resource list for a given admin:

Watsen, et al.             Expires May 6, 2021                 [Page 16]
Internet-Draft         RESTCONF Pagination Support         November 2020

      GET /restconf/data/example-module:get-list-pagination  HTTP/1.1
      Host: example.com
      Accept: application/yang-collection+xml
      <yang-collection
          xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
      <datastore>running</datastore>
       <list-target> admins/admin[name=Bob]/skill </list-target>
       <count>2</count>
       <skip>2</skip>
       <where>position>=2 and position<=9</where>
      </yang-collection>
    </netconf:rpc>

      Response from the RESTCONF server:

      HTTP/1.1 200 OK
      Date: Thu, 26 Jan 2017 20:56:30 GMT
      Server: example-server
      Last-Modified: Thu, 26 Jan 2017 20:55:30 GMT
      Content-Type: application/yang-collection+xml
       <pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <skill xmlns="http://example.com/ns/example-module">
          <name>Problem Solving</name>
          <rank>98</rank>
          ...
        </skill>
        <skill xmlns="http://example.com/ns/example-module">
          <name>Conflict Resolution</name>
          <rank>93</rank>
          ...
        </skill>
      </pageable-list>
     </netconf:rpc-reply>

A.7.  Combination of "where", "count","skip" and "sort" Parameters

   In this example, the client requests the first 2 "skill" resources
   from the selected skill resources list for a given admin:

Watsen, et al.             Expires May 6, 2021                 [Page 17]
Internet-Draft         RESTCONF Pagination Support         November 2020

      GET /restconf/data/example-module:get-list-pagination  HTTP/1.1
      Host: example.com
      Accept: application/yang-collection+xml
      <yang-collection
          xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
       <datastore>running</datastore>
       <list-target> admins/admin[name=Bob]/skill </list-target>
       <count>2</count>
       <skip>2</skip>
       <sort>name</sort>
       <where>position>=2 and position<=9</where>
      </yang-collection>
    </netconf:rpc>

      Response from the RESTCONF server:

      HTTP/1.1 200 OK
      Date: Thu, 26 Jan 2017 20:56:30 GMT
      Server: example-server
      Last-Modified: Thu, 26 Jan 2017 20:55:30 GMT
      Content-Type: application/yang-collection+xml
        <pageable-list xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-list-pagination">
        <skill xmlns="http://example.com/ns/example-module">
          <name>Problem Solving</name>
          <rank>98</rank>
          ...
        </skill>
        <skill xmlns="http://example.com/ns/example-module">
          <name>Conflict Resolution</name>
          <rank>93</rank>
          ...
        </skill>
      </pageable-list>
     </netconf:rpc-reply>

Authors' Addresses

   Kent Watsen
   Watsen Network

   Email: kent+ietf@watsen.net

Watsen, et al.             Expires May 6, 2021                 [Page 18]
Internet-Draft         RESTCONF Pagination Support         November 2020

   Qin Wu
   Huawei
   101 Software Avenue, Yuhua District
   Nanjing, Jiangsu  210012
   China

   Email: bill.wu@huawei.com

   Olof Hagsand

   Email: olof@hagsand.se

   Hongwei Li
   HPE

   Email: flycoolman@gmail.com

Watsen, et al.             Expires May 6, 2021                 [Page 19]