Internet Engineering Task Force (IETF)                          M. Scott
Request for Comments: 6022                                      Ericsson
Category: Standards Track                                   M. Bjorklund
ISSN: 2070-1721                                           Tail-f Systems
                                                            October 2010
        
Internet Engineering Task Force (IETF)                          M. Scott
Request for Comments: 6022                                      Ericsson
Category: Standards Track                                   M. Bjorklund
ISSN: 2070-1721                                           Tail-f Systems
                                                            October 2010
        

YANG Module for NETCONF Monitoring

用于NETCONF监控的YANG模块

Abstract

摘要

This document defines a Network Configuration Protocol (NETCONF) data model to be used to monitor the NETCONF protocol. The monitoring data model includes information about NETCONF datastores, sessions, locks, and statistics. This data facilitates the management of a NETCONF server. This document also defines methods for NETCONF clients to discover data models supported by a NETCONF server and defines a new NETCONF <get-schema> operation to retrieve them.

本文档定义了一个网络配置协议(NETCONF)数据模型,用于监控NETCONF协议。监控数据模型包括有关NETCONF数据存储、会话、锁和统计信息。此数据有助于管理NETCONF服务器。本文档还定义了NETCONF客户端发现NETCONF服务器支持的数据模型的方法,并定义了一个新的NETCONF<get schema>操作来检索这些数据模型。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

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

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

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

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6022.

Copyright Notice

版权公告

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

版权所有(c)2010 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://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文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

本文件可能包含2008年11月10日之前发布或公开的IETF文件或IETF贡献中的材料。控制某些材料版权的人员可能未授予IETF信托允许在IETF标准流程之外修改此类材料的权利。在未从控制此类材料版权的人员处获得充分许可的情况下,不得在IETF标准流程之外修改本文件,也不得在IETF标准流程之外创建其衍生作品,除了将其格式化以RFC形式发布或将其翻译成英语以外的其他语言。

Table of Contents

目录

   1. Introduction ....................................................3
      1.1. Definition of Terms ........................................3
   2. Data Model to Monitor NETCONF ...................................3
      2.1. The /netconf-state Subtree .................................3
           2.1.1. The /netconf-state/capabilities Subtree .............4
           2.1.2. The /netconf-state/datastores Subtree ...............4
           2.1.3. The /netconf-state/schemas Subtree ..................5
           2.1.4. The /netconf-state/sessions Subtree .................6
           2.1.5. The /netconf-state/statistics Subtree ...............7
   3. Schema Specific Operations ......................................8
      3.1. The <get-schema> Operation .................................8
   4. Examples ........................................................9
      4.1. Retrieving Schema List via <get> Operation .................9
      4.2. Retrieving Schema Instances ...............................11
   5. NETCONF Monitoring Data Model ..................................13
   6. Security Considerations ........................................25
   7. Acknowledgements ...............................................26
   8. IANA Considerations ............................................26
   9. References .....................................................26
      9.1. Normative References ......................................26
      9.2. Informative References ....................................27
        
   1. Introduction ....................................................3
      1.1. Definition of Terms ........................................3
   2. Data Model to Monitor NETCONF ...................................3
      2.1. The /netconf-state Subtree .................................3
           2.1.1. The /netconf-state/capabilities Subtree .............4
           2.1.2. The /netconf-state/datastores Subtree ...............4
           2.1.3. The /netconf-state/schemas Subtree ..................5
           2.1.4. The /netconf-state/sessions Subtree .................6
           2.1.5. The /netconf-state/statistics Subtree ...............7
   3. Schema Specific Operations ......................................8
      3.1. The <get-schema> Operation .................................8
   4. Examples ........................................................9
      4.1. Retrieving Schema List via <get> Operation .................9
      4.2. Retrieving Schema Instances ...............................11
   5. NETCONF Monitoring Data Model ..................................13
   6. Security Considerations ........................................25
   7. Acknowledgements ...............................................26
   8. IANA Considerations ............................................26
   9. References .....................................................26
      9.1. Normative References ......................................26
      9.2. Informative References ....................................27
        
1. Introduction
1. 介绍

This document defines a YANG [RFC6020] model to be used to monitor the NETCONF protocol. It provides information about NETCONF sessions and supported schema as defined in [RFC4741].

本文档定义了用于监控NETCONF协议的YANG[RFC6020]模型。它提供了有关NETCONF会话和[RFC4741]中定义的受支持模式的信息。

Considerations such as different schema formats, feature optionality, and access controls can all impact the applicability and level of detail the NETCONF server sends to a client during session setup. The methods defined in this document address the need for further means to query and retrieve schema and NETCONF state information from a NETCONF server. These are provided to complement existing base NETCONF capabilities and operations and in no way affect existing behaviour.

考虑因素(如不同的模式格式、功能可选性和访问控制)都会影响NETCONF服务器在会话设置期间发送给客户端的适用性和详细程度。本文中定义的方法解决了从NETCONF服务器查询和检索模式和NETCONF状态信息的进一步方法的需要。提供这些功能是为了补充现有的基本NETCONF功能和操作,并且不会影响现有的行为。

A new <get-schema> operation is also defined to support explicit schema retrieval via NETCONF.

还定义了一个新的<get schema>操作,以支持通过NETCONF进行显式模式检索。

1.1. Definition of Terms
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].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”应按照BCP 14[RFC2119]中的说明进行解释。

2. Data Model to Monitor NETCONF
2. 监视NETCONF的数据模型

The NETCONF monitoring data model defined in this document provides operational information on the NETCONF server. This includes details specific to the NETCONF protocol (e.g., protocol-specific counters such as 'in-sessions') as well as data related to schema retrieval (e.g., schema list).

本文档中定义的NETCONF监控数据模型提供了NETCONF服务器上的操作信息。这包括特定于NETCONF协议的详细信息(例如,特定于协议的计数器,如“会话中”)以及与模式检索相关的数据(例如,模式列表)。

A server that implements the data model defined in this document ("urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring") MUST advertise the capability URI as described in [RFC6020].

实现本文档中定义的数据模型的服务器(“urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring”)必须按照[RFC6020]中所述公布功能URI。

This section presents an overview of the monitoring data model. For detailed descriptions, refer to the normative YANG module provided in this document (see Section 5).

本节概述了监控数据模型。有关详细说明,请参阅本文件中提供的标准模块(见第5节)。

2.1. The /netconf-state Subtree
2.1. /netconf状态子树

The netconf-state container is the root of the monitoring data model.

netconf状态容器是监控数据模型的根。

   netconf-state
       /capabilities
       /datastores
       /schemas
       /sessions
       /statistics
        
   netconf-state
       /capabilities
       /datastores
       /schemas
       /sessions
       /statistics
        

capabilities List of NETCONF capabilities supported by the server.

服务器支持的NETCONF功能列表。

datastores List of NETCONF configuration datastores (e.g., running, startup, candidate) supported on this device and related information.

数据存储此设备上支持的NETCONF配置数据存储列表(例如,运行、启动、候选)和相关信息。

schemas List of schemas supported on the server. Includes all the information required to identify the schemas and to support their retrieval.

架构服务器上支持的架构列表。包括标识架构和支持其检索所需的所有信息。

sessions List of all active NETCONF sessions on the device. Includes per-session counters for all NETCONF sessions.

设备上所有活动NETCONF会话的会话列表。包括所有NETCONF会话的每会话计数器。

statistics Includes global counters for the NETCONF server.

统计信息包括NETCONF服务器的全局计数器。

2.1.1. The /netconf-state/capabilities Subtree
2.1.1. /netconf state/capabilities子树

The /netconf-state/capabilities subtree contains the capabilities supported by the NETCONF server. The list MUST include all capabilities exchanged during session setup still applicable at the time of the request.

