blob: d993781e8d1ed5991f44a1c2ac4f1ad6504e3422 [file] [log] [blame]
Václav Kubernát73109382018-09-14 19:52:03 +02001module example-schema {
2 prefix aha;
3 namespace "http://example.com";
4
Václav Kubernát134d78f2019-09-03 16:42:29 +02005 leaf leafUInt8 {
6 type uint8;
7 }
8
9 leaf leafUInt16 {
10 type uint16;
11 }
12
13 leaf leafUInt32 {
14 type uint32;
15 }
16
17 leaf leafUInt64 {
18 type uint64;
19 }
20
21 leaf leafInt8 {
22 type int8;
23 }
24
25 leaf leafInt16 {
26 type int16;
27 }
28
29 leaf leafInt32 {
Václav Kubernát73109382018-09-14 19:52:03 +020030 type int32;
31 }
32
Václav Kubernát134d78f2019-09-03 16:42:29 +020033 leaf leafInt64 {
34 type int64;
35 }
36
Václav Kubernát73109382018-09-14 19:52:03 +020037 leaf leafString {
38 type string;
39 }
40
41 leaf leafEnum {
42 type enumeration {
43 enum lol;
44 enum data;
45 enum coze;
46 }
47 }
48
49 leaf leafDecimal {
50 type decimal64 {
51 fraction-digits 9;
52 }
53 }
54
55 container pContainer {
56 presence true;
57 }
58
Václav Kubernát45f4a822019-05-29 21:10:50 +020059 list person {
60 key 'name';
61 leaf name {
62 type string;
63 }
64 }
65
Václav Kubernát3efb5ca2019-10-09 20:07:40 +020066 leaf bossPerson {
67 type leafref {
68 path '../aha:person/name';
69 }
70 }
71
Václav Kubernát7d82da72019-04-11 15:16:38 +020072 grouping upAndDown {
73 leaf up {
74 type boolean;
75 }
76 leaf down {
77 type boolean;
78 }
79 }
80
81 uses upAndDown;
82
83 container lol {
84 uses upAndDown;
85 }
Jan Kundrát6ee84792020-01-24 01:43:36 +010086
87 grouping targets_def {
88 list targets {
89 key 'city';
90 leaf city {
91 type string;
92 }
93 }
94 }
95
96 rpc launch-nukes {
97 input {
98 container payload {
99 leaf kilotons {
100 type uint64;
101 mandatory true;
102 units "kilotons";
103 }
104 }
105 leaf description {
106 type string;
107 }
108 container cities {
109 presence true;
110 uses targets_def;
111 }
112 }
113 output {
114 leaf blast-radius {
115 type uint32;
116 units "m";
117 }
118 leaf actual-yield {
119 type uint64;
120 units "kilotons";
121 }
122 container damaged-places {
123 presence true;
124 uses targets_def;
125 }
126 }
127 }
128
129 rpc noop {}
Václav Kubernát73109382018-09-14 19:52:03 +0200130}