Olof hagsand 2021-11-09 17:38:17 +01:00
parent baa6e821a8
commit a4b4dc97ce
28 changed files with 1011 additions and 527 deletions

View file

@ -46,7 +46,6 @@ YANGSPECS += clixon-lib@2021-03-08.yang # 5.1
YANGSPECS += clixon-rfc5277@2008-07-01.yang
YANGSPECS += clixon-xml-changelog@2019-03-21.yang
YANGSPECS += clixon-restconf@2021-05-20.yang # 5.2
YANGSPECS += clixon-netconf-list-pagination@2021-08-27.yang
APPNAME = clixon # subdir ehere these files are installed

View file

@ -1,182 +0,0 @@
module clixon-netconf-list-pagination {
yang-version 1.1;
namespace "http://clicon.org/clixon-netconf-list-pagination";
prefix cp;
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-yang-metadata {
prefix "md";
reference
"RFC 7952: Defining and Using Metadata with YANG";
}
import ietf-netconf {
prefix nc;
reference
"RFC 6241: Network Configuration Protocol (NETCONF)";
}
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 2021-08-27 {
description
"Dervied from ietf-netconf-list-pagination@2020-10-30.";
reference
"RFC XXXX: YANG Based Pagination.";
}
// 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.";
}
grouping pagination-parameters {
leaf list-pagination {
type boolean;
default false;
description
"NETCONF get / get-config needs some way to know that this is a pagination
request, in which case the target is a list/leaf-list and the elements below
(limit/offset/...) are valid.
RESTCONF list pagination has a specific media-type for this purpose.
This is an experimental proposal to make this property explicit.
Possibly there is a better way (annotation?) to signal that this is in fact a
list pagination request.
It is also possible to determine this using heurestics (ie a 'limit' property exixts),
but it seems not 100% deterministic.";
}
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 'limit' 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 'offset' parameter is either an integer greater than
or equal to 1, or the string 'unbounded'. The string
'none' 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.";
}
}
augment /nc:get-config/nc:input {
uses pagination-parameters;
}
// extending the get operation
augment /nc:get/nc:input {
uses pagination-parameters;
}
}

View file

@ -53,10 +53,18 @@ YANGSPECS += ietf-datastores@2018-02-14.yang
YANGSPECS += ietf-yang-patch@2017-02-22.yang
# For remaining attribute in list-pagination:
YANGSPECS += ietf-yang-metadata@2016-08-05.yang
# in draft-wwlh-netconf-list-pagination:
YANGSPECS += ietf-netconf-list-pagination@2020-10-30.yang
# in draft-wwlh-netconf-list-pagination-rc:
YANGSPECS += ietf-restconf-list-pagination@2015-01-30.yang
# XXX brings in NACM which breaks tests
# YANGSPECS += ietf-system-capabilities@2021-04-02.yang
# For remaining attribute in list-pagination-nc:
YANGSPECS += ietf-netconf-nmda@2019-01-07.yang
# For remaining attribute in ietf-netconf-nmda
YANGSPECS += ietf-origin@2018-02-14.yang
YANGSPECS += ietf-netconf-with-defaults@2011-06-01.yang
# in draft-wwlh-netconf-list-pagination-00.txt
YANGSPECS += ietf-list-pagination@2021-10-25.yang
# in draft-wwlh-netconf-list-pagination-nc-02.txt
YANGSPECS += ietf-list-pagination-nc@2021-10-25.yang
all:

View file