/netconf state/capabilities子树包含netconf服务器支持的功能。该列表必须包括在会话设置期间交换的、在请求时仍然适用的所有功能。

2.1.2. The /netconf-state/datastores Subtree
2.1.2. /netconf state/datastores子树

The /netconf-state/datastores subtree contains the list of available datastores for the NETCONF server and includes information on their lock state.

/netconf state/datastores子树包含netconf服务器可用数据存储的列表,并包含有关其锁定状态的信息。

datastore /name /locks

数据存储/名称/锁

name (leaf, netconf-datastore-type) Enumeration of supported datastores; candidate, running, startup.

支持的数据存储的名称(leaf、netconf数据存储类型)枚举;候选、运行、启动。

locks (grouping, lock-info) List of locks for the datastore. Information is provided for both global and partial locks [RFC5717]. For partial locks, the list of locked nodes and the select expressions originally used to request the lock are returned.

锁(分组,锁信息)数据存储的锁列表。提供了全局锁和部分锁的信息[RFC5717]。对于部分锁定,将返回锁定节点的列表和最初用于请求锁定的select表达式。

2.1.3. The /netconf-state/schemas Subtree
2.1.3. /netconf state/schemas子树

The list of supported schema for the NETCONF server.

NETCONF服务器支持的架构列表。

   schema
       /identifier   (key)
       /version      (key)
       /format       (key)
       /namespace
       /location
        
   schema
       /identifier   (key)
       /version      (key)
       /format       (key)
       /namespace
       /location
        

The elements identifier, version, and format are used as a key in the schema list. These are used in the <get-schema> operation.

元素标识符、版本和格式用作模式列表中的键。这些用于<get schema>操作。

identifier (string) Identifier for the schema list entry. The identifier is used in the <get-schema> operation and may be used for other means such as file retrieval.

标识符(字符串)架构列表项的标识符。标识符用于<get schema>操作,并可用于其他方式,如文件检索。

version (string) Version of the schema supported. Multiple versions MAY be supported simultaneously by a NETCONF server. Each version MUST be reported individually in the schema list, i.e., with same identifier, possibly different location, but different version.

支持的架构的版本(字符串)。NETCONF服务器可能同时支持多个版本。每个版本必须在模式列表中单独报告,即使用相同的标识符,可能不同的位置,但版本不同。

For YANG data models, version is the value of the most recent YANG 'revision' statement in the module or submodule, or the empty string if no 'revision' statement is present.

对于YANG数据模型,version是模块或子模块中最新YANG“revision”语句的值,如果不存在“revision”语句,则为空字符串。

format (identifyref, schema-format) The data modeling language the schema is written in. The data modeling language is represented as a YANG identity. This document defines the identities "xsd", "yang", "yin", "rng", and "rnc" (see Section 5).

format(identifyref,schema format)编写模式所用的数据建模语言。数据建模语言表示为YANG标识。本文件定义了标识“xsd”、“阳”、“阴”、“rng”和“rnc”(见第5节)。

namespace (inet:uri) The Extensible Markup Language (XML) namespace [XML-NAMES] defined by the schema.

名称空间(inet:uri)由模式定义的可扩展标记语言(XML)名称空间[XML-NAMES]。

location (union: enum, inet:uri) One or more locations from which this specific schema can be retrieved. The list SHOULD contain at least one entry per schema.

位置(union:enum,inet:uri)可以从中检索此特定架构的一个或多个位置。每个架构的列表应至少包含一个条目。

2.1.4. The /netconf-state/sessions Subtree
2.1.4. /netconf state/sessions子树

Includes session-specific data for NETCONF management sessions. The session list MUST include all currently active NETCONF sessions.

包括NETCONF管理会话的特定于会话的数据。会话列表必须包括所有当前活动的NETCONF会话。

   session
       /session-id (key)
       /transport
       /username
       /source-host
       /login-time
       /in-rpcs
       /in-bad-rpcs
       /out-rpc-errors
       /out-notifications
        
   session
       /session-id (key)
       /transport
       /username
       /source-host
       /login-time
       /in-rpcs
       /in-bad-rpcs
       /out-rpc-errors
       /out-notifications
        

session-id (uint32, 1..max) Unique identifier for the session. This value is the NETCONF session identifier, as defined in [RFC4741].

会话id(uint32,1..max)会话的唯一标识符。该值是[RFC4741]中定义的NETCONF会话标识符。

transport (identityref, transport) Identifies the transport for each session. The transport is represented as a YANG identity. This document defines the identities "netconf-ssh", "netconf-soap-over-beep", "netconf-soap-over-https", "netconf-beep", and "netconf-tls" (see Section 5).

传输(identityref,transport)标识每个会话的传输。传输被表示为杨标识。本文档定义了标识“netconf-ssh”、“netconf-soap-over-beep”、“netconf-soap-over-https”、“netconf-beep”和“netconf-tls”(参见第5节)。

username (string) The username is the client identity that was authenticated by the NETCONF transport protocol. The algorithm used to derive the username is NETCONF transport protocol specific and in addition specific to the authentication mechanism used by the NETCONF transport protocol.

用户名(字符串)用户名是由NETCONF传输协议验证的客户端标识。用于派生用户名的算法特定于NETCONF传输协议,并且特定于NETCONF传输协议使用的身份验证机制。

source-host (inet:host) Host identifier (IP address or name) of the NETCONF client.

NETCONF客户端的源主机(inet:host)主机标识符(IP地址或名称)。

login-time (yang:date-and-time) Time at the server at which the session was established.

在建立会话的服务器上的登录时间(yang:日期和时间)。

in-rpcs (yang:zero-based-counter32) Number of correct <rpc> messages received.

在rpc(yang:zero-based-counter32)中,接收到的正确<rpc>消息数。

in-bad-rpcs (yang:zero-based-counter32) Number of messages received when an <rpc> message was expected, that were not correct <rpc> messages. This includes XML parse errors and errors on the rpc layer.

在坏rpc(yang:zero-based-counter32)中,当预期出现<rpc>消息时,收到的不正确的<rpc>消息数。这包括XML解析错误和rpc层上的错误。

out-rpc-errors (yang:zero-based-counter32) Number of <rpc-reply> messages sent that contained an <rpc-error> element.

out rpc errors(yang:zero-based-counter32)发送的包含<rpc error>元素的<rpc reply>消息数。

out-notifications (yang:zero-based-counter32) Number of <notification> messages sent.

out通知(yang:zero-based-counter32)发送的<notification>消息数。

2.1.5. The /netconf-state/statistics Subtree
2.1.5. /netconf state/statistics子树

Statistical data pertaining to the NETCONF server.

与NETCONF服务器有关的统计数据。

   statistics
       /netconf-start-time
       /in-bad-hellos
       /in-sessions
       /dropped-sessions
       /in-rpcs
       /in-bad-rpcs
       /out-rpc-errors
       /out-notifications
        
   statistics
       /netconf-start-time
       /in-bad-hellos
       /in-sessions
       /dropped-sessions
       /in-rpcs
       /in-bad-rpcs
       /out-rpc-errors
       /out-notifications
        

statistics: Contains management-session-related performance data for the NETCONF server.

统计信息:包含NETCONF服务器的管理会话相关性能数据。

netconf-start-time (yang:date-and-time) Date and time at which the management subsystem was started.

netconf启动时间(yang:date and time)管理子系统启动的日期和时间。

in-bad-hellos (yang:zero-based-counter32) Number of sessions silently dropped because an invalid <hello> message was received.

在bad hellos(yang:zero-based-counter32)中,由于收到无效的<hello>消息而静默丢弃的会话数。

in-sessions (yang:zero-based-counter32) Number of sessions started.

在会话中(yang:zero-based-counter32)启动的会话数。

dropped-sessions (yang:zero-based-counter32) Number of sessions that were abnormally terminated, e.g., due to idle timeout or transport close.

