Internet-Draft | NETCONF default attribute YANG | April 2024 |
Andersson | Expires 4 October 2024 | [Page] |
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.¶
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.¶
Copyright (c) 2024 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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
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".¶
The "ietf-defaults" module defines the "default" attribute.¶
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>¶
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¶
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¶
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.¶
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.¶