0fbe94ddc4c472aa33fe13fd01857a060345f288
[yangtools.git] / yang / yang-parser-impl / src / test / resources / stmt-test / extensions / yang-ext.yang
1 module yang-ext {
2     yang-version 1;
3     namespace "urn:opendaylight:yang:extension:yang-ext";
4     prefix "ext";
5     
6     contact "Anton Tkacik <ttkacik@cisco.com>";
7
8     description 
9             "Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
10
11             This program and the accompanying materials are made available under the
12             terms of the Eclipse Public License v1.0 which accompanies this distribution,
13             and is available at http://www.eclipse.org/legal/epl-v10.html";
14
15     revision "2013-07-09" {
16         description "";
17     }
18
19     // Augmentation name
20
21     extension "augment-identifier" {
22         description 
23            "YANG language extension which assigns an identifier to 
24             augmentation. Augment identifier is used to identify
25             specific augment statement by name. 
26
27             The identifier syntax is defined formally defined by the rule
28             'identifier' in Section 12 of RFC 6020.
29
30             All augment identifiers defined in a namespace MUST be unique.
31             The namespace of augment identifiers is shared by module and
32             its submodules.";
33
34             /*
35                 Discussion:
36                 This extension allows for ease of development / debug
37                 of YANG modules and it is suitable for code generation,
38                 where each augment statement is nicely identified by
39                 unique name instead of combination of augment target
40                 and when condition. 
41             */
42         argument "identifier";
43     }
44
45
46     // Context-aware RPCs
47
48     grouping rpc-context-ref {
49         description 
50            "A reference to RPC context.";
51         leaf context-instance {
52             type instance-identifier;
53             description "Pointer to the context. ";
54         }
55     }
56
57     extension "rpc-context-instance" {
58         description
59            "YANG language extension which defines enclosing (parent) 
60             schema node as referencable context for RPCs.
61
62             The argument is identity which is used to identify RPC context
63             type.";
64
65         argument "context-type";
66     }
67
68     extension "context-reference" {
69         argument "context-type";
70     }
71
72     extension "context-instance" {
73         argument "context-type";
74     }
75     
76     extension "instance-target" {
77         argument "path";
78     }
79 }