丢弃的会话(yang:zero-based-counter32)由于空闲超时或传输关闭等原因而异常终止的会话数。

in-rpcs (yang:zero-based-counter32) Number of correct <rpc> messages received.

在rpc(yang:zero-based-counter32)中,接收到的正确<rpc>消息数。

in-bad-rpcs (yang:zero-based-counter32) Number of messages received when an <rpc> message was expected, which were not correct <rpc> messages.

在坏rpc(yang:zero-based-counter32)中,当预期出现<rpc>消息时收到的消息数,这些消息不正确<rpc>消息。

out-rpc-errors (yang:zero-based-counter32) Number of <rpc-reply> messages sent that contained an <rpc-error> element.

out rpc errors(yang:zero-based-counter32)发送的包含<rpc error>元素的<rpc reply>消息数。

out-notifications (yang:zero-based-counter32) Number of <notification> messages sent.

out通知(yang:zero-based-counter32)发送的<notification>消息数。

3. Schema Specific Operations
3. 特定于模式的操作
3.1. The <get-schema> Operation
3.1. <get schema>操作

Description:

说明:

This operation is used to retrieve a schema from the NETCONF server.

此操作用于从NETCONF服务器检索架构。

Parameters:

参数:

identifier (string): Identifier for the schema list entry. Mandatory parameter.

标识符(字符串):架构列表项的标识符。强制参数。

version (string): Version of the schema requested. Optional parameter.

版本(字符串):请求的架构的版本。可选参数。

format (identityref, schema-format): The data modeling language of the schema. Default value is 'yang' when not specified. Optional parameter.

format(identityref,schema format):模式的数据建模语言。未指定时,默认值为“yang”。可选参数。

Positive Response:

积极回应:

The NETCONF server returns the requested schema.

NETCONF服务器返回请求的架构。

Negative Response:

否定回答:

If the requested schema does not exist, the <error-tag> is 'invalid-value'.

如果请求的架构不存在,<error tag>为“无效值”。

If more than one schema matches the requested parameters, the <error-tag> is 'operation-failed', and <error-app-tag> is 'data-not-unique'.

如果有多个架构与请求的参数匹配,则<error tag>为“操作失败”,而<error app tag>为“数据不唯一”。

4. Examples
4. 例子
4.1. Retrieving Schema List via <get> Operation
4.1. 通过<get>操作检索架构列表

A NETCONF client retrieves the list of supported schema from a NETCONF server by retrieving the /netconf-state/schemas subtree via a <get> operation.

NETCONF客户端通过<get>操作检索/NETCONF state/schemas子树,从NETCONF服务器检索支持的模式列表。

Available schema for the requesting session are returned in the reply containing the <identifier>, <version>, <format>, and <location> elements.

请求会话的可用架构在包含<identifier>、<version>、<format>和<location>元素的应答中返回。

The response data can be used to determine the available schema and their versions. The schema itself (i.e., schema content) is not returned in the response. The optional <location> element contains a URI, which can be used to retrieve the schema by another protocol such as ftp [RFC0959] or http(s) [RFC2616] [RFC2818], or the special value 'NETCONF', which means that the schema can be retrieved from the device via the <get-schema> operation.

响应数据可用于确定可用的模式及其版本。响应中不返回模式本身(即模式内容)。可选的<location>元素包含一个URI,该URI可用于通过另一个协议(如ftp[RFC0959]或http[RFC2616][RFC2818]或特殊值“NETCONF”)检索架构,这意味着可以通过<get schema>操作从设备检索架构。

Example:

例子:

<rpc message-id="101"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <netconf-state xmlns=
      "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
        <schemas/>
      </netconf-state>
    </filter>
  </get>
</rpc>
        
<rpc message-id="101"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <netconf-state xmlns=
      "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
        <schemas/>
      </netconf-state>
    </filter>
  </get>
</rpc>
        

The NETCONF server returns a list of schema available for retrieval.

NETCONF服务器返回可供检索的架构列表。

<rpc-reply message-id="101"
           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <data>
    <netconf-state
    xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
      <schemas>
        <schema>
          <identifier>foo</identifier>
          <version>1.0</version>
          <format>xsd</format>
          <namespace>http://example.com/foo</namespace>
          <location>ftp://ftp.example.com/schemas/foo_1.0.xsd</location>
          <location>http://www.example.com/schema/foo_1.0.xsd</location>
          <location>NETCONF</location>
        </schema>
        <schema>
          <identifier>foo</identifier>
          <version>1.1</version>
          <format>xsd</format>
          <namespace>http://example.com/foo</namespace>
          <location>ftp://ftp.example.com/schemas/foo_1.1.xsd</location>
          <location>http://www.example.com/schema/foo_1.1.xsd</location>
          <location>NETCONF</location>
        </schema>
        <schema>
          <identifier>bar</identifier>
          <version>2008-06-01</version>
          <format>yang</format>
          <namespace>http://example.com/bar</namespace>
          <location>
            http://example.com/schema/bar@2008-06-01.yang
          </location>
          <location>NETCONF</location>
        </schema>
        <schema>
          <identifier>bar-types</identifier>
          <version>2008-06-01</version>
          <format>yang</format>
          <namespace>http://example.com/bar</namespace>
          <location>
            http://example.com/schema/bar-types@2008-06-01.yang
          </location>
          <location>NETCONF</location>
        </schema>
      </schemas>
    </netconf-state>
  </data>
</rpc-reply>
        
<rpc-reply message-id="101"
           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <data>
    <netconf-state
    xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
      <schemas>
        <schema>
          <identifier>foo</identifier>
          <version>1.0</version>
          <format>xsd</format>
          <namespace>http://example.com/foo</namespace>
          <location>ftp://ftp.example.com/schemas/foo_1.0.xsd</location>
          <location>http://www.example.com/schema/foo_1.0.xsd</location>
          <location>NETCONF</location>
        </schema>
        <schema>
          <identifier>foo</identifier>
          <version>1.1</version>
          <format>xsd</format>
          <namespace>http://example.com/foo</namespace>
          <location>ftp://ftp.example.com/schemas/foo_1.1.xsd</location>
          <location>http://www.example.com/schema/foo_1.1.xsd</location>
          <location>NETCONF</location>
        </schema>
        <schema>
          <identifier>bar</identifier>
          <version>2008-06-01</version>
          <format>yang</format>
          <namespace>http://example.com/bar</namespace>
          <location>
            http://example.com/schema/bar@2008-06-01.yang
          </location>
          <location>NETCONF</location>
        </schema>
        <schema>
          <identifier>bar-types</identifier>
          <version>2008-06-01</version>
          <format>yang</format>
          <namespace>http://example.com/bar</namespace>
          <location>
            http://example.com/schema/bar-types@2008-06-01.yang
          </location>
          <location>NETCONF</location>
        </schema>
      </schemas>
    </netconf-state>
  </data>
</rpc-reply>
        
4.2. Retrieving Schema Instances
4.2. 检索架构实例

Given the reply in the previous section, the following examples illustrate the retrieval of 'foo', 'bar', and 'bar-types' schema at multiple locations, with multiple formats, and in multiple locations.

根据上一节中的回答,以下示例说明了在多个位置、多个格式和多个位置检索“foo”、“bar”和“bar type”模式。

1. foo, version 1.0 in xsd format:

1. foo,xsd格式的1.0版:

       a.  Via FTP using location
           ftp://ftp.example.com/schemas/foo_1.0.xsd
        
       a.  Via FTP using location
           ftp://ftp.example.com/schemas/foo_1.0.xsd
        
       b.  Via HTTP using location
           http://www.example.com/schema/foo_1.0.xsd
        
       b.  Via HTTP using location
           http://www.example.com/schema/foo_1.0.xsd
        

c. Via <get-schema> using identifier, version, and format parameters.

