[要約] RFC 8791は、YANGデータ構造の拡張に関する仕様であり、YANGモデルの柔軟性と拡張性を向上させることを目的としています。このRFCは、YANGデータモデルの拡張に関するガイドラインとして使用されることが期待されています。

Internet Engineering Task Force (IETF)                        A. Bierman
Request for Comments: 8791                                     YumaWorks
Updates: 8340                                               M. Bjorklund
Category: Standards Track                                          Cisco
ISSN: 2070-1721                                                K. Watsen
                                                         Watsen Networks
                                                               June 2020
        

YANG Data Structure Extensions

YANGデータ構造拡張

Abstract

概要

This document describes YANG mechanisms for defining abstract data structures with YANG.

このドキュメントでは、YANGを使用して抽象的なデータ構造を定義するためのYANGメカニズムについて説明します。

Status of This Memo

本文書の状態

This is an Internet Standards Track document.

これはInternet Standards Trackドキュメントです。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

このドキュメントは、IETF(Internet Engineering Task Force)の製品です。これは、IETFコミュニティのコンセンサスを表しています。公開レビューを受け、インターネットエンジニアリングステアリンググループ(IESG)による公開が承認されました。インターネット標準の詳細については、RFC 7841のセクション2をご覧ください。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8791.

このドキュメントの現在のステータス、正誤表、およびフィードバックの提供方法に関する情報は、https://www.rfc-editor.org/info/rfc8791で入手できます。

Copyright Notice

著作権表示

Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.

著作権(c)2020 IETFトラストおよびドキュメントの作成者として識別された人物。全著作権所有。

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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

