File: sysrepo.yang

package info (click to toggle)
sysrepo 1.4.70-4
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 3,948 kB
  • sloc: ansic: 44,333; cpp: 2,631; python: 2,081; sh: 143; makefile: 24
file content (285 lines) | stat: -rw-r--r-- 8,020 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
module sysrepo {
    namespace "http://www.sysrepo.org/yang/sysrepo";
    prefix sr;

    yang-version 1.1;

    import ietf-yang-types {
        prefix yang;
    }

    import ietf-yang-metadata {
        prefix md;
        revision-date 2016-08-05;
    }

    organization
        "CESNET";

    contact
        "Author: Michal Vasko
                 <mvasko@cesnet.cz>";

    description
        "Sysrepo YANG datastore internal attributes and information.";

    revision "2020-01-15" {
        description
            "Added a new purge operation.";
    }

    revision "2019-11-26" {
        description
            "startup-data renamed to data; it is used for running datastore as well.";
    }

    revision "2019-10-25" {
        description
            "Added attributes for storing operational data owners.";
    }

    revision "2019-09-25" {
        description
            "Added initial startup data for newly installed modules.";
    }

    revision "2019-09-17" {
        description
            "Added list of scheduled installed modules.";
    }

    revision "2019-07-10" {
        description
            "Initial revision.";
    }

    typedef module-ref {
        description
            "Reference to a module.";
        type leafref {
            path "/sysrepo-modules/module/name";
        }
    }

    md:annotation operation {
        type enumeration {
            enum none {
                description
                    "Node with this operation must exist but does not affect the datastore in any way.";
                reference
                    "RFC 6241 section 7.2.: default-operation";
            }
            enum ether {
                description
                    "Node with this operation does not have to exist and does not affect the datastore in any way.";
            }
            enum purge {
                description
                    "Node with this operation represents an arbitrary generic node instance and all
                     the instances will be deleted.";
            }
        }
        description
            "Additional proprietary <edit-config> operations used internally.";
        reference
            "RFC 6241 section 7.2.";
    }

    md:annotation orig-key {
        type string;
        description
            "List keys that were originally preceding the list node instance in the configuration.";
    }

    md:annotation orig-value {
        type string;
        description
            "Leaf-list value that was originally prceding the leaf-list node instance in the configuration.";
    }

    md:annotation orig-dflt {
        type empty;
        description
            "Present if the node was originally a default node.";
    }

    md:annotation pid {
        type uint32;
        description
            "Process with this PID is the owner of the operational data subtree.";
    }

    md:annotation conn-ptr {
        type uint64;
        description
            "Connection with this address is the owner of the operational data subtree.";
    }

    grouping module-info-grp {
        leaf name {
            type string;
            description
                "Module name.";
        }

        leaf revision {
            type string;
            description
                "Module revision.";
        }

        leaf-list enabled-feature {
            type string;
            description
                "List of all the enabled features.";
        }
    }

    grouping deps-grp {
        leaf-list module {
            type module-ref;
            description
                "Module that is being dependent on.";
        }

        list inst-id {
            key "xpath";

            leaf xpath {
                type yang:xpath1.0;
                description
                    "XPath identifying the node with the dependency.";
            }

            leaf default-module {
                type module-ref;
                description
                    "Module dependency in case the default value is being used.";
            }
        }
    }

    container sysrepo-modules {
        config false;
        description
            "All installed Sysrepo modules.";

        list module {
            key "name";
            description
                "Sysrepo module.";

            uses module-info-grp;

            leaf replay-support {
                type uint64;
                description
                    "Present only if the module supports replay. Means the earliest stored notification if any present.
                     Otherwise the time the replay support was switched on.";
            }

            choice changed-module {
                description
                    "This module is scheduled for a change.";
                leaf removed {
                    type empty;
                    description
                        "Module was removed.";
                }

                leaf updated-yang {
                    type string;
                    description
                        "Module was updated with a newer revision. Content is the whole new YANG module.";
                }

                case feature-changes {
                    list changed-feature {
                        key "name";
                        description
                            "Module features are scheduled for a change.";

                        leaf name {
                            type string;
                            description
                                "Changed feature name.";
                        }

                        leaf change {
                            type enumeration {
                                enum "enable" {
                                    description
                                        "Feature will be enabled.";
                                }
                                enum "disable" {
                                    description
                                        "Feature will be disabled.";
                                }
                            }
                            mandatory true;
                            description
                                "Feature change nature.";
                        }
                    }
                }
            }

            container data-deps {
                description
                    "Module data dependencies on other modules.";
                uses deps-grp;
            }

            list op-deps {
                key "xpath";
                description
                    "Module operation (RPCs, Actions, Notifications) dependencies on other modules.";

                leaf xpath {
                    type yang:xpath1.0;
                    description
                        "XPath identifying the operation.";
                }

                container in {
                    description
                        "Operation input or notification dependencies.";
                    uses deps-grp;
                }

                container out {
                    description
                        "Operation output dependencies.";
                    uses deps-grp;
                }
            }

            leaf-list inverse-data-deps {
                type module-ref;
                description
                    "List of modules that depend on this module.";
            }
        }

        list installed-module {
            key "name";
            description
                "Sysrepo module scheduled to be installed.";

            uses module-info-grp;

            leaf module-yang {
                type string;
                mandatory true;
                description
                    "Content is the whole new YANG module.";
            }

            leaf data {
                type string;
                description
                    "Initial startup and running data to be set for the module, in JSON format.";
            }
        }
    }
}