c. 使用标识符、版本和格式参数通过<get schema>。

       <rpc message-id="101"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <get-schema
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           <identifier>foo</identifier>
           <version>1.0</version>
           <format>xsd</format>
         </get-schema>
       </rpc>
        
       <rpc message-id="101"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <get-schema
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           <identifier>foo</identifier>
           <version>1.0</version>
           <format>xsd</format>
         </get-schema>
       </rpc>
        
       <rpc-reply message-id="101"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <data
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
             <!-- foo 1.0 xsd schema contents here -->
           </xs:schema>
         </data>
       </rpc-reply>
        
       <rpc-reply message-id="101"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <data
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
             <!-- foo 1.0 xsd schema contents here -->
           </xs:schema>
         </data>
       </rpc-reply>
        

2. bar, version 2008-06-01 in YANG format:

2. bar,版本2008-06-01,杨格式:

       a.  Via HTTP using location
           http://example.com/schema/bar@2008-06-01.yang
        
       a.  Via HTTP using location
           http://example.com/schema/bar@2008-06-01.yang
        

b. Via <get-schema> using identifier and version parameters:

b. 使用标识符和版本参数通过<get schema>:

         <rpc message-id="102"
           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
           <get-schema
           xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
             <identifer>bar</identifer>
             <version>2008-06-01</version>
           </get-schema>
         </rpc>
        
         <rpc message-id="102"
           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
           <get-schema
           xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
             <identifer>bar</identifer>
             <version>2008-06-01</version>
           </get-schema>
         </rpc>
        
         <rpc-reply message-id="102"
           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
           <data
           xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
             module bar {
               //default format (yang) returned
               //bar version 2008-06-01 yang module
               //contents here ...
             }
           </data>
         </rpc-reply>
        
         <rpc-reply message-id="102"
           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
           <data
           xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
             module bar {
               //default format (yang) returned
               //bar version 2008-06-01 yang module
               //contents here ...
             }
           </data>
         </rpc-reply>
        

3. bar-types, version 2008-06-01 in default YANG format:

3. 条形图类型,版本2008-06-01,默认格式:

a. Via <get-schema> using identifer parameter:

a. 使用identifer参数通过<get schema>:

       <rpc message-id="103"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <get-schema
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           <identifer>bar-types</identifer>
         </get-schema>
       </rpc>
        
       <rpc message-id="103"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <get-schema
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           <identifer>bar-types</identifer>
         </get-schema>
       </rpc>
        
       <rpc-reply message-id="103"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <data
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           module bar-types {
             //default format (yang) returned
             //latest revision returned
             //is version 2008-06-01 yang module
             //contents here ...
           }
         </data>
       </rpc-reply>
        
       <rpc-reply message-id="103"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
         <data
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
           module bar-types {
             //default format (yang) returned
             //latest revision returned
             //is version 2008-06-01 yang module
             //contents here ...
           }
         </data>
       </rpc-reply>
        
5. NETCONF Monitoring Data Model
5. NETCONF监控数据模型

The data model described in this memo is defined in the following YANG module.

本备忘录中描述的数据模型在以下模块中定义。

This YANG module imports typedefs from [RFC6021] and references [RFC4741], [RFC4742], [RFC4743], [RFC4744], [RFC5539], [xmlschema-1], [RFC6020], [ISO/IEC19757-2:2008], and [RFC5717].

此模块从[RFC6021]和参考[RFC4741]、[RFC4742]、[RFC4743]、[RFC4744]、[RFC5539]、[xmlschema-1]、[RFC6020]、[ISO/IEC19757-2:2008]和[RFC5717]导入TypeDef。

<CODE BEGINS> file "ietf-netconf-monitoring@2010-10-04.yang"
        
<CODE BEGINS> file "ietf-netconf-monitoring@2010-10-04.yang"
        

