blob: f59426a86cb2849954743ffdf1d9a0835d11f737 [file] [log] [blame]
Radek Krejci86d106e2018-10-18 09:53:19 +02001module ietf-yang-metadata {
2 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-metadata";
3 prefix md;
4
5 organization
6 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
7 contact
8 "WG Web: <https://datatracker.ietf.org/wg/netmod/>
9
10 WG List: <mailto:netmod@ietf.org>
11
12 WG Chair: Lou Berger
13 <mailto:lberger@labn.net>
14
15 WG Chair: Kent Watsen
16 <mailto:kwatsen@juniper.net>
17
18 Editor: Ladislav Lhotka
19 <mailto:lhotka@nic.cz>";
20 description
21 "This YANG module defines an 'extension' statement that allows
22 for defining metadata annotations.
23
24 Copyright (c) 2016 IETF Trust and the persons identified as
25 authors of the code. All rights reserved.
26
27 Redistribution and use in source and binary forms, with or
28 without modification, is permitted pursuant to, and subject to
29 the license terms contained in, the Simplified BSD License set
30 forth in Section 4.c of the IETF Trust's Legal Provisions
31 Relating to IETF Documents
32 (http://trustee.ietf.org/license-info).
33
34 This version of this YANG module is part of RFC 7952
35 (http://www.rfc-editor.org/info/rfc7952); see the RFC itself
36 for full legal notices.";
37
38 revision 2016-08-05 {
39 description
40 "Initial revision.";
41 reference
42 "RFC 7952: Defining and Using Metadata with YANG";
43 }
44
45 extension annotation {
46 argument name;
47 description
48 "This extension allows for defining metadata annotations in
49 YANG modules. The 'md:annotation' statement can appear only
50 at the top level of a YANG module or submodule, i.e., it
51 becomes a new alternative in the ABNF production rule for
52 'body-stmts' (Section 14 in RFC 7950).
53
54 The argument of the 'md:annotation' statement defines the name
55 of the annotation. Syntactically, it is a YANG identifier as
56 defined in Section 6.2 of RFC 7950.
57
58 An annotation defined with this 'extension' statement inherits
59 the namespace and other context from the YANG module in which
60 it is defined.
61
62 The data type of the annotation value is specified in the same
63 way as for a leaf data node using the 'type' statement.
64
65 The semantics of the annotation and other documentation can be
66 specified using the following standard YANG substatements (all
67 are optional): 'description', 'if-feature', 'reference',
68 'status', and 'units'.
69
70 A server announces support for a particular annotation by
71 including the module in which the annotation is defined among
72 the advertised YANG modules, e.g., in a NETCONF <hello>
73 message or in the YANG library (RFC 7950). The annotation can
74 then be attached to any instance of a data node defined in any
75 YANG module that is advertised by the server.
76
77 XML encoding and JSON encoding of annotations are defined in
78 RFC 7952.";
79 }
80}