-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathsonic-telemetry_client.yang
More file actions
145 lines (120 loc) · 4.24 KB
/
sonic-telemetry_client.yang
File metadata and controls
145 lines (120 loc) · 4.24 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
module sonic-telemetry_client {
yang-version 1.1;
namespace "http://github.com/sonic-net/sonic-telemetry_client";
prefix telemetry_client;
import ietf-inet-types {
prefix inet;
}
organization
"SONiC";
contact
"SONiC";
description
"TELEMETRY_CLIENT yang Module for SONiC OS";
revision 2023-01-12 {
description
"First revision";
}
typedef report-type {
description "Subscription reporting mode for dial-out telemetry.";
type enumeration {
enum periodic;
enum stream;
enum once;
}
}
typedef path_target {
description "SONiC database target for telemetry subscriptions.";
type enumeration {
enum APPL_DB;
enum CONFIG_DB;
enum COUNTERS_DB;
enum STATE_DB;
enum OTHERS;
}
}
typedef encoding {
description "Wire encoding format for telemetry data.";
type enumeration {
enum JSON_IETF;
enum ASCII;
enum BYTES;
enum PROTO;
}
}
typedef ipv4-port {
description "One or more IPv4 address and port pairs in host:port format, comma-separated.";
type string {
pattern
'((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+ '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]):'
+ '([0-9]|[1-9]\d{1,3}|[1-5]\d{1,4}|6[0-4]\d{1,3}|65[0-4]\d{1,2}|655[0-2][0-9]|6553[0-5]),?)+';
}
}
container sonic-telemetry_client{
container TELEMETRY_CLIENT {
description "Telemetry dial-out client configuration.";
container Global {
description "Global settings for the telemetry dial-out client.";
leaf retry_interval {
type uint64;
description "retry_interval unit s";
}
leaf src_ip {
type inet:ip-address;
description "Source IP address for dial-out connections.";
}
leaf encoding {
type encoding;
description "Data encoding format for telemetry messages.";
}
leaf unidirectional {
type boolean;
default true;
description "Whether the dial-out connection is unidirectional.";
}
}
list TELEMETRY_CLIENT_LIST {
description "Subscription and destination group entries for dial-out telemetry.";
ordered-by user;
key "prefix name";
leaf prefix {
type string {
pattern 'Subscription|DestinationGroup';
}
description "Entry type: Subscription or DestinationGroup.";
}
leaf name {
type string;
description "Name of this subscription or destination group.";
}
leaf dst_addr {
type ipv4-port;
description "Collector address and port in host:port format.";
}
leaf dst_group {
must "(contains(../../TELEMETRY_CLIENT_LIST/name, current()))";
type string;
description "Destination group name this subscription sends data to.";
}
leaf path_target {
type path_target;
description "Target database to subscribe to.";
}
leaf paths {
type string;
description "Comma-separated data paths to subscribe to within the target database.";
}
leaf report_interval {
type uint64;
description "report_interval unit ms";
default 5000;
}
leaf report_type {
type report-type;
description "Reporting mode for this subscription.";
}
}
}
}
}