module ietf-netconf-monitoring {

ietf netconf监控模块{

  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring";
  prefix "ncm";
        
  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring";
  prefix "ncm";
        
  import ietf-yang-types { prefix yang; }
  import ietf-inet-types { prefix inet; }
        
  import ietf-yang-types { prefix yang; }
  import ietf-inet-types { prefix inet; }
        

organization "IETF NETCONF (Network Configuration) Working Group";

组织“IETF网络配置工作组”;

  contact
    "WG Web:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>
        
  contact
    "WG Web:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>
        
     WG Chair: Mehmet Ersue
               <mailto:mehmet.ersue@nsn.com>
        
     WG Chair: Mehmet Ersue
               <mailto:mehmet.ersue@nsn.com>
        
     WG Chair: Bert Wijnen
               <mailto:bertietf@bwijnen.net>
        
     WG Chair: Bert Wijnen
               <mailto:bertietf@bwijnen.net>
        
     Editor:   Mark Scott
               <mailto:mark.scott@ericsson.com>
        
     Editor:   Mark Scott
               <mailto:mark.scott@ericsson.com>
        
     Editor:   Martin Bjorklund
               <mailto:mbj@tail-f.com>";
        
     Editor:   Martin Bjorklund
               <mailto:mbj@tail-f.com>";
        

description "NETCONF Monitoring Module. All elements in this module are read-only.

description“NETCONF监控模块。此模块中的所有元素都是只读的。

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

版权所有(c)2010 IETF信托基金和被确定为代码作者的人员。版权所有。

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

根据简化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信托法律条款第4.c节中规定的与IETF文件相关的许可证(http://trustee.ietf.org/license-info).

This version of this YANG module is part of RFC 6022; see the RFC itself for full legal notices.";

该模块的此版本是RFC 6022的一部分;有关完整的法律通知,请参见RFC本身。“;

  revision 2010-10-04 {
    description
      "Initial revision.";
    reference
      "RFC 6022: YANG Module for NETCONF Monitoring";
  }
        
  revision 2010-10-04 {
    description
      "Initial revision.";
    reference
      "RFC 6022: YANG Module for NETCONF Monitoring";
  }
        
  typedef netconf-datastore-type {
    type enumeration {
      enum running;
      enum candidate;
      enum startup;
    }
    description
      "Enumeration of possible NETCONF datastore types.";
    reference
      "RFC 4741: NETCONF Configuration Protocol";
  }
        
  typedef netconf-datastore-type {
    type enumeration {
      enum running;
      enum candidate;
      enum startup;
    }
    description
      "Enumeration of possible NETCONF datastore types.";
    reference
      "RFC 4741: NETCONF Configuration Protocol";
  }
        
  identity transport {
    description
      "Base identity for NETCONF transport types.";
  }
        
  identity transport {
    description
      "Base identity for NETCONF transport types.";
  }
        
  identity netconf-ssh {
    base transport;
    description
      "NETCONF over Secure Shell (SSH).";
    reference
      "RFC 4742: Using the NETCONF Configuration Protocol
                 over Secure SHell (SSH)";
  }
        
  identity netconf-ssh {
    base transport;
    description
      "NETCONF over Secure Shell (SSH).";
    reference
      "RFC 4742: Using the NETCONF Configuration Protocol
                 over Secure SHell (SSH)";
  }
        
  identity netconf-soap-over-beep {
    base transport;
    description
      "NETCONF over Simple Object Access Protocol (SOAP) over
       Blocks Extensible Exchange Protocol (BEEP).";
        
  identity netconf-soap-over-beep {
    base transport;
    description
      "NETCONF over Simple Object Access Protocol (SOAP) over
       Blocks Extensible Exchange Protocol (BEEP).";
        
    reference
      "RFC 4743: Using NETCONF over the Simple Object
                 Access Protocol (SOAP)";
  }
        
    reference
      "RFC 4743: Using NETCONF over the Simple Object
                 Access Protocol (SOAP)";
  }
        
  identity netconf-soap-over-https {
    base transport;
    description
      "NETCONF over Simple Object Access Protocol (SOAP)
      over Hypertext Transfer Protocol Secure (HTTPS).";
    reference
      "RFC 4743: Using NETCONF over the Simple Object
                 Access Protocol (SOAP)";
  }
        
  identity netconf-soap-over-https {
    base transport;
    description
      "NETCONF over Simple Object Access Protocol (SOAP)
      over Hypertext Transfer Protocol Secure (HTTPS).";
    reference
      "RFC 4743: Using NETCONF over the Simple Object
                 Access Protocol (SOAP)";
  }
        
  identity netconf-beep {
    base transport;
    description
      "NETCONF over Blocks Extensible Exchange Protocol (BEEP).";
    reference
      "RFC 4744: Using the NETCONF Protocol over the
                 Blocks Extensible Exchange Protocol (BEEP)";
  }
        
  identity netconf-beep {
    base transport;
    description
      "NETCONF over Blocks Extensible Exchange Protocol (BEEP).";
    reference
      "RFC 4744: Using the NETCONF Protocol over the
                 Blocks Extensible Exchange Protocol (BEEP)";
  }
        
  identity netconf-tls {
    base transport;
    description
      "NETCONF over Transport Layer Security (TLS).";
    reference
      "RFC 5539: NETCONF over Transport Layer Security (TLS)";
  }
        
  identity netconf-tls {
    base transport;
    description
      "NETCONF over Transport Layer Security (TLS).";
    reference
      "RFC 5539: NETCONF over Transport Layer Security (TLS)";
  }
        
  identity schema-format {
    description
      "Base identity for data model schema languages.";
  }
        
  identity schema-format {
    description
      "Base identity for data model schema languages.";
  }
        
  identity xsd {
    base schema-format;
    description
      "W3C XML Schema Definition.";
    reference
      "W3C REC REC-xmlschema-1-20041028:
         XML Schema Part 1: Structures";
  }
        
  identity xsd {
    base schema-format;
    description
      "W3C XML Schema Definition.";
    reference
      "W3C REC REC-xmlschema-1-20041028:
         XML Schema Part 1: Structures";
  }
        
  identity yang {
    base schema-format;
    description
      "The YANG data modeling language for NETCONF.";
    reference
      "RFC 6020:  YANG - A Data Modeling Language for the
                  Network Configuration Protocol (NETCONF)";
  }
        
  identity yang {
    base schema-format;
    description
      "The YANG data modeling language for NETCONF.";
    reference
      "RFC 6020:  YANG - A Data Modeling Language for the
                  Network Configuration Protocol (NETCONF)";
  }
        
  identity yin {
    base schema-format;
    description
      "The YIN syntax for YANG.";
    reference
      "RFC 6020:  YANG - A Data Modeling Language for the
                  Network Configuration Protocol (NETCONF)";
  }
        
  identity yin {
    base schema-format;
    description
      "The YIN syntax for YANG.";
    reference
      "RFC 6020:  YANG - A Data Modeling Language for the
                  Network Configuration Protocol (NETCONF)";
  }
        
  identity rng {
    base schema-format;
    description
      "Regular Language for XML Next Generation (RELAX NG).";
    reference
      "ISO/IEC 19757-2:2008: RELAX NG";
  }
        
  identity rng {
    base schema-format;
    description
      "Regular Language for XML Next Generation (RELAX NG).";
    reference
      "ISO/IEC 19757-2:2008: RELAX NG";
  }
        
  identity rnc {
    base schema-format;
    description
      "Relax NG Compact Syntax";
    reference
      "ISO/IEC 19757-2:2008: RELAX NG";
  }
        
  identity rnc {
    base schema-format;
    description
      "Relax NG Compact Syntax";
    reference
      "ISO/IEC 19757-2:2008: RELAX NG";
  }
        
  grouping common-counters {
    description
      "Counters that exist both per session, and also globally,
       accumulated from all sessions.";
        
  grouping common-counters {
    description
      "Counters that exist both per session, and also globally,
       accumulated from all sessions.";
        
    leaf in-rpcs {
      type yang:zero-based-counter32;
      description
        "Number of correct <rpc> messages received.";
    }
    leaf in-bad-rpcs {
      type yang:zero-based-counter32;
        
    leaf in-rpcs {
      type yang:zero-based-counter32;
      description
        "Number of correct <rpc> messages received.";
    }
    leaf in-bad-rpcs {
      type yang:zero-based-counter32;
        
      description
        "Number of messages received when an <rpc> message was expected,
         that were not correct <rpc> messages.  This includes XML parse
         errors and errors on the rpc layer.";
    }
    leaf out-rpc-errors {
      type yang:zero-based-counter32;
      description
        "Number of <rpc-reply> messages sent that contained an
         <rpc-error> element.";
    }
    leaf out-notifications {
      type yang:zero-based-counter32;
      description
        "Number of <notification> messages sent.";
    }
  }
        
      description
        "Number of messages received when an <rpc> message was expected,
         that were not correct <rpc> messages.  This includes XML parse
         errors and errors on the rpc layer.";
    }
    leaf out-rpc-errors {
      type yang:zero-based-counter32;
      description
        "Number of <rpc-reply> messages sent that contained an
         <rpc-error> element.";
    }
    leaf out-notifications {
      type yang:zero-based-counter32;
      description
        "Number of <notification> messages sent.";
    }
  }
        
  container netconf-state {
    config false;
    description
      "The netconf-state container is the root of the monitoring
       data model.";
        
  container netconf-state {
    config false;
    description
      "The netconf-state container is the root of the monitoring
       data model.";
        
    container capabilities {
      description
        "Contains the list of NETCONF capabilities supported by the
         server.";
        
    container capabilities {
      description
        "Contains the list of NETCONF capabilities supported by the
         server.";
        
      leaf-list capability {
        type inet:uri;
        description
          "List of NETCONF capabilities supported by the server.";
      }
    }
        
      leaf-list capability {
        type inet:uri;
        description
          "List of NETCONF capabilities supported by the server.";
      }
    }
        
    container datastores {
      description
        "Contains the list of NETCONF configuration datastores.";
        
    container datastores {
      description
        "Contains the list of NETCONF configuration datastores.";
        
      list datastore {
        key name;
        description
          "List of NETCONF configuration datastores supported by
           the NETCONF server and related information.";
        
      list datastore {
        key name;
        description
          "List of NETCONF configuration datastores supported by
           the NETCONF server and related information.";
        
        leaf name {
          type netconf-datastore-type;
        
        leaf name {
          type netconf-datastore-type;
        
          description
            "Name of the datastore associated with this list entry.";
        }
        container locks {
          presence
            "This container is present only if the datastore
             is locked.";
          description
            "The NETCONF <lock> and <partial-lock> operations allow
             a client to lock specific resources in a datastore.  The
             NETCONF server will prevent changes to the locked
             resources by all sessions except the one that acquired
             the lock(s).
        
          description
            "Name of the datastore associated with this list entry.";
        }
        container locks {
          presence
            "This container is present only if the datastore
             is locked.";
          description
            "The NETCONF <lock> and <partial-lock> operations allow
             a client to lock specific resources in a datastore.  The
             NETCONF server will prevent changes to the locked
             resources by all sessions except the one that acquired
             the lock(s).
        

Monitoring information is provided for each datastore entry including details such as the session that acquired the lock, the type of lock (global or partial) and the list of locked resources. Multiple locks per datastore are supported.";

为每个数据存储条目提供监控信息,包括获取锁的会话、锁的类型(全局或部分)和锁定资源列表等详细信息。每个数据存储支持多个锁。“;

          grouping lock-info {
            description
              "Lock related parameters, common to both global and
               partial locks.";
        
          grouping lock-info {
            description
              "Lock related parameters, common to both global and
               partial locks.";
        
            leaf locked-by-session {
              type uint32;
              mandatory true;
              description
                "The session ID of the session that has locked
                 this resource.  Both a global lock and a partial
                 lock MUST contain the NETCONF session-id.
        
            leaf locked-by-session {
              type uint32;
              mandatory true;
              description
                "The session ID of the session that has locked
                 this resource.  Both a global lock and a partial
                 lock MUST contain the NETCONF session-id.
        
                 If the lock is held by a session that is not managed
                 by the NETCONF server (e.g., a CLI session), a session
                 id of 0 (zero) is reported.";
              reference
                "RFC 4741: NETCONF Configuration Protocol";
            }
            leaf locked-time {
              type yang:date-and-time;
              mandatory true;
              description
                "The date and time of when the resource was
                 locked.";
            }
          }
        
                 If the lock is held by a session that is not managed
                 by the NETCONF server (e.g., a CLI session), a session
                 id of 0 (zero) is reported.";
              reference
                "RFC 4741: NETCONF Configuration Protocol";
            }
            leaf locked-time {
              type yang:date-and-time;
              mandatory true;
              description
                "The date and time of when the resource was
                 locked.";
            }
          }
        
          choice lock-type {
            description
              "Indicates if a global lock or a set of partial locks
               are set.";
        
          choice lock-type {
            description
              "Indicates if a global lock or a set of partial locks
               are set.";
        
            container global-lock {
              description
                "Present if the global lock is set.";
              uses lock-info;
            }
        
            container global-lock {
              description
                "Present if the global lock is set.";
              uses lock-info;
            }
        
            list partial-lock {
              key lock-id;
              description
                "List of partial locks.";
              reference
                "RFC 5717: Partial Lock Remote Procedure Call (RPC) for
                           NETCONF";
        
            list partial-lock {
              key lock-id;
              description
                "List of partial locks.";
              reference
                "RFC 5717: Partial Lock Remote Procedure Call (RPC) for
                           NETCONF";
        
              leaf lock-id {
                type uint32;
                description
                  "This is the lock id returned in the <partial-lock>
                   response.";
              }
              uses lock-info;
              leaf-list select {
                type yang:xpath1.0;
                min-elements 1;
                description
                  "The xpath expression that was used to request
                   the lock.  The select expression indicates the
                   original intended scope of the lock.";
              }
              leaf-list locked-node {
                type instance-identifier;
                description
                  "The list of instance-identifiers (i.e., the
                   locked nodes).
        
              leaf lock-id {
                type uint32;
                description
                  "This is the lock id returned in the <partial-lock>
                   response.";
              }
              uses lock-info;
              leaf-list select {
                type yang:xpath1.0;
                min-elements 1;
                description
                  "The xpath expression that was used to request
                   the lock.  The select expression indicates the
                   original intended scope of the lock.";
              }
              leaf-list locked-node {
                type instance-identifier;
                description
                  "The list of instance-identifiers (i.e., the
                   locked nodes).
        
                   The scope of the partial lock is defined by the list
                   of locked nodes.";
              }
            }
          }
        }
      }
    }
        
                   The scope of the partial lock is defined by the list
                   of locked nodes.";
              }
            }
          }
        }
      }
    }
        
    container schemas {
      description
        "Contains the list of data model schemas supported by the
         server.";
        
    container schemas {
      description
        "Contains the list of data model schemas supported by the
         server.";
        
      list schema {
        key "identifier version format";
        
      list schema {
        key "identifier version format";
        

description "List of data model schemas supported by the server.";

description“服务器支持的数据模型架构列表。”;

        leaf identifier {
          type string;
          description
            "Identifier to uniquely reference the schema.  The
             identifier is used in the <get-schema> operation and may
             be used for other purposes such as file retrieval.
        
        leaf identifier {
          type string;
          description
            "Identifier to uniquely reference the schema.  The
             identifier is used in the <get-schema> operation and may
             be used for other purposes such as file retrieval.
        
             For modeling languages that support or require a data
             model name (e.g., YANG module name) the identifier MUST
             match that name.  For YANG data models, the identifier is
             the name of the module or submodule.  In other cases, an
             identifier such as a filename MAY be used instead.";
        }
        leaf version {
          type string;
          description
            "Version of the schema supported.  Multiple versions MAY be
             supported simultaneously by a NETCONF server.  Each
             version MUST be reported individually in the schema list,
             i.e., with same identifier, possibly different location,
             but different version.
        
             For modeling languages that support or require a data
             model name (e.g., YANG module name) the identifier MUST
             match that name.  For YANG data models, the identifier is
             the name of the module or submodule.  In other cases, an
             identifier such as a filename MAY be used instead.";
        }
        leaf version {
          type string;
          description
            "Version of the schema supported.  Multiple versions MAY be
             supported simultaneously by a NETCONF server.  Each
             version MUST be reported individually in the schema list,
             i.e., with same identifier, possibly different location,
             but different version.
        
             For YANG data models, version is the value of the most
             recent YANG 'revision' statement in the module or
             submodule, or the empty string if no 'revision' statement
             is present.";
        }
        leaf format {
          type identityref {
            base schema-format;
          }
          description
            "The data modeling language the schema is written
             in (currently xsd, yang, yin, rng, or rnc).
        
             For YANG data models, version is the value of the most
             recent YANG 'revision' statement in the module or
             submodule, or the empty string if no 'revision' statement
             is present.";
        }
        leaf format {
          type identityref {
            base schema-format;
          }
          description
            "The data modeling language the schema is written
             in (currently xsd, yang, yin, rng, or rnc).
        
             For YANG data models, 'yang' format MUST be supported and
             'yin' format MAY also be provided.";
        }
        leaf namespace {
          type inet:uri;
          mandatory true;
          description
            "The XML namespace defined by the data model.
        
             For YANG data models, 'yang' format MUST be supported and
             'yin' format MAY also be provided.";
        }
        leaf namespace {
          type inet:uri;
          mandatory true;
          description
            "The XML namespace defined by the data model.
        
             For YANG data models, this is the module's namespace.
             If the list entry describes a submodule, this field
             contains the namespace of the module to which the
             submodule belongs.";
        }
        leaf-list location {
          type union {
            type enumeration {
              enum "NETCONF";
            }
            type inet:uri;
          }
          description
            "One or more locations from which the schema can be
             retrieved.  This list SHOULD contain at least one
             entry per schema.
        
             For YANG data models, this is the module's namespace.
             If the list entry describes a submodule, this field
             contains the namespace of the module to which the
             submodule belongs.";
        }
        leaf-list location {
          type union {
            type enumeration {
              enum "NETCONF";
            }
            type inet:uri;
          }
          description
            "One or more locations from which the schema can be
             retrieved.  This list SHOULD contain at least one
             entry per schema.
        
             A schema entry may be located on a remote file system
             (e.g., reference to file system for ftp retrieval) or
             retrieved directly from a server supporting the
             <get-schema> operation (denoted by the value 'NETCONF').";
        }
      }
    }
        
             A schema entry may be located on a remote file system
             (e.g., reference to file system for ftp retrieval) or
             retrieved directly from a server supporting the
             <get-schema> operation (denoted by the value 'NETCONF').";
        }
      }
    }
        
    container sessions {
      description
        "The sessions container includes session-specific data for
         NETCONF management sessions.  The session list MUST include
         all currently active NETCONF sessions.";
        
    container sessions {
      description
        "The sessions container includes session-specific data for
         NETCONF management sessions.  The session list MUST include
         all currently active NETCONF sessions.";
        
      list session {
        key session-id;
        description
          "All NETCONF sessions managed by the NETCONF server
           MUST be reported in this list.";
        
      list session {
        key session-id;
        description
          "All NETCONF sessions managed by the NETCONF server
           MUST be reported in this list.";
        
        leaf session-id {
          type uint32 {
            range "1..max";
          }
          description
            "Unique identifier for the session.  This value is the
             NETCONF session identifier, as defined in RFC 4741.";
          reference
            "RFC 4741: NETCONF Configuration Protocol";
        }
        leaf transport {
          type identityref {
            base transport;
          }
          mandatory true;
          description
            "Identifies the transport for each session, e.g.,
            'netconf-ssh', 'netconf-soap', etc.";
        }
        leaf username  {
          type string;
          mandatory true;
          description
            "The username is the client identity that was authenticated
            by the NETCONF transport protocol.  The algorithm used to
            derive the username is NETCONF transport protocol specific
            and in addition specific to the authentication mechanism
            used by the NETCONF transport protocol.";
        }
        leaf source-host {
          type inet:host;
          description
            "Host identifier of the NETCONF client.  The value
             returned is implementation specific (e.g., hostname,
             IPv4 address, IPv6 address)";
        }
        
        leaf session-id {
          type uint32 {
            range "1..max";
          }
          description
            "Unique identifier for the session.  This value is the
             NETCONF session identifier, as defined in RFC 4741.";
          reference
            "RFC 4741: NETCONF Configuration Protocol";
        }
        leaf transport {
          type identityref {
            base transport;
          }
          mandatory true;
          description
            "Identifies the transport for each session, e.g.,
            'netconf-ssh', 'netconf-soap', etc.";
        }
        leaf username  {
          type string;
          mandatory true;
          description
            "The username is the client identity that was authenticated
            by the NETCONF transport protocol.  The algorithm used to
            derive the username is NETCONF transport protocol specific
            and in addition specific to the authentication mechanism
            used by the NETCONF transport protocol.";
        }
        leaf source-host {
          type inet:host;
          description
            "Host identifier of the NETCONF client.  The value
             returned is implementation specific (e.g., hostname,
             IPv4 address, IPv6 address)";
        }
        
        leaf login-time {
          type yang:date-and-time;
          mandatory true;
          description
            "Time at the server at which the session was established.";
        }
        uses common-counters {
          description
            "Per-session counters.  Zero based with following reset
             behaviour:
               - at start of a session
               - when max value is reached";
        }
      }
    }
        
        leaf login-time {
          type yang:date-and-time;
          mandatory true;
          description
            "Time at the server at which the session was established.";
        }
        uses common-counters {
          description
            "Per-session counters.  Zero based with following reset
             behaviour:
               - at start of a session
               - when max value is reached";
        }
      }
    }
        
    container statistics {
      description
        "Statistical data pertaining to the NETCONF server.";
        
    container statistics {
      description
        "Statistical data pertaining to the NETCONF server.";
        
      leaf netconf-start-time {
        type yang:date-and-time;
        description
          "Date and time at which the management subsystem was
           started.";
      }
      leaf in-bad-hellos {
        type yang:zero-based-counter32;
        description
          "Number of sessions silently dropped because an
          invalid <hello> message was received.  This includes <hello>
          messages with a 'session-id' attribute, bad namespace, and
          bad capability declarations.";
      }
      leaf in-sessions {
        type yang:zero-based-counter32;
        description
          "Number of sessions started.  This counter is incremented
           when a <hello> message with a <session-id> is sent.
        
      leaf netconf-start-time {
        type yang:date-and-time;
        description
          "Date and time at which the management subsystem was
           started.";
      }
      leaf in-bad-hellos {
        type yang:zero-based-counter32;
        description
          "Number of sessions silently dropped because an
          invalid <hello> message was received.  This includes <hello>
          messages with a 'session-id' attribute, bad namespace, and
          bad capability declarations.";
      }
      leaf in-sessions {
        type yang:zero-based-counter32;
        description
          "Number of sessions started.  This counter is incremented
           when a <hello> message with a <session-id> is sent.
        
          'in-sessions' - 'in-bad-hellos' =
              'number of correctly started netconf sessions'";
      }
      leaf dropped-sessions {
        type yang:zero-based-counter32;
        
          'in-sessions' - 'in-bad-hellos' =
              'number of correctly started netconf sessions'";
      }
      leaf dropped-sessions {
        type yang:zero-based-counter32;
        
        description
          "Number of sessions that were abnormally terminated, e.g.,
           due to idle timeout or transport close.  This counter is not
           incremented when a session is properly closed by a
           <close-session> operation, or killed by a <kill-session>
           operation.";
      }
      uses common-counters {
        description
          "Global counters, accumulated from all sessions.
           Zero based with following reset behaviour:
             - re-initialization of NETCONF server
             - when max value is reached";
      }
    }
  }
        
        description
          "Number of sessions that were abnormally terminated, e.g.,
           due to idle timeout or transport close.  This counter is not
           incremented when a session is properly closed by a
           <close-session> operation, or killed by a <kill-session>
           operation.";
      }
      uses common-counters {
        description
          "Global counters, accumulated from all sessions.
           Zero based with following reset behaviour:
             - re-initialization of NETCONF server
             - when max value is reached";
      }
    }
  }
        

rpc get-schema { description "This operation is used to retrieve a schema from the NETCONF server.

rpc get schema{description“此操作用于从NETCONF服务器检索架构。

Positive Response: The NETCONF server returns the requested schema.

肯定响应:NETCONF服务器返回请求的架构。

Negative Response: If requested schema does not exist, the <error-tag> is 'invalid-value'.

否定响应:如果请求的架构不存在,<error tag>为“无效值”。

         If more than one schema matches the requested parameters, the
         <error-tag> is 'operation-failed', and <error-app-tag> is
         'data-not-unique'.";
        
         If more than one schema matches the requested parameters, the
         <error-tag> is 'operation-failed', and <error-app-tag> is
         'data-not-unique'.";
        
    input {
      leaf identifier {
        type string;
        mandatory true;
        description
          "Identifier for the schema list entry.";
      }
      leaf version {
        type string;
        description
          "Version of the schema requested.  If this parameter is not
           present, and more than one version of the schema exists on
           the server, a 'data-not-unique' error is returned, as
           described above.";
      }
        
    input {
      leaf identifier {
        type string;
        mandatory true;
        description
          "Identifier for the schema list entry.";
      }
      leaf version {
        type string;
        description
          "Version of the schema requested.  If this parameter is not
           present, and more than one version of the schema exists on
           the server, a 'data-not-unique' error is returned, as
           described above.";
      }
        
      leaf format {
        type identityref {
          base schema-format;
        }
        description
           "The data modeling language of the schema.  If this
            parameter is not present, and more than one formats of
            the schema exists on the server, a 'data-not-unique' error
            is returned, as described above.";
      }
    }
    output {
        anyxml data {
          description
            "Contains the schema content.";
      }
    }
  }
}
        
      leaf format {
        type identityref {
          base schema-format;
        }
        description
           "The data modeling language of the schema.  If this
            parameter is not present, and more than one formats of
            the schema exists on the server, a 'data-not-unique' error
            is returned, as described above.";
      }
    }
    output {
        anyxml data {
          description
            "Contains the schema content.";
      }
    }
  }
}
        