@ -0,0 +1,101 @@
module ietf-list-pagination-nc {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-list-pagination-nc";
prefix lpgnc;
import ietf-netconf {
prefix nc;
reference
"RFC 6241: Network Configuration Protocol (NETCONF)";
}
import ietf-netconf-nmda {
prefix ncds;
reference
"RFC 8526: NETCONF Extensions to Support the
Network Management Datastore Architecture";
}
import ietf-list-pagination {
prefix lp;
reference
"RFC XXXX: List Pagination for YANG-driven Protocols";
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>";
description
"This module augments the <get>, <get-config>, and <get-data>
'rpc' statements to support list pagination.
Copyright (c) 2021 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 XXXX
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC
itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all
capitals, as shown here.";
revision 2021-10-25 {
description
"Initial revision.";
reference
"RFC XXXX: NETCONF Extensions to Support List Pagination";
}
grouping pagination-parameters {
description "A grouping for list pagination parameters.";
container list-pagination {
description "List pagination parameters.";
presence "Flag that request contains pagination parameters";
uses lp:where-param-grouping;
uses lp:sort-by-param-grouping;
uses lp:direction-param-grouping;
uses lp:offset-param-grouping;
uses lp:limit-param-grouping;
uses lp:sublist-limit-param-grouping;
}
}
augment "/nc:get/nc:input" {
description
"Allow the 'get' operation to use content filter
parameter for specifying the YANG list or leaf-list
that is to be retrieved";
uses pagination-parameters;
}
augment "/nc:get-config/nc:input" {
description
"Allow the 'get-config' operation to use content filter
parameter for specifying the YANG list or leaf-list
that is to be retrieved";
uses pagination-parameters;
}
augment "/ncds:get-data/ncds:input" {
description
"Allow the 'get-data' operation to use content filter
parameter for specifying the YANG list or leaf-list
that is to be retrieved";
uses pagination-parameters;
}
}

View file

@ -0,0 +1,299 @@
module ietf-list-pagination {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-list-pagination";
prefix lpg;
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-yang-metadata {
prefix md;
reference
"RFC 7952: Defining and Using Metadata with YANG";
}
/* XXX system-capabilities brings in NACM that breaks clixon testing
import ietf-system-capabilities {
prefix sysc;
reference
"draft-ietf-netconf-notification-capabilities:
YANG Modules describing Capabilities for
Systems and Datastore Update Notifications";
}
*/
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>";
description
"This module is used by servers to 1) indicate they support
pagination on 'list' and 'leaf-list' resources, 2) define a
grouping for each list-pagination parameter, and 3) indicate
which 'config false' lists have constrained 'where' and
'sort-by' parameters and how they may be used, if at all.
Copyright (c) 2021 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 XXXX
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC
itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all
capitals, as shown here.";
revision 2021-10-25 {
description
"Initial revision.";
reference
"RFC XXXX: List Pagination for YANG-driven Protocols";
}
// Annotations
md:annotation remaining {
type union {
type uint32;
type enumeration {
enum "unknown" {
description
"Indicates that number of remaining entries is unknown
to the server in case, e.g., the server has determined
that counting would be prohibitively expensive.";
}
}
}
description
"This annotation contains the number of elements not included
in the result set (a positive value) due to 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.";
}
// Identities
identity list-pagination-error {
description
"Base identity for list-pagination errors.";
}
identity offset-out-of-range {
base list-pagination-error;
description
"The 'offset' query parameter value is greater than the number
of instances in the target list or leaf-list resource.";
}
// Groupings
grouping where-param-grouping {
description
"This grouping may be used by protocol-specific YANG modules
to define a protocol-specific query parameter.";
leaf where {
type union {
type yang:xpath1.0;
type enumeration {
enum "unfiltered" {
description
"Indicates that no entries are to be filtered
from the working result-set.";
}
}
}
default "unfiltered";
description
"The 'where' parameter specifies a boolean expression
that result-set entries must match.
It is an error if the XPath expression references a node
identifier that does not exist in the schema, is optional
or conditional in the schema or, for constrained 'config
false' lists and leaf-lists, if the node identifier does
not point to a node having the 'indexed' extension
statement applied to it (see RFC XXXX).";
}
}
grouping sort-by-param-grouping {
description
"This grouping may be used by protocol-specific YANG modules
to define a protocol-specific query parameter.";
leaf sort-by {
type union {
type string {
// An RFC 7950 'descendant-schema-nodeid'.
pattern '([0-9a-fA-F]*:)?[0-9a-fA-F]*'
+ '(/([0-9a-fA-F]*:)?[0-9a-fA-F]*)*';
}
type enumeration {
enum "none" {
description
"Indicates that the list or leaf-list's default
order is to be used, per the YANG 'ordered-by'
statement.";
}
}
}
default "none";
description
"The 'sort-by' parameter indicates the node in the
working result-set (i.e., after the 'where' parameter
has been applied) that entries should be sorted by.
Sorts are in ascending order (e.g., '1' before '9',
'a' before 'z', etc.). Missing values are sorted to
the end (e.g., after all nodes having values).";
}
}
grouping direction-param-grouping {
description
"This grouping may be used by protocol-specific YANG modules
to define a protocol-specific query parameter.";
leaf direction {
type enumeration {
enum forwards {
description
"Indicates that entries should be traversed from
the first to last item in the working result set.";
}
enum backwards {
description
"Indicates that entries should be traversed from
the last to first item in the working result set.";
}
}
default "forwards";
description
"The 'direction' parameter indicates how the entries in the
working result-set (i.e., after the 'sort-by' parameter
has been applied) should be traversed.";
}
}
grouping offset-param-grouping {
description
"This grouping may be used by protocol-specific YANG modules
to define a protocol-specific query parameter.";
leaf offset {
type uint32;
default 0;
description
"The 'offset' parameter indicates the number of entries
in the working result-set (i.e., after the 'direction'
parameter has been applied) that should be skipped over
when preparing the response.";
}
}
grouping limit-param-grouping {
description
"This grouping may be used by protocol-specific YANG modules
to define a protocol-specific query parameter.";
leaf limit {
type union {
type uint32 {
range "1..max";
}
type enumeration {
enum "unbounded" {
description
"Indicates that the number of entries that may be
returned is unbounded.";
}
}
}
default "unbounded";
description
"The 'limit' parameter limits the number of entries returned
from the working result-set (i.e., after the 'offset'
parameter has been applied).
Any result-set that is limited includes, somewhere in its
encoding, the metadata value 'remaining' to indicate the
number entries not included in the result set.";
}
}
grouping sublist-limit-param-grouping {
description
"This grouping may be used by protocol-specific YANG modules
to define a protocol-specific query parameter.";
leaf sublist-limit {
type union {
type uint32 {
range "1..max";
}
type enumeration {
enum "unbounded" {
description
"Indicates that the number of entries that may be
returned is unbounded.";
}
}
}
default "unbounded";
description
"The 'sublist-limit' parameter limits the number of entries
for descendent lists and leaf-lists.
Any result-set that is limited includes, somewhere in
its encoding, the metadata value 'remaining' to indicate
the number entries not included in the result set.";
}
}
// Protocol-accessible nodes
/* XXX system-capabilities brings in NACM that breaks clixon testing
augment // FIXME: ensure datastore == <operational>
"/sysc:system-capabilities/sysc:datastore-capabilities"
+ "/sysc:per-node-capabilities" {
description
"Defines some leafs that MAY be used by the server to
describe constraints imposed of the 'where' filters and
'sort-by' parameters used in list pagination queries.";
leaf constrained {
type empty;
description
"Indicates that 'where' filters and 'sort-by' parameters
on the targeted 'config false' list node are constrained.
If a list is not 'constrained', then full XPath 1.0
expressions may be used in 'where' filters and all node
identifiers are usable by 'sort-by'.";
}
leaf indexed {
type empty;
description
"Indicates that the targeted descendent node of a
'constrained' list (see the 'constrained' leaf) may be
used in 'where' filters and/or 'sort-by' parameters.
If a descendent node of a 'constrained' list is not
'indexed', then it MUST NOT be used in 'where' filters
or 'sort-by' parameters.";
}
}
*/
}

