Internet-Draft NETCONF default attribute YANG April 2024
Andersson Expires 4 October 2024 [Page]
Workgroup:
NETCONF Working Group
Internet-Draft:
draft-andersson-netconf-defaults-yang-00
Updates:
6243 (if approved)
Published:
Intended Status:
Standards Track
Expires:
Author:
P. Andersson
Cisco Systems

YANG Model for the NETCONF default attribute

Abstract

This document defines a YANG module with the "default" attribute using the namespace and prefix defined in [RFC6243]. This enables usage of the "default" attribute in e.g. YANG JSON encoding.

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 4 October 2024.

Table of Contents

1. Introduction

YANG metadata [RFC7952] defines that attributes should be namespace-qualified, which for YANG JSON [RFC7951] means module-name:attribute. This becomes a problem since the "default" attribute defined in [RFC6243] doesn't define it in a YANG module, but instead defines the "default" attribute in XML Schema. The result is that it is impossible to emit the "default" attribute using YANG JSON encoding, since there is no corresponding YANG module name to use. For NETCONF this is not a problem since the prefix "wd" is defined with the corresponding namespace "urn:ietf:params:xml:ns:netconf:default:1.0".

2. The "ietf-defaults" Module

The "ietf-defaults" module defines the "default" attribute.

2.1. YANG Module

This YANG module has normative references to [RFC6243], [RFC7951], and [RFC7952].

<CODE BEGINS> file "ietf-defaults@2024-04-03.yang"

module ietf-defaults {
  yang-version 1.1;
  namespace
    "urn:ietf:params:xml:ns:netconf:default:1.0";
  prefix wd;

  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:   https://datatracker.ietf.org/wg/netconf
     WG List:  NETCONF WG list <mailto:netconf@ietf.org>

     Authors:  Per Andersson <per.ietf@ionio.se>";

  description
    "This module defines the 'default' attribute in YANG
     previously only defined in XML Schema in RFC 6243 Section 6.

     Copyright (c) 2024 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 Revised
     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 2024-04-03 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: YANG Model for the NETCONF default attribute";
  }

  md:annotation default {
    type boolean;
    description
      "This annotation is only relevant if the server supports the
       'report-all-tagged' defaults retrieval mode. For details see
       RFC 6243.";
    reference
      "RFC 6243: With-defaults Capability for NETCONF";
  }
}

<CODE ENDS>

3. IANA Considerations

3.1. The "IETF XML" Registry

This document registers one URI in the "ns" subregistry of the IETF XML Registry [RFC3688] maintained at https://www.iana.org/assignments/xml-registry/xml-registry.xhtml#ns. Following the format in [RFC3688], the following registration is requested:

URI: urn:ietf:params:xml:ns:netconf:default:1.0
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.
Reference: RFC 6243, RFC XXXX

3.2. The "YANG Module Names" Registry

This document registers one YANG module in the YANG Module Names registry [RFC6020] maintained at https://www.iana.org/assignments/yang-parameters/yang-parameters.xhtml. Following the format defined in [RFC6020], the below registration is requested:

name: ietf-defaults
namespace: urn:ietf:params:xml:ns:netconf:default:1.0
prefix: wd
Reference: RFC XXXX

4. Security Considerations

4.1. Regarding the "ietf-defaults" YANG Module

This document defines an extension to existing NETCONF and RESTCONF protocol operations. It does not introdue any new or increased security risks into the management system.

5. References

5.1. Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
[RFC3688]
Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, , <https://www.rfc-editor.org/info/rfc3688>.
[RFC6241]
Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, , <https://www.rfc-editor.org/info/rfc6241>.
[RFC6242]
Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, , <https://www.rfc-editor.org/info/rfc6242>.
[RFC6243]
Bierman, A. and B. Lengyel, "With-defaults Capability for NETCONF", RFC 6243, DOI 10.17487/RFC6243, , <https://www.rfc-editor.org/info/rfc6243>.
[RFC7950]
Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, , <https://www.rfc-editor.org/info/rfc7950>.
[RFC7951]
Lhotka, L., "JSON Encoding of Data Modeled with YANG", RFC 7951, DOI 10.17487/RFC7951, , <https://www.rfc-editor.org/info/rfc7951>.
[RFC7952]
Lhotka, L., "Defining and Using Metadata with YANG", RFC 7952, DOI 10.17487/RFC7952, , <https://www.rfc-editor.org/info/rfc7952>.
[RFC8040]
Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10.17487/RFC8040, , <https://www.rfc-editor.org/info/rfc8040>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <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, , <https://www.rfc-editor.org/info/rfc8341>.
[RFC8446]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, , <https://www.rfc-editor.org/info/rfc8446>.

5.2. Informative References

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

Appendix A. YANG JSON Example

The following example shows the example from Section A.3.2. <with-defaults> = 'report-all-tagged' in [RFC6243] encoded as YANG JSON encoded data. The request is adapted for RESTCONF [RFC8040].

GET /restconf/data/example:interfaces?with-defaults=report-all-tagged
Accept: application/yang-data+json


HTTP/1.1 200 OK
Date: Wed, 03 Apr 2024 01:18:51 GMT
Server: example-server
Content-Type: application/yang-data+json

{
    "example:interfaces": [
        {
            "name": "eth0",
            "mtu": 8192,
            "status": "up",
            "@status": {
                 "ietf-defaults:default": true"
            }
        },
        {
            "name": "eth1",
            "mtu": 1500,
            "@mtu": {
                "ietf-defaults:default": true"
            }
            "status": "up",
            "@status": {
                "ietf-defaults:default": true"
            }
        },
        {
            "name": "eth2",
             "mtu": 9000,
             "status": "not feeling so good"
        },
        {
            "name": "eth3",
            "mtu": 1500,
            "@mtu": {
                "ietf-defaults:default": true"
            }
            "status": "waking up"
        }
    ]
}

YANG JSON encoded data with "default" attribute.

Author's Address

Per Andersson
Cisco Systems