<CODE ENDS>

<代码结束>

6. Security Considerations
6. 安全考虑

The YANG module defined in this memo is designed to be accessed via the NETCONF protocol [RFC4741]. The lowest NETCONF layer is the secure transport layer and the mandatory to implement secure transport is SSH [RFC4742].

本备忘录中定义的模块旨在通过NETCONF协议[RFC4741]访问。最低的NETCONF层是安全传输层,实现安全传输的必需层是SSH[RFC4742]。

Some of the readable data nodes in this YANG module may be considered sensitive or vulnerable in some network environments. It is thus important to control read access (e.g., via get, get-config, or notification) to these data nodes.

在某些网络环境中,此模块中的某些可读数据节点可能被视为敏感或易受攻击。因此,控制对这些数据节点的读取访问(例如,通过get、get config或通知)非常重要。

These are the containers, list nodes, and data nodes with their specific sensitivity/vulnerability:

以下是容器、列表节点和数据节点及其特定的敏感度/漏洞:

/netconf-state/sessions/session/username: Contains identity information that could be used in an attempt to authenticate with the server.

/netconf state/sessions/session/username:包含可用于尝试向服务器进行身份验证的标识信息。

This username is only meant for monitoring, and SHOULD NOT be used for other purposes, such as access control, without a detailed discussion of the limitations of this reported username. For example, it is possible that server A and server B might report the same username, but these might be for different persons.

