-
Notifications
You must be signed in to change notification settings - Fork 0
305 lines (250 loc) · 6.97 KB
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
module czechlight-system {
yang-version 1.1;
namespace
"http://czechlight.cesnet.cz/yang/czechlight-system";
prefix "cla-sys";
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix yang;
}
import ietf-netconf-acm {
prefix nacm;
}
import ietf-system {
prefix "sys";
}
organization "CESNET";
contact "[email protected]";
description
"YANG model for system administration in Czechlight devices.";
revision 2021-01-13 {
description "Initial release";
}
revision 2022-07-08 {
description "Extended firmware slot properties and actions";
}
typedef percent {
type uint8 {
range "0 .. 100";
}
}
container firmware {
config false;
list firmware-slot {
key name;
leaf name {
description "Identifier of the slot.";
type string;
}
leaf version {
description "Firmware version installed in the slot.";
type string;
}
leaf installed {
description "Datetime of the last installation performed in this slot.";
type yang:date-and-time;
}
leaf is-booted-now {
description "Is the system running from this slot?";
type boolean;
}
leaf is-healthy {
description "Only healthy slots are considered for booting. Slots which failed during a boot are marked as non-healthy.";
type boolean;
}
leaf will-boot-next {
description "Is this slot selected for booting after the next reboot?";
type boolean;
}
action set-active-after-reboot {
description "Schedule this slot for activation after the next reboot";
}
action set-unhealthy {
description "Mark this slot as having faulted during the last boot";
}
}
container installation {
leaf status {
description "Informs about the status of the current (or last) installation.";
type enumeration {
enum none;
enum in-progress;
enum succeeded;
enum failed;
}
}
leaf message {
description "The last message from the installation process. This MAY contain the last error message.";
type string;
}
notification update {
description "Notifies clients about installation progress.";
leaf message {
description "Progress status.";
type string;
}
leaf progress {
description "Progress of the installation in percents.";
type int8 {
range "0 .. 100";
}
}
}
action install {
nacm:default-deny-all;
description "Download and install a new firmware image to the inactive FW slot";
input {
leaf url {
description "URL or path to the new firmware.";
type string;
mandatory true;
}
}
}
}
}
typedef username-type {
type string {
pattern "[a-z][a-z0-9-]{0,30}";
}
}
typedef password-type {
type string {
pattern "[^\\r\\n]*";
}
}
grouping authentication-rpc-result {
leaf result {
mandatory true;
type enumeration {
enum success;
enum failure;
}
}
leaf message {
description "Can be used to supply and error message.";
type string;
}
}
typedef authorized-key-format {
description "Pubkey in the authorized_keys format for sshd.";
type string;
}
container authentication {
description "User management";
list users {
config false;
key 'name';
description "All user accounts which are configured in the Linux system";
leaf name {
type username-type;
}
leaf password-last-change {
nacm:default-deny-all;
type string;
}
list authorized-keys {
nacm:default-deny-all;
key 'index';
description "List of SSH keys which are recognized for this user";
leaf index {
type int32;
}
leaf public-key {
mandatory true;
type authorized-key-format;
}
action remove {
description "Remove the selected SSH authentication key of the selected user";
output {
uses authentication-rpc-result;
}
}
}
action change-password {
nacm:default-deny-all;
input {
leaf password-cleartext {
mandatory true;
description "This is supposed to be a plaintext password. Make sure it's not logged anywhere.";
type password-type;
}
}
output {
uses authentication-rpc-result;
}
}
action add-authorized-key {
nacm:default-deny-all;
description "Add a new SSH public key for authentication as the selected user";
input {
leaf key {
mandatory true;
type authorized-key-format;
}
}
output {
uses authentication-rpc-result;
}
}
}
}
container leds {
config false;
description "Current status of LEDs.";
list led {
key 'name';
leaf name {
type string;
description "Name of the LED";
}
leaf brightness {
mandatory true;
description "Current brightness of the LED in percents of the maximal possible brightness of the LED.";
type percent;
}
}
action uid {
input {
leaf state {
mandatory true;
description "Change state of the UID led (turn off, on, or keep blinking).";
type enumeration {
enum off;
enum on;
enum blinking;
}
}
}
}
}
container journal-upload {
presence "Enable systemd-journal-upload service";
description "Configures systemd-journal-upload.service. If the container is present,
then systemd-journal-upload service is set up with the URL composed of
the leafs in this container. See --url in
https://www.freedesktop.org/software/systemd/man/252/systemd-journal-upload.service.html";
leaf protocol {
type enumeration {
enum "http";
enum "https";
}
default "https";
description "Sets the URL protocol. See --url in https://www.freedesktop.org/software/systemd/man/252/systemd-journal-upload.service.html";
}
leaf host {
mandatory true;
type inet:host;
description "Sets the host. See --url in https://www.freedesktop.org/software/systemd/man/252/systemd-journal-upload.service.html";
}
leaf port {
type inet:port-number;
default "19532";
description "Sets the port. See --url in https://www.freedesktop.org/software/systemd/man/252/systemd-journal-upload.service.html";
}
}
deviation /sys:system-shutdown { deviate not-supported; }
deviation /sys:system/sys:dns-resolver { deviate add { config false; } }
}