module ietf-nmda-compare {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-nmda-compare";
prefix cmp;
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-yang-patch {
prefix ypatch;
reference "RFC 8072: YANG Patch Media Type";
}
import ietf-netconf {
prefix nc;
reference "RFC6241: Network Configuration Protocol (NETCONF)";
}
organization "IETF";
contact
"WG Web:
WG List:
Author: Alexander Clemm
Author: Yingzhen Qu
Author: Jeff Tantsura
Author: Andy Bierman
";
description
"The YANG data model defines a new operation, , that
can be used to compare NMDA datastores.
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) 2020 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; see the
RFC itself for full legal notices.";
revision 2020-09-18 {
description
"Initial revision";
reference
"RFC XXXX: Comparison of NMDA datastores";
}
/* RPC */
rpc compare {
description
"NMDA compare operation.";
input {
leaf source {
type identityref {
base ds:datastore;
}
mandatory true;
description
"The source datastore to be compared.";
}
leaf target {
type identityref {
base ds:datastore;
}
mandatory true;
description
"The target datastore to be compared.";
}
leaf all {
type empty;
description
"When this leaf is provided, all data nodes are compared,
whether their schema node pertains to both datastores or
not. When this leaf is omitted, a prefiltering step is
automatically applied that excludes data nodes from the
comparison that can occur in only one datastore but not
the other. Specifically, if one of the datastores
(source or target) contains only configuration data and
the other datastore is , data nodes for
which config is false are excluded from the comparison.";
}
leaf exclude-origin {
type empty;
description
"When this leaf is provided, origin metadata is not
included as part of RPC output. When this leaf is
omitted, origin metadata in comparisons that involve
is by default included.";
}
choice filter-spec {
description
"Identifies the portions of the datastores to be
compared.";
anydata subtree-filter {
description
"This parameter identifies the portions of the
target datastore to retrieve.";
reference "RFC 6241, 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.";
reference "RFC 6021: Common YANG Data Types";
}
}
}
output {
choice compare-response {
description
"Comparison results.";
leaf no-matches {
type empty;
description
"This leaf indicates that the filter did not match
anything and nothing was compared.";
}
container differences {
description
"The list of differences, encoded per RFC8072 with an
augmentation to include source values where applicable.
When a datastore node in the source is not present in
the target, this can be indicated either as a 'delete'
or as a 'remove' as there is no difference between
them for the purposes of the comparison.";
uses ypatch:yang-patch {
augment "yang-patch/edit" {
description
"Provide the value of the source of the patch,
respectively of the comparison, in addition to
the target value, where applicable.";
anydata source-value {
when "../operation = 'delete'"
+ "or ../operation = 'merge'"
+ "or ../operation = 'move'"
+ "or ../operation = 'replace'"
+ "or ../operation = 'remove'";
description
"The anydata 'value' is only used for 'delete',
'move', 'merge', 'replace', and 'remove'
operations.";
}
reference "RFC 8072: YANG Patch Media Type";
}
}
}
}
}
}
}