此用户名仅用于监视,不应用于其他目的,如访问控制,除非详细讨论此报告用户名的限制。例如,服务器A和服务器B可能报告相同的用户名,但可能是针对不同的人。

7. Acknowledgements
7. 致谢

The authors would like to thank Andy Bierman, Mehmet Ersue, Washam Fan, David Harrington, Balazs Lengyel, Hideki Okita, Juergen Schoenwaelder, Bert Wijnen, and many other members of the NETCONF WG for providing important input to this document. The authors would also like to specifically acknowledge Sharon Chisholm's work on "NETCONF Monitoring Schema" [NETCONF] and contribution to this document.

作者要感谢Andy Bierman、Mehmet Ersue、Washam Fan、David Harrington、Balazs Lengyel、Hideki Okita、Juergen Schoenwaeld、Bert Wijnen和NETCONF工作组的许多其他成员为本文件提供了重要投入。作者还想特别感谢Sharon Chisholm在“NETCONF监控模式”[NETCONF]方面的工作以及对本文件的贡献。

8. IANA Considerations
8. IANA考虑

This document registers one URI in "The IETF XML Registry". Following the format in [RFC3688], the following has been registered.

本文档在“IETF XML注册表”中注册了一个URI。按照[RFC3688]中的格式,已注册以下内容。

