File: sysrepo-monitoring.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 (222 lines) | stat: -rw-r--r-- 5,976 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
module sysrepo-monitoring {
    namespace "http://www.sysrepo.org/yang/sysrepo-monitoring";
    prefix srm;

    yang-version 1.1;

    import ietf-yang-types {
        prefix yang;
    }

    import ietf-datastores {
        prefix ds;
    }

    organization
        "CESNET";

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

    description
        "Sysrepo YANG datastore monitoring state information.";

    revision "2020-04-17" {
        description
            "Initial revision.";
    }

    typedef lock-mode {
        description
            "Mode of lock held.";
        type enumeration {
            enum read {
                description
                    "Read lock.";
            }
            enum write {
                description
                    "Write lock.";
            }
        }
    }

    typedef module-ref {
        description
            "Module reference.";
        type leafref {
            path "/sysrepo-state/module/name";
        }
    }

    typedef conn-ref {
        description
            "Connection reference.";
        type leafref {
            path "/sysrepo-state/connection/pid";
        }
    }

    container sysrepo-state {
        config false;
        description
            "Information about Sysrepo state stored in the shared memory.";

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

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

            container subscriptions {
                description
                    "Module subscriptions.";

                list change-sub {
                    description
                        "Data change subscription.";

                    leaf datastore {
                        mandatory true;
                        type identityref {
                            base ds:datastore;
                        }
                        description
                            "Datastore, whose data changes were subscribed for.";
                    }

                    leaf xpath {
                        type yang:xpath1.0;
                        description
                            "XPath filtering the data subscribed for.";
                    }

                    leaf priority {
                        mandatory true;
                        type uint32;
                        description
                            "Subscription priority.";
                    }

                    leaf pid {
                        mandatory true;
                        type conn-ref;
                        description
                            "PID of the connection that this subscription belongs to.";
                    }
                }

                list operational-sub {
                    key "xpath";
                    description
                        "Operational subscription.";

                    leaf xpath {
                        type yang:xpath1.0;
                        description
                            "Operational data pull subscription XPath.";
                    }

                    leaf pid {
                        mandatory true;
                        type conn-ref;
                        description
                            "PID of the connection that this subscription belongs to.";
                    }
                }

                leaf-list notification-sub {
                    type conn-ref;
                    description
                        "PID of the connection that this subscription belongs to.";
                }
            }
        }

        list rpc {
            key "path";
            description
                "RPC/action of a Sysrepo module.";

            leaf path {
                type yang:xpath1.0;
                description
                    "Path identifying an RPC or action.";
            }

            list rpc-sub {
                leaf xpath {
                    mandatory true;
                    type yang:xpath1.0;
                    description
                        "XPath filtering the RPCs/actions subscribed for.";
                }

                leaf priority {
                    mandatory true;
                    type uint32;
                    description
                        "Subscription priority.";
                }

                leaf pid {
                    mandatory true;
                    type conn-ref;
                    description
                        "PID of the connection that this subscription belongs to.";
                }
            }
        }

        list connection {
            key "pid";
            description
                "Created Sysrepo connection.";

            leaf pid {
                type uint32;
                description
                    "PID of the process that created this connection.";
            }

            leaf main-lock {
                type lock-mode;
                description
                    "Held main lock mode.";
            }

            list module-lock {
                key "name datastore";
                description
                    "Held module data lock.";

                leaf name {
                    type module-ref;
                    description
                        "Name of the locked module of the data.";
                }

                leaf datastore {
                    type identityref {
                        base ds:datastore;
                    }
                    description
                        "Datastore of the locked module data.";
                }

                leaf lock {
                    mandatory true;
                    type lock-mode;
                    description
                        "Module data lock mode.";
                }
            }
        }
    }
}