- Modified ietf-netconf-list-pagination.yang:
- changed get-pagable -> get-pageable
- renamed count -> limit
- renamed skip -> offset
- added import ietf-yang-metadata
- added md:annotation remaining
354 lines
12 KiB
YANG
354 lines
12 KiB
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)";
|
|
}
|
|
import ietf-yang-metadata {
|
|
prefix "md";
|
|
reference
|
|
"RFC 7952: Defining and Using Metadata with YANG";
|
|
}
|
|
|
|
organization
|
|
"IETF NETCONF (Network Configuration) Working Group";
|
|
contact
|
|
"WG Web: <http://tools.ietf.org/wg/netconf/>
|
|
WG List: <mailto:netconf@ietf.org>
|
|
|
|
Editor:
|
|
|
|
Editor:
|
|
|
|
Editor: ";
|
|
description
|
|
"This module define a new operation -- <get-collection>
|
|
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.
|
|
|
|
Clixon:
|
|
- changed get-pagable -> get-pageable
|
|
- renamed count -> limit
|
|
- renamed skip -> offset
|
|
- added import ietf-yang-metadata
|
|
- added md:annotation remaining
|
|
";
|
|
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";
|
|
}
|
|
// Annotations
|
|
md:annotation remaining {
|
|
type uint32;
|
|
description
|
|
"This annotation contains the number of elements removed
|
|
from a result set after a 'limit' or 'sublist-limit'
|
|
operation. If no elements were removed, this annotation
|
|
MUST NOT appear. The minimum value (0), which never
|
|
occurs in normal operation, is reserved to represent
|
|
'unknown'. The maximum value (2^32-1) is reserved to
|
|
represent any value greater than or equal to 2^32-1
|
|
elements.";
|
|
}
|
|
|
|
rpc get-pageable-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 <rpc-error> element
|
|
with an <error-tag> 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
|
|
<rpc-error> element with an <error-tag> 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 <rpc-error> element with an
|
|
<error-tag> 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
|
|
<get-data> 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 limit {
|
|
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 offset {
|
|
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 '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
|
|
'Config false' lists and leaf-lists, the node SHOULD
|
|
have the 'TBD' extension indicating that it has been
|
|
indexed, enabling efficient sorts.";
|
|
}
|
|
}
|
|
type enumeration {
|
|
enum default {
|
|
description
|
|
"Indicates that the 'default' order is assumed. 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.";
|
|
}
|
|
}
|
|
}
|
|
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 'config'
|
|
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.";
|
|
}
|
|
}
|
|
}
|
|
}
|