URI: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring Registrant Contact: The IESG. XML: N/A, the requested URI is an XML namespace.

URI:urn:ietf:params:xml:ns:yang:ietf-netconf监控注册人联系人:IESG。XML:N/A,请求的URI是一个XML名称空间。

This document registers one module in the "YANG Module Names" registry. Following the format in [RFC6020], the following has been registered.

本文件在“YANG模块名称”注册表中注册了一个模块。按照[RFC6020]中的格式,已注册以下内容。

     name: ietf-netconf-monitoring
     namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
     prefix: ncm
     reference: RFC 6022
        
     name: ietf-netconf-monitoring
     namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
     prefix: ncm
     reference: RFC 6022
        
9. References
9. 工具书类
9.1. Normative References
9.1. 规范性引用文件

[ISO/IEC19757-2:2008] ISO/IEC, "Document Schema Definition Language (DSDL) -- Part 2: Regular-grammar-based validation -- RELAX NG", December 2008, <http://www.iso.org/iso/ catalogue_detail.htm?csnumber=37605>.

[ISO/IEC19757-2:2008]ISO/IEC,“文档模式定义语言(DSDL)——第2部分:基于规则语法的验证——RELAXNG”,2008年12月<http://www.iso.org/iso/ 目录\u detail.htm?csnumber=37605>。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC4741] Enns, R., "NETCONF Configuration Protocol", RFC 4741, December 2006.

[RFC4741]Enns,R.,“网络配置协议”,RFC 47412006年12月。

[RFC4742] Wasserman, M. and T. Goddard, "Using the NETCONF Configuration Protocol over Secure SHell (SSH)", RFC 4742, December 2006.

[RFC4742]Wasserman,M.和T.Goddard,“在安全外壳(SSH)上使用NETCONF配置协议”,RFC 4742,2006年12月。

[RFC4743] Goddard, T., "Using NETCONF over the Simple Object Access Protocol (SOAP)", RFC 4743, December 2006.

[RFC4743]Goddard,T.,“通过简单对象访问协议(SOAP)使用NETCONF”,RFC 4743,2006年12月。

[RFC4744] Lear, E. and K. Crozier, "Using the NETCONF Protocol over the Blocks Extensible Exchange Protocol (BEEP)", RFC 4744, December 2006.

[RFC4744]Lear,E.和K.Crozier,“在块可扩展交换协议(BEEP)上使用NETCONF协议”,RFC 47442006年12月。

[RFC5539] Badra, M., "NETCONF over Transport Layer Security (TLS)", RFC 5539, May 2009.

[RFC5539]Badra,M.,“传输层安全(TLS)上的网络配置”,RFC 5539,2009年5月。

[RFC5717] Lengyel, B. and M. Bjorklund, "Partial Lock Remote Procedure Call (RPC) for NETCONF", RFC 5717, December 2009.

[RFC5717]Lengyel,B.和M.Bjorklund,“NETCONF的部分锁远程过程调用(RPC)”,RFC 57172009年12月。

[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", October 2010.

[RFC6020]Bjorklund,M.,Ed.“YANG-网络配置协议(NETCONF)的数据建模语言”,2010年10月。

[RFC6021] Schoenwaelder, J., Ed., "Common YANG Data Types", October 2010.

[RFC6021]Schoenwaeld,J.,Ed.,“常见的杨氏数据类型”,2010年10月。

[XML-NAMES] Hollander, D., Tobin, R., Thompson, H., Bray, T., and A. Layman, "Namespaces in XML 1.0 (Third Edition)", World Wide Web Consortium Recommendation REC-xml-names-20091208, December 2009, <http://www.w3.org/TR/2009/REC-xml-names-20091208>.

[XML-NAMES]Hollander,D.,Tobin,R.,Thompson,H.,Bray,T.,和A.Layman,“XML 1.0中的名称空间(第三版)”,万维网联盟建议REC-XML-NAMES-20091208,2009年12月<http://www.w3.org/TR/2009/REC-xml-names-20091208>.

[xmlschema-1] Biron, Paul V. and Ashok. Malhotra, "XML Schema Part 1: Structures Second Edition W3C Recommendation 28 October 2004", October 2004, <http://www.w3.org/TR/xmlschema-1>.

[xmlschema-1]Biron、Paul V.和Ashok。Malhotra,“XML模式第1部分:结构第二版W3C建议2004年10月28日”,2004年10月<http://www.w3.org/TR/xmlschema-1>.

9.2. Informative References
9.2. 资料性引用

[NETCONF] Chisholm, S. and H. Trevino, "NETCONF Monitoring Schema", Work in Progress, February 2007.

[NETCONF]Chisholm,S.和H.Trevino,“NETCONF监控模式”,正在进行的工作,2007年2月。

[RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 9, RFC 959, October 1985.

[RFC0959]Postel,J.和J.Reynolds,“文件传输协议”,标准9,RFC 959,1985年10月。

[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.

[RFC2616]菲尔丁,R.,盖蒂斯,J.,莫卧儿,J.,弗莱斯蒂克,H.,马斯特,L.,利奇,P.,和T.伯纳斯李,“超文本传输协议——HTTP/1.1”,RFC 2616,1999年6月。

[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.

[RFC2818]Rescorla,E.,“TLS上的HTTP”,RFC2818,2000年5月。

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.

[RFC3688]Mealling,M.“IETF XML注册表”,BCP 81,RFC 3688,2004年1月。

Authors' Addresses

作者地址

Mark Scott Ericsson 3500 Carling Ave Nepean, Ontario K2H 8E9 Canada

马克·斯科特·爱立信加拿大安大略省内皮恩卡林大道3500号K2H 8E9

   EMail: mark.scott@ericsson.com
        
   EMail: mark.scott@ericsson.com
        

Martin Bjorklund Tail-f Systems Klara Norra Kyrkogata 31 SE-111 22 Stockholm, Sweden

Martin Bjorklund Tail-f系统Klara Norra Kyrkogata 31 SE-111 22瑞典斯德哥尔摩

   EMail: mbj@tail-f.com
        
   EMail: mbj@tail-f.com