-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
dataflowEndpoints.tsp
413 lines (311 loc) · 11.6 KB
/
dataflowEndpoints.tsp
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
import "@typespec/http";
import "@typespec/rest";
import "@azure-tools/typespec-azure-resource-manager";
using TypeSpec.Http;
using TypeSpec.Rest;
using OpenAPI;
using Azure.ResourceManager;
namespace Microsoft.IoTOperations;
/** ******************* */
/**
* dataflowEndpoint resource type model details.
*/
@doc("Instance dataflowEndpoint resource")
@parentResource(InstanceResource)
model DataflowEndpointResource is ProxyResource<DataflowEndpointProperties> {
@doc("Name of Instance dataflowEndpoint resource")
@pattern("^[a-z0-9][a-z0-9-]*[a-z0-9]$")
@key("dataflowEndpointName")
@path
@minLength(3)
@maxLength(63)
@segment("dataflowEndpoints")
name: string;
// Extended location is not included in ProxyResource yet
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
@doc("Edge location of the resource.")
@visibility("read", "create")
extendedLocation: ExtendedLocation;
}
@doc("DataflowEndpoint Resource properties. NOTE - Only one type of endpoint is supported for one Resource")
model DataflowEndpointProperties {
@doc("Endpoint Type.")
endpointType: EndpointType;
@doc("Azure Data Explorer endpoint.")
dataExplorerSettings?: DataflowEndpointDataExplorer;
@doc("Azure Data Lake endpoint.")
dataLakeStorageSettings?: DataflowEndpointDataLakeStorage;
@doc("Microsoft Fabric endpoint.")
fabricOneLakeSettings?: DataflowEndpointFabricOneLake;
@doc("Kafka endpoint.")
kafkaSettings?: DataflowEndpointKafka;
@doc("Local persistent volume endpoint.")
localStorageSettings?: DataflowEndpointLocalStorage;
@doc("Broker endpoint.")
mqttSettings?: DataflowEndpointMqtt;
@visibility("read")
@doc("The status of the last operation.")
provisioningState?: ProvisioningState;
}
@doc("DataflowEndpoint Type properties")
union EndpointType {
string,
@doc("Azure Data Explorer Type")
DataExplorer: "DataExplorer",
@doc("Azure Data Lake Type")
DataLakeStorage: "DataLakeStorage",
@doc("Microsoft Fabric Type")
FabricOneLake: "FabricOneLake",
@doc("Kafka Type")
Kafka: "Kafka",
@doc("Local Storage Type")
LocalStorage: "LocalStorage",
@doc("Broker Type")
Mqtt: "Mqtt",
}
@doc("Azure Data Explorer endpoint properties")
model DataflowEndpointDataExplorer {
@doc("Authentication configuration. NOTE - only authentication property is allowed per entry.")
authentication: DataflowEndpointDataExplorerAuthentication;
@doc("Database name.")
database: string;
@doc("Host of the Azure Data Explorer in the form of <cluster>.<region>.kusto.windows.net .")
@pattern(".+\\..+\\.kusto\\.windows\\.net")
host: string;
@doc("Azure Data Explorer endpoint batching configuration.")
batching?: BatchingConfiguration;
}
@doc("Azure Data Explorer Authentication properties. NOTE - only authentication property is allowed per entry.")
model DataflowEndpointDataExplorerAuthentication {
@doc("Mode of Authentication.")
method: DataExplorerAuthMethod;
...ManagedIdentity;
}
@doc("DataflowEndpoint Data Explorer Authentication Method properties")
union DataExplorerAuthMethod {
ManagedIdentityMethod,
}
@doc("Azure Data Lake endpoint properties")
model DataflowEndpointDataLakeStorage {
@doc("Authentication configuration. NOTE - only authentication property is allowed per entry.")
authentication: DataflowEndpointDataLakeStorageAuthentication;
@doc("Host of the Azure Data Lake in the form of <account>.blob.core.windows.net .")
@pattern(".+\\.blob\\.core\\.windows\\.net")
host: string;
@doc("Azure Data Lake endpoint batching configuration.")
batching?: BatchingConfiguration;
}
@doc("Azure Data Lake endpoint Authentication properties. NOTE Enum - Only one method is supported for one entry")
model DataflowEndpointDataLakeStorageAuthentication {
@doc("Mode of Authentication.")
method: DataLakeStorageAuthMethod;
// What is accessTokenSecretName now?
@doc("SAS token authentication.")
accessTokenSettings?: DataflowEndpointAuthenticationAccessToken;
...ManagedIdentity;
}
#suppress "@azure-tools/typespec-autorest/union-unsupported"
@doc("DataflowEndpoint Data Lake Storage Authentication Method properties")
union DataLakeStorageAuthMethod {
ManagedIdentityMethod,
AccessTokenMethod,
}
@doc("Microsoft Fabric endpoint properties")
model DataflowEndpointFabricOneLake {
@doc("Authentication configuration. NOTE - only one authentication property is allowed per entry.")
authentication: DataflowEndpointFabricOneLakeAuthentication;
@doc("Names of the workspace and lakehouse.")
names: DataflowEndpointFabricOneLakeNames;
@doc("Type of location of the data in the workspace. Can be either tables or files.")
oneLakePathType: DataflowEndpointFabricPathType;
@doc("Host of the Microsoft Fabric in the form of https://<host>.fabric.microsoft.com.")
@pattern(".+\\.fabric\\.microsoft\\.com")
host: string;
@doc("Batching configuration.")
batching?: BatchingConfiguration;
}
@doc("Microsoft Fabric endpoint. Authentication properties. NOTE - Only one method is supported for one entry")
model DataflowEndpointFabricOneLakeAuthentication {
@doc("Mode of Authentication.")
method: FabricOneLakeAuthMethod;
...ManagedIdentity;
}
#suppress "@azure-tools/typespec-autorest/union-unsupported"
@doc("DataflowEndpoint Fabric One Lake Authentication Method properties")
union FabricOneLakeAuthMethod {
ManagedIdentityMethod,
}
@doc("Microsoft Fabric endpoint Names properties")
model DataflowEndpointFabricOneLakeNames {
@doc("Lakehouse name.")
lakehouseName: string;
@doc("Workspace name.")
workspaceName: string;
}
@doc("DataflowEndpoint Fabric Path Type properties")
union DataflowEndpointFabricPathType {
string,
@doc("FILES Type")
Files: "Files",
@doc("TABLES Type")
Tables: "Tables",
}
@doc("Kafka endpoint properties")
model DataflowEndpointKafka {
@doc("Authentication configuration. NOTE - only authentication property is allowed per entry.")
authentication: DataflowEndpointKafkaAuthentication;
@doc("Consumer group ID.")
consumerGroupId?: string;
@doc("Kafka endpoint host.")
host?: string;
@doc("Batching configuration.")
batching?: DataflowEndpointKafkaBatching;
@doc("Copy Broker properties. No effect if the endpoint is used as a source or if the dataflow doesn't have an Broker source.")
copyMqttProperties?: OperationalMode = OperationalMode.Enabled;
@doc("Compression. Can be none, gzip, lz4, or snappy. No effect if the endpoint is used as a source.")
compression?: DataflowEndpointKafkaCompression = DataflowEndpointKafkaCompression.None;
@doc("Kafka acks. Can be all, one, or zero. No effect if the endpoint is used as a source.")
kafkaAcks?: DataflowEndpointKafkaAcks = DataflowEndpointKafkaAcks.All;
@doc("Partition handling strategy. Can be default or static. No effect if the endpoint is used as a source.")
partitionStrategy?: DataflowEndpointKafkaPartitionStrategy = DataflowEndpointKafkaPartitionStrategy.Default;
@doc("TLS configuration.")
tls?: TlsProperties = #{ mode: OperationalMode.Enabled };
@doc("Cloud event mapping config.")
cloudEventAttributes?: CloudEventAttributeType;
}
@doc("Kafka endpoint Authentication properties. NOTE - only authentication property is allowed per entry")
model DataflowEndpointKafkaAuthentication {
@doc("Mode of Authentication.")
method: KafkaAuthMethod;
...ManagedIdentity;
@doc("SASL authentication.")
saslSettings?: DataflowEndpointAuthenticationSasl;
@doc("X.509 certificate authentication.")
x509CertificateSettings?: DataflowEndpointAuthenticationX509;
}
@doc("DataflowEndpoint Kafka Authentication Method properties")
union KafkaAuthMethod {
ManagedIdentityMethod,
SaslMethod,
x509CertificateMethod,
AnonymousMethod,
}
@doc("Kafka endpoint Batching properties")
model DataflowEndpointKafkaBatching {
@doc("Mode for batching.")
mode?: OperationalMode = OperationalMode.Enabled;
@doc("Batching latency in milliseconds.")
@minValue(0)
@maxValue(65535)
latencyMs?: int32 = 5;
@doc("Maximum number of bytes in a batch.")
@minValue(0)
@maxValue(4294967295)
maxBytes?: int32 = 1000000;
@doc("Maximum number of messages in a batch.")
@minValue(0)
@maxValue(4294967295)
maxMessages?: int32 = 100000;
}
@doc("Kafka endpoint Compression properties")
union DataflowEndpointKafkaCompression {
string,
@doc("NONE Option")
None: "None",
@doc("Gzip Option")
Gzip: "Gzip",
@doc("SNAPPY Option")
Snappy: "Snappy",
@doc("LZ4 Option")
Lz4: "Lz4",
}
@doc("DataflowEndpoint Kafka Acks properties")
union DataflowEndpointKafkaAcks {
string,
@doc("ZERO Option")
Zero: "Zero",
@doc("ONE Option")
One: "One",
@doc("ALL Option")
All: "All",
}
@doc("DataflowEndpoint Kafka Partition Strategy properties")
union DataflowEndpointKafkaPartitionStrategy {
string,
@doc("Default: Assigns messages to random partitions, using a round-robin algorithm.")
Default: "Default",
@doc("Static: Assigns messages to a fixed partition number that's derived from the instance ID of the dataflow.")
Static: "Static",
@doc("TOPIC Option")
Topic: "Topic",
@doc("PROPERTY Option")
Property: "Property",
}
@doc("Local persistent volume endpoint properties")
model DataflowEndpointLocalStorage {
@doc("Persistent volume claim name.")
persistentVolumeClaimRef: string;
}
@doc("Broker endpoint properties")
model DataflowEndpointMqtt {
@doc("authentication properties. DEFAULT: kubernetes.audience=aio-mq-internal. NOTE - Enum field only property is allowed")
authentication: DataflowEndpointMqttAuthentication;
@doc("Client ID prefix. Client ID generated by the dataflow is <prefix>-TBD. Optional; no prefix if omitted.")
clientIdPrefix?: string;
@doc("Host of the Broker in the form of <hostname>:<port>. Optional; connects to Broker if omitted.")
host?: string = "aio-mq-dmqtt-frontend:8883";
@doc("Enable or disable websockets.")
protocol?: BrokerProtocolType = BrokerProtocolType.Mqtt;
@doc("Broker KeepAlive for connection in seconds.")
@minValue(0)
keepAliveSeconds?: int32 = 60;
@doc("Whether or not to keep the retain setting.")
retain?: MqttRetainType = MqttRetainType.Keep;
@doc("The max number of messages to keep in flight. For subscribe, this is the receive maximum. For publish, this is the maximum number of messages to send before waiting for an ack.")
@minValue(0)
maxInflightMessages?: int32 = 100;
@doc("Qos for Broker connection.")
@minValue(0)
@maxValue(2)
qos?: int32 = 1;
@doc("Session expiry in seconds.")
@minValue(0)
sessionExpirySeconds?: int32 = 3600;
@doc("TLS configuration.")
tls?: TlsProperties = #{ mode: OperationalMode.Enabled };
@doc("Cloud event mapping config.")
cloudEventAttributes?: CloudEventAttributeType;
}
@doc("Mqtt endpoint Authentication properties. NOTE - only authentication property is allowed per entry.")
model DataflowEndpointMqttAuthentication {
@doc("Mode of Authentication.")
method: MqttAuthMethod;
...ManagedIdentity;
@doc("Kubernetes service account token authentication. Default audience if not set is aio-mq-internal")
serviceAccountTokenSettings?: DataflowEndpointAuthenticationServiceAccountToken;
@doc("X.509 certificate authentication.")
x509CertificateSettings?: DataflowEndpointAuthenticationX509;
}
@doc("DataflowEndpoint Mqtt Authentication Method properties")
union MqttAuthMethod {
ManagedIdentityMethod,
SaslMethod,
x509CertificateMethod,
AnonymousMethod,
}
@doc("Broker Retain types")
union MqttRetainType {
string,
@doc("Retain the messages.")
Keep: "Keep",
@doc("Never retain messages.")
Never: "Never",
}
@doc("How to map events to the cloud.")
union CloudEventAttributeType {
string,
@doc("Propagate type")
Propagate: "Propagate",
@doc("CreateOrRemap type")
CreateOrRemap: "CreateOrRemap",
}