-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
sonic-device_metadata.yang
289 lines (237 loc) · 10.4 KB
/
sonic-device_metadata.yang
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
module sonic-device_metadata {
yang-version 1.1;
namespace "http://github.com/sonic-net/sonic-device_metadata";
prefix device_metadata;
import ietf-yang-types {
prefix yang;
}
import ietf-inet-types {
prefix inet;
}
import sonic-types {
prefix stypes;
}
description "DEVICE_METADATA YANG Module for SONiC OS";
revision 2021-02-27 {
description "Added frr_mgmt_framework_config field to handle BGP
config DB schema events to configure FRR protocols.";
}
revision 2020-04-10 {
description "First Revision";
}
container sonic-device_metadata {
container DEVICE_METADATA {
description "DEVICE_METADATA part of config_db.json";
container localhost{
leaf hwsku {
type stypes:hwsku;
}
leaf asic_id {
type string {
length 1..16;
}
description "asic_id is unique identifier of the asic used by SAI for initialization.";
}
leaf default_bgp_status {
type enumeration {
enum up;
enum down;
}
default up;
}
leaf docker_routing_config_mode {
description "This leaf allows different configuration modes for FRR:
- separated: FRR config generated from ConfigDB, each FRR daemon has its own config file
- unified: FRR config generated from ConfigDB, single FRR config file
- split: FRR config not generated from ConfigDB, each FRR daemon has its own config file
- split-unified: FRR config not generated from ConfigDB, single FRR config file";
type string {
pattern "separated|unified|split|split-unified";
}
default "unified";
}
leaf hostname {
type stypes:hostname;
}
leaf platform {
type string {
length 1..255;
}
}
leaf mac {
type yang:mac-address;
}
leaf default_pfcwd_status {
type enumeration {
enum disable;
enum enable;
}
default disable;
}
leaf bgp_asn {
type inet:as-number;
}
leaf deployment_id {
type uint32;
}
leaf type {
type string {
length 1..255;
pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|BmcMgmtToRRouter|SonicHost|not-provisioned";
}
}
leaf buffer_model {
description "This leaf is added for dynamic buffer calculation.
The dynamic model represents the model in which the buffer configurations,
like the headroom sizes and buffer pool sizes, are dynamically calculated based
on the ports' speed, cable length, and MTU. This model is used by Mellanox so far.
The traditional model represents the model in which all the buffer configurations
are statically configured in CONFIG_DB tables. This is the default model used by all other vendors";
type string {
pattern "dynamic|traditional";
}
}
leaf frr_mgmt_framework_config {
type boolean;
description "FRR configurations are handled by sonic-frr-mgmt-framework module when set to true,
otherwise, sonic-bgpcfgd handles the FRR configurations based on the predefined templates.";
default "false";
}
leaf synchronous_mode {
type enumeration {
enum enable;
enum disable;
}
default enable;
}
leaf yang_config_validation {
type stypes:mode-status;
default disable;
}
leaf cloudtype {
type string;
}
leaf region {
type string;
}
leaf sub_role {
type string;
description "sub_role indicates if ASIC is FrontEnd or BackEnd.";
}
leaf downstream_subrole {
type string;
}
leaf resource_type {
type string;
}
leaf cluster {
type string;
description "The switch is a member of this cluster.";
}
leaf subtype {
type string {
pattern "DualToR|SmartSwitch|Supervisor|UpstreamLC|DownstreamLC";
}
}
leaf peer_switch {
type stypes:hostname;
}
leaf storage_device {
type boolean;
}
leaf asic_name {
type string;
description "On a VoQ switch, the ASIC Name is used as a qualifier in global
database keys to create a system wide unique key.";
}
leaf switch_id {
type uint16;
description "Vendor specific switch ID. Identifies switch chip.";
}
leaf switch_type {
type string {
pattern "chassis-packet|fabric|npu|voq|dpu";
}
description "Type of switch. Default is NPU, on a VOQ switch voq is used for a regular
switching device while fabric is used for a fabric device.
chassis-packet is used for chassis in packet mode.";
}
leaf max_cores {
type uint8;
description "Maximum number of cores in a VoQ Switch (chassis).";
}
leaf dhcp_server {
type stypes:admin_mode;
description "Indicate whether enable the embedded DHCP server.";
}
leaf bgp_adv_lo_prefix_as_128 {
type boolean;
description "Advertise Loopback0 interface IPv6 /128 subnet address as it is with set to true.
By default SONiC advertises /128 subnet prefix in Loopback0 as /64 subnet route";
}
leaf suppress-fib-pending {
description "Enable BGP suppress FIB pending feature. BGP will wait for route FIB installation before announcing routes";
type enumeration {
enum enabled;
enum disabled;
}
default disabled;
must "((current() = 'disabled') or (current() = 'enabled' and ../synchronous_mode = 'enable'))" {
error-message "ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature";
}
}
leaf rack_mgmt_map {
type string {
length 0..128 {
error-message "Invalid length for the rack mgmt map.";
}
}
description "Information of rack mgmt map.";
}
leaf timezone {
type stypes:timezone-name-type {
length 1..255;
}
default "UTC";
description "The TZ database name to use for the system, such as 'Europe/Stockholm'.";
reference "IANA Time Zone Database http://www.iana.org/time-zones";
}
leaf create_only_config_db_buffers {
type boolean;
description "If this attribute exists and is equal to true - the buffers will be created
according to the config_db configuration (for example BUFFER_QUEUE|* table),
otherwise the maximum available buffers (which are read from SAI) will be
created, regardless of the CONFIG_DB buffers configuration.";
}
leaf-list supporting_bulk_counter_groups {
type string;
description "This field contains a list of counter groups that support bulk operation.";
}
leaf bgp_router_id {
type inet:ipv4-address;
description "BGP Router identifier";
}
leaf chassis_hostname {
description "hostname of the chassis to which this linecard or supervisor belongs to";
type stypes:hostname;
}
leaf slice_type {
description "Metadata tag for the device.";
type string;
}
leaf nexthop_group {
description "Enable or disable Nexthop Group feature. This value only takes effect during boot time.";
type enumeration {
enum enabled;
enum disabled;
}
default disabled;
}
}
/* end of container localhost */
}
/* end of container DEVICE_METADATA */
}
/* end of top level container */
}
/* end of module sonic-device_metadata */