この文書は、BCP 78およびIETF文書に関するIETFトラストの法的規定(https://trustee.ietf.org/license-info)の対象であり、この文書の発行日に有効です。これらのドキュメントは、このドキュメントに関するあなたの権利と制限を説明しているため、注意深く確認してください。このドキュメントから抽出されたコードコンポーネントには、Trust Legal Provisionsのセクション4.eに記載されているSimplified BSD Licenseのテキストが含まれている必要があり、Simplified BSD Licenseに記載されているように保証なしで提供されます。

Table of Contents

目次

   1.  Introduction
     1.1.  Terminology
       1.1.1.  NMDA
       1.1.2.  YANG
   2.  Definitions
   3.  YANG Data Structures in YANG Tree Diagrams
   4.  YANG Data Structure Extensions Module
   5.  IANA Considerations
     5.1.  YANG Module Registry
   6.  Security Considerations
   7.  References
     7.1.  Normative References
     7.2.  Informative References
   Appendix A.  Examples
     A.1.  "structure" Example
     A.2.  "augment-structure" Example
     A.3.  XML Encoding Example
     A.4.  JSON Encoding Example
     A.5.  "structure" Example That Defines a Non-top-level Structure
   Authors' Addresses
        
1. Introduction
1. はじめに

There is a need for standard mechanisms to allow the definition of abstract data that is not intended to be implemented as configuration or operational state. The "yang-data" extension statement from RFC 8040 [RFC8040] was defined for this purpose, but it is limited in its functionality.

構成または運用状態として実装することを意図していない抽象的なデータの定義を可能にする標準的なメカニズムが必要です。 RFC 8040 [RFC8040]の「yang-data」拡張ステートメントがこの目的で定義されましたが、その機能は制限されています。

The intended use of the "yang-data" extension was to model all or part of a protocol message, such as the "errors" definition in the YANG module "ietf-restconf" [RFC8040], or the contents of a file. However, protocols are often layered such that the header or payload portions of the message can be extended by external documents. The YANG statements that model a protocol need to support this extensibility that is already found in that protocol.

「yang-data」拡張の使用目的は、YANGモジュール「ietf-restconf」[RFC8040]の「エラー」定義やファイルのコンテンツなど、プロトコルメッセージのすべてまたは一部をモデル化することでした。ただし、プロトコルは多くの場合、メッセージのヘッダーまたはペイロード部分を外部ドキュメントで拡張できるように階層化されています。プロトコルをモデル化するYANGステートメントは、そのプロトコルですでに見られるこの拡張性をサポートする必要があります。

This document defines a new YANG extension statement called "structure", which is similar to but more flexible than the "yang-data" extension from [RFC8040]. There is no assumption that a YANG data structure can only be used as a top-level abstraction, and it may also be nested within some other data structure.

このドキュメントは、「構造」と呼ばれる新しいYANG拡張ステートメントを定義します。これは、[RFC8040]の「yang-data」拡張に似ていますが、より柔軟です。 YANGデータ構造はトップレベルの抽象化としてのみ使用できるという前提はなく、他のデータ構造内にネストすることもできます。

This document also defines a new YANG extension statement called "augment-structure", which allows abstract data structures to be augmented from external modules and is similar to the existing YANG "augment" statement. Note that "augment" cannot be used to augment a YANG data structure since a YANG compiler or other tool is not required to understand the "structure" extension.

このドキュメントでは、「augment-structure」と呼ばれる新しいYANG拡張ステートメントも定義しています。これにより、外部モジュールから抽象的なデータ構造を拡張でき、既存のYANG「augment」ステートメントに似ています。 「構造」拡張を理解するためにYANGコンパイラーまたは他のツールは必要ないため、「augment」を使用してYANGデータ構造を拡張することはできません。

1.1. Terminology
1.1. 用語

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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

キーワード「MUST」、「MUST NOT」、「REQUIRED」、「SHALL」、「SHALL NOT」、「SHOULD」、「SHOULD NOT」、「RECOMMENDED」、「NOT RECOMMENDED」、「MAY」、「OPTIONALこのドキュメントの「」は、BCP 14 [RFC2119] [RFC8174]で説明されているように解釈されます。

The following term is used within this document:

このドキュメントでは、次の用語が使用されています。

YANG data structure: A data structure defined with the "structure" statement.

YANGデータ構造:「structure」ステートメントで定義されたデータ構造。

1.1.1. NMDA
1.1.1. NMDA

The following terms are defined in the Network Management Datastore Architecture (NMDA) [RFC8342] and are not redefined here:

以下の用語は、ネットワーク管理データストアアーキテクチャ(NMDA)[RFC8342]で定義されており、ここでは再定義されません。

* configuration

* 構成

* operational state

* 稼働状態

1.1.2. YANG
1.1.2. それ

The following terms are defined in [RFC7950] and are not redefined here:

以下の用語は[RFC7950]で定義されており、ここでは再定義されません。

* absolute-schema-nodeid

* 絶対スキーマノードID

* container

* コンテナ

* data definition statement

* データ定義ステートメント

* data node

* データノード

* leaf

* 葉

* leaf-list

* リーフリスト

* list

* リスト

2. Definitions
2. 定義

A YANG data structure is defined with the "structure" extension statement, which is defined in the YANG module "ietf-yang-structure-ext". The argument to the "structure" extension statement is the name of the data structure. The data structures are considered to be in the same identifier namespace as defined in Section 6.2.1 of [RFC7950]. In particular, the seventh bullet states:

YANGデータ構造は、YANGモジュール「ietf-yang-structure-ext」で定義されている「構造」拡張ステートメントで定義されています。 「構造」拡張ステートメントの引数は、データ構造の名前です。データ構造は、[RFC7950]のセクション6.2.1で定義されているものと同じ識別子名前空間にあると見なされます。特に、7番目の箇条書きは次のように述べています。

   |  All leafs, leaf-lists, lists, containers, choices, rpcs, actions,
   |  notifications, anydatas, and anyxmls defined (directly or through
   |  a "uses" statement) within a parent node or at the top level of
   |  the module or its submodules share the same identifier namespace.
        

This means that data structures defined with the "structure" statement cannot have the same name as sibling nodes from regular YANG data definition statements or other "structure" statements in the same YANG module.

つまり、 "structure"ステートメントで定義されたデータ構造は、同じYANGモジュール内の通常のYANGデータ定義ステートメントまたは他の "structure"ステートメントの兄弟ノードと同じ名前を持つことはできません。

This does not mean a YANG data structure, once defined, has to be used as a top-level protocol message or other top-level data structure.

これは、いったん定義されたYANGデータ構造がトップレベルのプロトコルメッセージまたは他のトップレベルのデータ構造として使用される必要があることを意味しません。

A YANG data structure is encoded in the same way as an "anydata" node. This means that the name of the structure is encoded as a "container", with the instantiated children encoded as child nodes to this node. For example, this structure:

YANGデータ構造は、「anydata」ノードと同じ方法でエンコードされます。つまり、構造の名前は「コンテナ」としてエンコードされ、インスタンス化された子はこのノードの子ノードとしてエンコードされます。たとえば、この構造:

module example-errors { ...

module example-errors {...

       sx:structure my-error {
         leaf error-number {
           type int;
         }
       }
     }
        

can be encoded in JSON as:

次のようにJSONでエンコードできます。

     "example-errors:my-error": {
       "error-number": 131
     }
        
3. YANG Data Structures in YANG Tree Diagrams
3. YANGツリー図のYANGデータ構造

A YANG data structure can be printed in a YANG tree diagram [RFC8340]. This document updates RFC 8340 [RFC8340] by defining two new sections in the tree diagram for a module:

YANGデータ構造は、YANGツリー図[RFC8340]に印刷できます。このドキュメントは、モジュールのツリー図に2つの新しいセクションを定義することにより、RFC 8340 [RFC8340]を更新します。

1. YANG data structures, which are offset by two spaces and identified by the keyword "structure" followed by the name of the YANG data structure and a colon (":") character.

1. YANGデータ構造。2つのスペースでオフセットされ、キーワード "structure"の後にYANGデータ構造の名前とコロン( ":")文字が続きます。

2. YANG data structure augmentations, which are offset by 2 spaces and identified by the keyword "augment-structure" followed by the augment target structure name and a colon (":") character.

2. 2つのスペースでオフセットされ、キーワード「augment-structure」で識別され、その後に拡張ターゲット構造名とコロン( ":")文字が続く、YANGデータ構造の拡張。

The new sections, including spaces conventions, appear as follows:

スペースの規則を含む新しいセクションは、次のように表示されます。

     structure <structure-name>:
       +--<node>
          +--<node>
          |  +--<node>
          +--<node>
     structure <structure-name>:
       +--<node>
        
     augment-structure <structure-name>:
       +--<node>
          +--<node>
          |  +--<node>
          +--<node>
     augment-structure <structure-name>:
       +--<node>
        

Nodes in YANG data structures are printed according to the rules defined in Section 2.6 of [RFC8340]. The nodes in YANG data structures do not have any <flags>.

YANGデータ構造のノードは、[RFC8340]のセクション2.6で定義された規則に従って印刷されます。 YANGデータ構造のノードには、<フラグ>がありません。

4. YANG Data Structure Extensions Module
4. YANGデータ構造拡張モジュール
   <CODE BEGINS> file "ietf-yang-structure-ext@2020-06-17.yang"
   module ietf-yang-structure-ext {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext";
     prefix sx;
        
     organization
       "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
     contact
       "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
        WG List:  <mailto:netmod@ietf.org>
        
        Author:   Andy Bierman
                  <mailto:andy@yumaworks.com>
        
        Author:   Martin Bjorklund
                  <mailto:mbj+ietf@4668.se>
        

Author: Kent Watsen <mailto:kent+ietf@watsen.net>"; description "This module contains conceptual YANG specifications for defining abstract data structures.

作者:Kent Watsen <mailto:kent+ietf@watsen.net> ";説明"このモジュールには、抽象データ構造を定義するための概念的なYANG仕様が含まれています。

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.

キーワード「MUST」、「MUST NOT」、「REQUIRED」、「SHALL」、「SHALL NOT」、「SHOULD」、「SHOULD NOT」、「RECOMMENDED」、「NOT RECOMMENDED」、「MAY」、「OPTIONALこのドキュメントの 'は、ここに示すように、BCP 14(RFC 2119)(RFC 8174)で説明されているように解釈されます。

Copyright (c) 2020 IETF Trust and the persons identified as authors of the code. All rights reserved.

Copyright(c)2020 IETF Trustおよびコードの作成者として識別された人物。全著作権所有。

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).

ソースおよびバイナリ形式での再配布および使用は、変更の有無にかかわらず、IETFドキュメントに関連するIETFトラストの法的規定のセクション4.cに記載されているSimplified BSD Licenseに準拠し、それに含まれるライセンス条項に従って許可されます( http://trustee.ietf.org/license-info)。

        This version of this YANG module is part of RFC 8791
        (https://www.rfc-editor.org/info/rfc8791); see the RFC itself
        for full legal notices.";
        
     revision 2020-06-17 {
       description
         "Initial revision.";
       reference
         "RFC 8791: YANG Data Structure Extensions.";
     }
        
     extension structure {
       argument name {
         yin-element true;
       }
       description
         "This extension is used to specify a YANG data structure that
          represents conceptual data defined in YANG.  It is intended to
          describe hierarchical data independent of protocol context or
          specific message encoding format.  Data definition statements
          within a 'structure' extension statement specify the generic
          syntax for the specific YANG data structure, whose name is the
          argument of the 'structure' extension statement.
        

Note that this extension does not define a media type. A specification using this extension MUST specify the message encoding rules, including the content media type, if applicable.

この拡張機能はメディアタイプを定義しないことに注意してください。この拡張を使用する仕様は、該当する場合、コンテンツメディアタイプを含むメッセージエンコーディングルールを指定する必要があります。

The mandatory 'name' parameter value identifies the YANG data structure that is being defined.

必須の「name」パラメーター値は、定義されているYANGデータ構造を識別します。

This extension is only valid as a top-level statement, i.e., given as a substatement to 'module' or 'submodule'.

この拡張機能はトップレベルのステートメントとしてのみ有効です。つまり、「モジュール」または「サブモジュール」のサブステートメントとして指定されます。

The substatements of this extension MUST follow the ABNF rules below, where the rules are defined in RFC 7950:

この拡張機能のサブステートメントは、RFC 7950で定義されている以下のABNFルールに従う必要があります。

            *must-stmt
            [status-stmt]
            [description-stmt]
            [reference-stmt]
            *(typedef-stmt / grouping-stmt)
            *data-def-stmt
        

A YANG data structure defined with this extension statement is encoded in the same way as an 'anydata' node. This means that the name of the structure is encoded as a 'container', with the instantiated child statements encoded as child nodes to this node.

この拡張ステートメントで定義されたYANGデータ構造は、「anydata」ノードと同じ方法でエンコードされます。これは、構造の名前が「コンテナ」としてエンコードされ、インスタンス化された子ステートメントがこのノードの子ノードとしてエンコードされることを意味します。

The module name and namespace value for the YANG module using the extension statement are assigned to each of the data definition statements resulting from the YANG data structure.

拡張ステートメントを使用するYANGモジュールのモジュール名と名前空間の値は、YANGデータ構造から得られる各データ定義ステートメントに割り当てられます。

The XPath document element is the extension statement itself, such that the child nodes of the document element are represented by the data-def-stmt substatements within this extension. This conceptual document is the context for the following YANG statements:

XPathドキュメント要素は拡張ステートメント自体であり、ドキュメント要素の子ノードは、この拡張内のdata-def-stmtサブステートメントによって表されます。この概念ドキュメントは、次のYANGステートメントのコンテキストです。

- must-stmt - when-stmt - path-stmt - min-elements-stmt - max-elements-stmt - mandatory-stmt - unique-stmt - ordered-by - instance-identifier data type

- must-stmt-when-stmt-path-stmt-min-elements-stmt-max-elements-stmt-Required-stmt-unique-stmt-ordered-by-instance-identifierデータ型

The following data-def-stmt substatements are constrained when used within a 'structure' extension statement.

次のdata-def-stmtサブステートメントは、「構造」拡張ステートメント内で使用すると制約されます。

            - The list-stmt is not required to have a key-stmt defined.
            - The config-stmt is ignored if present.
         ";
     }
        
     extension augment-structure {
       argument path {
         yin-element true;
       }
       description
         "This extension is used to specify an augmentation to a YANG
          data structure defined with the 'structure' statement.  It is
          intended to describe hierarchical data independent of protocol
          context or specific message encoding format.
        

This statement has almost the same structure as the 'augment-stmt'. Data definition statements within this statement specify the semantics and generic syntax for the additional data to be added to the specific YANG data structure, identified by the 'path' argument.

このステートメントは、「augment-stmt」とほぼ同じ構造です。このステートメント内のデータ定義ステートメントは、「パス」引数で識別される特定のYANGデータ構造に追加される追加データのセマンティクスと汎用構文を指定します。

The mandatory 'path' parameter value identifies the YANG conceptual data node that is being augmented and is represented as an absolute-schema-nodeid string, where the first node in the absolute-schema-nodeid string identifies the YANG data structure to augment, and the rest of the nodes in the string identifies the node within the YANG structure to augment.

必須の「パス」パラメーター値は、拡張されるYANG概念データノードを識別し、absolute-schema-nodeid文字列として表されます。absolute-schema-nodeid文字列の最初のノードは、拡張するYANGデータ構造を識別します。文字列の残りのノードは、拡張するYANG構造内のノードを識別します。

This extension is only valid as a top-level statement, i.e., given as a substatement to 'module' or 'submodule'.

この拡張機能はトップレベルのステートメントとしてのみ有効です。つまり、「モジュール」または「サブモジュール」のサブステートメントとして指定されます。

The substatements of this extension MUST follow the ABNF rules below, where the rules are defined in RFC 7950:

この拡張機能のサブステートメントは、RFC 7950で定義されている以下のABNFルールに従う必要があります。

            [status-stmt]
            [description-stmt]
            [reference-stmt]
            1*(data-def-stmt / case-stmt)
        

The module name and namespace value for the YANG module using the extension statement are assigned to instance document data conforming to the data definition statements within this extension.

拡張ステートメントを使用するYANGモジュールのモジュール名と名前空間値は、この拡張内のデータ定義ステートメントに準拠するインスタンスドキュメントデータに割り当てられます。

The XPath document element is the augmented extension statement itself, such that the child nodes of the document element are represented by the data-def-stmt substatements within the augmented 'structure' statement.

XPathドキュメント要素は、拡張された拡張ステートメント自体であり、ドキュメント要素の子ノードは、拡張された「構造」ステートメント内のdata-def-stmtサブステートメントによって表されます。

The context node of the 'augment-structure' statement is derived in the same way as the 'augment' statement, as defined in Section 6.4.1 of [RFC7950]. This conceptual node is considered the context node for the following YANG statements:

[augment-structure]ステートメントのコンテキストノードは、[RFC7950]のセクション6.4.1で定義されているように、「augment」ステートメントと同じ方法で導出されます。この概念ノードは、次のYANGステートメントのコンテキストノードと見なされます。

- must-stmt - when-stmt - path-stmt - min-elements-stmt - max-elements-stmt - mandatory-stmt - unique-stmt - ordered-by - instance-identifier data type

- must-stmt-when-stmt-path-stmt-min-elements-stmt-max-elements-stmt-Required-stmt-unique-stmt-ordered-by-instance-identifierデータ型

The following data-def-stmt substatements are constrained when used within an 'augment-structure' extension statement.

次のdata-def-stmtサブステートメントは、「augment-structure」拡張ステートメント内で使用すると制約されます。

- The list-stmt is not required to have a key-stmt defined. - The config-stmt is ignored if present.

- list-stmtにkey-stmtを定義する必要はありません。 -config-stmtが存在しても無視されます。

Example:

例:

             module foo {
                import ietf-yang-structure-ext { prefix sx; }
        
                sx:structure foo-data {
                  container foo-con { }
                }
             }
        
             module bar {
                import ietf-yang-structure-ext { prefix sx; }
                import foo { prefix foo; }
        
                sx:augment-structure /foo:foo-data/foo:foo-con {
                  leaf add-leaf1 { type int32; }
                  leaf add-leaf2 { type string; }
                }
             }
         ";
     }
   }
   <CODE ENDS>
        
5. IANA Considerations
5. IANAに関する考慮事項
5.1. YANG Module Registry
5.1. そのレジストリモジュール

IANA has registered the following URI in the "ns" subregistry within the "IETF XML Registry" [RFC3688]:

IANAは、「IETF XMLレジストリ」[RFC3688]内の「ns」サブレジストリに次のURIを登録しました。

URI: urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext Registrant Contact: The IESG. XML: N/A; the requested URI is an XML namespace.

URI:urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext登録者の連絡先:IESG。 XML:なし。要求されたURIはXML名前空間です。

IANA has registered the following YANG module in the "YANG Module Names" subregistry [RFC6020] within the "YANG Parameters" registry:

IANAは、「YANGパラメータ」レジストリ内の「YANGモジュール名」サブレジストリ[RFC6020]に次のYANGモジュールを登録しました。

   Name:  ietf-yang-structure-ext
   Namespace:  urn:ietf:params:xml:ns:yang:ietf-yang-structure-ext
   Prefix:  sx
   Reference:  RFC 8791
        
6. Security Considerations
6. セキュリティに関する考慮事項

This document defines YANG extensions that are used to define conceptual YANG data structures. It does not introduce any new vulnerabilities beyond those specified in YANG 1.1 [RFC7950].

このドキュメントでは、概念的なYANGデータ構造を定義するために使用されるYANG拡張機能を定義しています。 YANG 1.1 [RFC7950]で指定された脆弱性を超える新しい脆弱性は導入されていません。

7. References
7. 参考文献
7.1. Normative References
7.1. 引用文献

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.

[RFC2119] Bradner、S。、「要件レベルを示すためにRFCで使用するキーワード」、BCP 14、RFC 2119、DOI 10.17487 / RFC2119、1997年3月、<https://www.rfc-editor.org/info/ rfc2119>。

[RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, August 2016, <https://www.rfc-editor.org/info/rfc7950>.

[RFC7950] Bjorklund、M。、編、「The YANG 1.1 Data Modeling Language」、RFC 7950、DOI 10.17487 / RFC7950、2016年8月、<https://www.rfc-editor.org/info/rfc7950>。

[RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, <https://www.rfc-editor.org/info/rfc8040>.

[RFC8040] Bierman、A.、Bjorklund、M。、およびK. Watsen、「RESTCONFプロトコル」、RFC 8040、DOI 10.17487 / RFC8040、2017年1月、<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, May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC8174] Leiba、B。、「RFC 2119キーワードの大文字と小文字のあいまいさ」、BCP 14、RFC 8174、DOI 10.17487 / RFC8174、2017年5月、<https://www.rfc-editor.org/info/ rfc8174>。

[RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, <https://www.rfc-editor.org/info/rfc8340>.

[RFC8340] Bjorklund、M。およびL. Berger、編、「YANG Tree Diagrams」、BCP 215、RFC 8340、DOI 10.17487 / RFC8340、2018年3月、<https://www.rfc-editor.org/info/ rfc8340>。

[RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., and R. Wilton, "Network Management Datastore Architecture (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, <https://www.rfc-editor.org/info/rfc8342>.

[RFC8342] Bjorklund、M.、Schoenwaelder、J.、Shafer、P.、Watsen、K。、およびR. Wilton、「Network Management Datastore Architecture(NMDA)」、RFC 8342、DOI 10.17487 / RFC8342、2018年3月、< https://www.rfc-editor.org/info/rfc8342>。

[W3C.REC-xml-20081126] Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", World Wide Web Consortium Recommendation REC-xml-20081126, November 2008, <http://www.w3.org/TR/2008/REC-xml-20081126>.

[W3C.REC-xml-20081126]ブレイ、T。、パオリ、J.、Sperberg-McQueen、M。、マラー、E。、およびF.イェルガウ、「Extensible Markup Language(XML)1.0(Fifth Edition)」、 World Wide Web Consortium Recommendation REC-xml-20081126、2008年11月、<http://www.w3.org/TR/2008/REC-xml-20081126>。

7.2. Informative References
7.2. 参考引用

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004, <https://www.rfc-editor.org/info/rfc3688>.

[RFC3688] Mealling、M。、「The IETF XML Registry」、BCP 81、RFC 3688、DOI 10.17487 / RFC3688、2004年1月、<https://www.rfc-editor.org/info/rfc3688>。

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

[RFC6020] Bjorklund、M。、編、「YANG-ネットワーク構成プロトコル(NETCONF)のデータモデリング言語」、RFC 6020、DOI 10.17487 / RFC6020、2010年10月、<https://www.rfc-editor。 org / info / rfc6020>。

Appendix A. Examples
付録A.例
A.1. "structure" Example
A.1. 「構造」の例

This example shows a simple address book that could be stored as an artifact:

この例は、アーティファクトとして保存できる簡単なアドレス帳を示しています。

   module example-module {
     yang-version 1.1;
     namespace "urn:example:example-module";
     prefix exm;
        
     import ietf-yang-structure-ext {
       prefix sx;
     }
        
     sx:structure address-book {
       list address {
         key "last first";
         leaf last {
           type string;
           description "Last name";
         }
         leaf first {
           type string;
           description "First name";
         }
         leaf street {
           type string;
           description "Street name";
         }
         leaf city {
           type string;
           description "City name";
         }
         leaf state {
           type string;
           description "State name";
         }
       }
     }
   }
        

Below is the tree diagram of this module:

以下はこのモジュールのツリー図です:

module: example-module

モジュール:example-module

     structure address-book:
       +-- address* [last first]
          +-- last      string
          +-- first     string
          +-- street?   string
          +-- city?     string
          +-- state?    string
        
A.2. "augment-structure" Example
A.2. 「augment-structure」の例

This example adds "county" and "zipcode" leafs to the address book:

この例では、「county」および「zipcode」リーフをアドレス帳に追加します。

   module example-module-aug {
     yang-version 1.1;
     namespace "urn:example:example-module-aug";
     prefix exma;
        
     import ietf-yang-structure-ext {
       prefix sx;
     }
     import example-module {
       prefix exm;
     }
        
     sx:augment-structure "/exm:address-book/exm:address" {
       leaf county {
         type string;
         description "County name";
       }
       leaf zipcode {
         type string;
         description "Postal zipcode";
       }
     }
   }
        

Below is the tree diagram of this module:

以下はこのモジュールのツリー図です:

module: example-module-aug

モジュール:example-module-aug

     augment-structure /exm:address-book/exm:address:
       +-- county?    string
       +-- zipcode?   string
        
A.3. XML Encoding Example
A.3. XMLエンコーディングの例

This example shows how an address book can be encoded in XML [W3C.REC-xml-20081126]:

この例は、アドレス帳をXML [W3C.REC-xml-20081126]でエンコードする方法を示しています。

   <address-book xmlns="urn:example:example-module">
     <address>
       <last>Flintstone</last>
       <first>Fred</first>
       <street>301 Cobblestone Way</street>
       <city>Bedrock</city>
       <zipcode xmlns="urn:example:example-module-aug">70777</zipcode>
     </address>
     <address>
       <last>Root</last>
       <first>Charlie</first>
       <street>4711 Cobblestone Way</street>
       <city>Bedrock</city>
       <zipcode xmlns="urn:example:example-module-aug">70777</zipcode>
     </address>
   </address-book>
        
A.4. JSON Encoding Example
A.4. JSONエンコードの例

This example shows how an address book can be encoded in JSON:

この例は、アドレス帳をJSONでエンコードする方法を示しています。

   "example-module:address-book": {
     "address": [
       {
         "city": "Bedrock",
         "example-module-aug:zipcode": "70777",
         "first": "Fred",
         "last": "Flintstone",
         "street": "301 Cobblestone Way"
       },
       {
         "city": "Bedrock",
         "example-module-aug:zipcode": "70777",
         "first": "Charlie",
         "last": "Root",
         "street": "4711 Cobblestone Way"
       }
     ]
   }
        
A.5. "structure" Example That Defines a Non-top-level Structure
A.5. トップレベル以外の構造を定義する「構造」の例

The following example defines a data structure with error information that can be included in an <error-info> element in an <rpc-error>:

次の例では、<rpc-error>の<error-info>要素に含めることができるエラー情報を含むデータ構造を定義しています。

   module example-error-info {
     yang-version 1.1;
     namespace "urn:example:example-error-info";
     prefix exei;
        
     import ietf-yang-structure-ext {
       prefix sx;
     }
        
     sx:structure my-example-error-info {
       leaf error-code {
         type uint32;
       }
     }
        

}

The example below shows how this structure can be used in an <rpc-error>:

以下の例は、この構造を<rpc-error>で使用する方法を示しています。

   <rpc-reply message-id="101"
        xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <rpc-error>
       <error-type>protocol</error-type>
       <error-tag>operation-failed</error-tag>
       <error-severity>error</error-severity>
       <error-info>
         <my-example-error-info
             xmlns="urn:example:example-error-info">
           <error-code>42</error-code>
         </my-example-error-info>
       </error-info>
     </rpc-error>
   </rpc-reply>
        

Authors' Addresses

著者のアドレス

Andy Bierman YumaWorks

アンディ・ビアマンYumaWorks

   Email: andy@yumaworks.com
        

Martin Bjorklund Cisco

マーティンビョークランドシスコ

   Email: mbj+ietf@4668.se
        

Kent Watsen Watsen Networks

Kent Watsen Watsen Networks

   Email: kent+ietf@watsen.net