View file

@ -1,8 +1,30 @@
module ietf-netconf-list-pagination {
module ietf-netconf-nmda {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-list-pagination";
prefix ycoll;
namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-nmda";
prefix ncds;
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-inet-types {
prefix inet;
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-netconf {
prefix nc;
reference
@ -13,43 +35,32 @@ module ietf-netconf-list-pagination {
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";
"IETF NETCONF Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netconf/>
"WG Web: <https://datatracker.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>
Editor:
Author: Martin Bjorklund
<mailto:mbj@tail-f.com>
Editor:
Author: Juergen Schoenwaelder
<mailto:j.schoenwaelder@jacobs-university.de>
Editor: ";
Author: Phil Shafer
<mailto:phil@juniper.net>
Author: Kent Watsen
<mailto:kent+ietf@watsen.net>
Author: Robert Wilton
<mailto:rwilton@cisco.com>";
description
"This module define a new operation -- <get-collection>
to support YANG based pagination.
"This YANG module defines a set of NETCONF operations to support
the Network Management Datastore Architecture (NMDA).
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
@ -68,20 +79,14 @@ module ietf-netconf-list-pagination {
(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 {
the RFC itself for full legal notices.";
revision 2019-01-07 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Based Pagination.";
"RFC 8526: NETCONF Extensions to Support the Network Management
Datastore Architecture";
}
feature origin {
@ -100,28 +105,14 @@ module ietf-netconf-list-pagination {
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.";
Datastore Architecture, Section 3.1.1.2";
}
rpc get-pageable-list {
rpc get-data {
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.
"Retrieve data from an 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.
@ -142,11 +133,12 @@ module ietf-netconf-list-pagination {
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
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 {
@ -209,6 +201,7 @@ module ietf-netconf-list-pagination {
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
@ -257,98 +250,138 @@ module ietf-netconf-list-pagination {
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 {
anydata data {
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.";
"Copy of the source datastore subset that matched
the filter criteria (if any). An empty data
container indicates that the request did not
produce any results.";
}
}
}
rpc edit-data {
description
"Edit data in an NMDA datastore.
If an error condition occurs such that an error severity
<rpc-error> element is generated, the server will stop
processing the <edit-data> operation and restore the
specified configuration to its complete state at
the start of this <edit-data> operation.";
input {
leaf datastore {
type ds:datastore-ref;
mandatory true;
description
"Datastore that is the target of the <edit-data> operation.
If the target datastore is not writable, or is not
supported by the server, then the server MUST return an
<rpc-error> element with an <error-tag> value of
'invalid-value'.";
}
leaf default-operation {
type enumeration {
enum merge {
description
"The default operation is merge.";
}
enum replace {
description
"The default operation is replace.";
}
enum none {
description
"There is no default operation.";
}
}
default "merge";
description
"The default operation to use.";
}
choice edit-content {
mandatory true;
description
"The content for the edit operation.";
anydata config {
description
"Inline config content.";
}
leaf url {
if-feature "nc:url";
type inet:uri;
description
"URL-based config content.";
}
}
}
}
/*
* Augment the <lock> and <unlock> operations with a
* "datastore" parameter.
*/
augment "/nc:lock/nc:input/nc:target/nc:config-target" {
description
"Add NMDA datastore as target.";
leaf datastore {
type ds:datastore-ref;
description
"Datastore to lock.
The <lock> operation is only supported on writable
datastores.
If the <lock> operation is not supported by the server on
the specified target datastore, then the server MUST return
an <rpc-error> element with an <error-tag> value of
'invalid-value'.";
}
}
augment "/nc:unlock/nc:input/nc:target/nc:config-target" {
description
"Add NMDA datastore as target.";
leaf datastore {
type ds:datastore-ref;
description
"Datastore to unlock.
The <unlock> operation is only supported on writable
datastores.
If the <unlock> operation is not supported by the server on
the specified target datastore, then the server MUST return
an <rpc-error> element with an <error-tag> value of
'invalid-value'.";
}
}
/*
* Augment the <validate> operation with a
* "datastore" parameter.
*/
augment "/nc:validate/nc:input/nc:source/nc:config-source" {
description
"Add NMDA datastore as source.";
leaf datastore {
type ds:datastore-ref;
description
"Datastore to validate.
The <validate> operation is supported only on configuration
datastores.
If the <validate> operation is not supported by the server
on the specified target datastore, then the server MUST
return an <rpc-error> element with an <error-tag> value of
'invalid-value'.";
}
}
}

View file

@ -0,0 +1,138 @@
module ietf-netconf-with-defaults {
namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults";
prefix ncwd;
import ietf-netconf { prefix nc; }
organization
"IETF NETCONF (Network Configuration Protocol) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <netconf@ietf.org>
WG Chair: Bert Wijnen
<bertietf@bwijnen.net>
WG Chair: Mehmet Ersue
<mehmet.ersue@nsn.com>
Editor: Andy Bierman
<andy.bierman@brocade.com>
Editor: Balazs Lengyel
<balazs.lengyel@ericsson.com>";
description
"This module defines an extension to the NETCONF protocol
that allows the NETCONF client to control how default
values are handled by the server in particular NETCONF
operations.
Copyright (c) 2011 IETF Trust and the persons identified as
the document authors. 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 6243; see
the RFC itself for full legal notices.";
revision 2011-06-01 {
description
"Initial version.";
reference
"RFC 6243: With-defaults Capability for NETCONF";
}
typedef with-defaults-mode {
description
"Possible modes to report default data.";
reference
"RFC 6243; Section 3.";
type enumeration {
enum report-all {
description
"All default data is reported.";
reference
"RFC 6243; Section 3.1";
}
enum report-all-tagged {
description
"All default data is reported.
Any nodes considered to be default data
will contain a 'default' XML attribute,
set to 'true' or '1'.";
reference
"RFC 6243; Section 3.4";
}
enum trim {
description
"Values are not reported if they contain the default.";
reference
"RFC 6243; Section 3.2";
}
enum explicit {
description
"Report values that contain the definition of
explicitly set data.";
reference
"RFC 6243; Section 3.3";
}
}
}
grouping with-defaults-parameters {
description
"Contains the <with-defaults> parameter for control
of defaults in NETCONF retrieval operations.";
leaf with-defaults {
description
"The explicit defaults processing mode requested.";
reference
"RFC 6243; Section 4.5.1";
type with-defaults-mode;
}
}
// extending the get-config operation
augment /nc:get-config/nc:input {
description
"Adds the <with-defaults> parameter to the
input of the NETCONF <get-config> operation.";
reference
"RFC 6243; Section 4.5.1";
uses with-defaults-parameters;
}
// extending the get operation
augment /nc:get/nc:input {
description
"Adds the <with-defaults> parameter to
the input of the NETCONF <get> operation.";
reference
"RFC 6243; Section 4.5.1";
uses with-defaults-parameters;
}
// extending the copy-config operation
augment /nc:copy-config/nc:input {
description
"Adds the <with-defaults> parameter to
the input of the NETCONF <copy-config> operation.";
reference
"RFC 6243; Section 4.5.1";
uses with-defaults-parameters;
}
}

View file

@ -0,0 +1,147 @@
module ietf-origin {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-origin";
prefix or;
import ietf-yang-metadata {
prefix md;
}
organization
"IETF Network Modeling (NETMOD) Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/netmod/>
WG List: <mailto:netmod@ietf.org>
Author: Martin Bjorklund
<mailto:mbj@tail-f.com>
Author: Juergen Schoenwaelder
<mailto:j.schoenwaelder@jacobs-university.de>
Author: Phil Shafer
<mailto:phil@juniper.net>
Author: Kent Watsen
<mailto:kwatsen@juniper.net>
Author: Rob Wilton
<rwilton@cisco.com>";
description
"This YANG module defines an 'origin' metadata annotation and a
set of identities for the origin value.
Copyright (c) 2018 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 8342
(https://www.rfc-editor.org/info/rfc8342); see the RFC itself
for full legal notices.";
revision 2018-02-14 {
description
"Initial revision.";
reference
"RFC 8342: Network Management Datastore Architecture (NMDA)";
}
/*
* Identities
*/
identity origin {
description
"Abstract base identity for the origin annotation.";
}
identity intended {
base origin;
description
"Denotes configuration from the intended configuration
datastore.";
}
identity dynamic {
base origin;
description
"Denotes configuration from a dynamic configuration
datastore.";
}
identity system {
base origin;
description
"Denotes configuration originated by the system itself.
Examples of system configuration include applied configuration
for an always-existing loopback interface, or interface
configuration that is auto-created due to the hardware
currently present in the device.";
}
identity learned {
base origin;
description
"Denotes configuration learned from protocol interactions with
other devices, instead of via either the intended
configuration datastore or any dynamic configuration
datastore.
Examples of protocols that provide learned configuration
include link-layer negotiations, routing protocols, and
DHCP.";
}
identity default {
base origin;
description
"Denotes configuration that does not have a configured or
learned value but has a default value in use. Covers both
values defined in a 'default' statement and values defined
via an explanation in a 'description' statement.";
}
identity unknown {
base origin;
description
"Denotes configuration for which the system cannot identify the
origin.";
}
/*
* Type definitions
*/
typedef origin-ref {
type identityref {
base origin;
}
description
"An origin identity reference.";
}
/*
* Metadata annotations
*/
md:annotation origin {
type origin-ref;
description
"The 'origin' annotation can be present on any configuration
data node in the operational state datastore. It specifies
from where the node originated. If not specified for a given
configuration data node, then the origin is the same as the
origin of its parent node in the data tree. The origin for
any top-level configuration data nodes must be specified.";
}
}

View file

@ -1,54 +0,0 @@
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
"WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>";
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.";
}
}
}