-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
routes.tsp
564 lines (508 loc) · 15 KB
/
routes.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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
import "@azure-tools/typespec-azure-core";
import "@typespec/rest";
import "./models.tsp";
using Azure.Core;
using Azure.Core.Traits;
using TypeSpec.Rest;
using TypeSpec.Http;
namespace AzureLoadTesting;
interface LoadTestAdministration {
@summary("Create a new test or update an existing test.")
@doc("Create a new test or update an existing test.")
@route("/tests/{testId}")
@patch
CreateOrUpdateTest is Azure.Core.Foundations.Operation<
{
@header contentType: "application/merge-patch+json",
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
@doc("Load test model")
@body
body: Test;
},
ResourceCreatedOrOkResponse<Test>
>;
@summary("Delete a test by its name.")
@doc("Delete a test by its name.")
@route("/tests/{testId}")
@delete
DeleteTest is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
},
void
>;
@summary("Get load test details by test name")
@doc("Get load test details by test name")
@route("/tests/{testId}")
@get
GetTest is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
},
Test
>;
@summary("""
Get all load tests by the fully qualified resource Id e.g
subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.
""")
@doc("""
Get all load tests by the fully qualified resource Id e.g
subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.
""")
@route("/tests")
@get
ListTests is Azure.Core.Foundations.Operation<
{
@doc("""
Sort on the supported fields in (field asc/desc) format. eg:
lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
""")
@query
orderby?: string;
@doc("""
Prefix based, case sensitive search on searchable fields - displayName,
createdBy. For example, to search for a test, with display name is Login Test,
the search parameter can be Login.
""")
@query
search?: string;
@doc("""
Start DateTime(ISO 8601 literal format) of the last updated time range to
filter tests.
""")
@query
lastModifiedStartTime?: offsetDateTime;
@doc("""
End DateTime(ISO 8601 literal format) of the last updated time range to filter
tests.
""")
@query
lastModifiedEndTime?: offsetDateTime;
@doc("Number of results in response.")
@query
maxpagesize?: int32;
},
TestsList
>;
@summary("""
Upload input file for a given test name. File size can't be more than 50 MB.
Existing file with same name for the given test will be overwritten. File
should be provided in the request body as application/octet-stream.
""")
@doc("""
Upload input file for a given test name. File size can't be more than 50 MB.
Existing file with same name for the given test will be overwritten. File
should be provided in the request body as application/octet-stream.
""")
@route("/tests/{testId}/files/{fileName}")
@put
UploadTestFile is Azure.Core.Foundations.Operation<
{
@header contentType: "application/octet-stream",
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
@doc("Unique name for test file with file extension like : App.jmx")
@path
fileName: string;
@doc("File type")
@query
fileType?: FileType;
@doc("The file content as application/octet-stream.")
@body
body: bytes;
},
ResourceCreatedResponse<FileInfo>
>;
@summary("Get test file by the file name.")
@doc("Get test file by the file name.")
@route("/tests/{testId}/files/{fileName}")
@get
GetTestFile is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
@doc("File name with file extension like app.jmx")
@path
fileName: string;
},
FileInfo
>;
@summary("Delete file by the file name for a test")
@doc("Delete file by the file name for a test")
@route("/tests/{testId}/files/{fileName}")
@delete
DeleteTestFile is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
@doc("File name with file extension like app.jmx")
@path
fileName: string;
},
void
>;
@summary("Get all test files.")
@doc("Get all test files.")
@route("/tests/{testId}/files")
@get
ListTestFiles is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
},
FileInfoList
>;
@summary("Associate an app component (collection of azure resources) to a test")
@doc("Associate an app component (collection of azure resources) to a test")
@route("/tests/{testId}/app-components")
@patch
CreateOrUpdateAppComponents is Azure.Core.Foundations.Operation<
{
@header contentType: "application/merge-patch+json",
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
@doc("App Component model.")
@body
body: TestAppComponents;
},
ResourceCreatedOrOkResponse<TestAppComponents>
>;
@summary("Get associated app component (collection of azure resources) for the given test.")
@doc("Get associated app component (collection of azure resources) for the given test.")
@route("/tests/{testId}/app-components")
@get
GetAppComponents is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
},
TestAppComponents
>;
@summary("Configure server metrics for a test")
@doc("Configure server metrics for a test")
@route("/tests/{testId}/server-metrics-config")
@patch
CreateOrUpdateServerMetricsConfig is Azure.Core.Foundations.Operation<
{
@header contentType: "application/merge-patch+json",
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
@doc("Server metric configuration model.")
@body
body: TestServerMetricConfig;
},
ResourceCreatedOrOkResponse<TestServerMetricConfig>
>;
@summary("List server metrics configuration for the given test.")
@doc("List server metrics configuration for the given test.")
@route("/tests/{testId}/server-metrics-config")
@get
GetServerMetricsConfig is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testId: string;
},
TestServerMetricConfig
>;
}
interface LoadTestRun {
@summary("Get test run details by name.")
@doc("Get test run details by name.")
@route("/test-runs/{testRunId}")
@get
GetTestRun is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
},
TestRun
>;
@summary("Create and start a new test run with the given name.")
@doc("Create and start a new test run with the given name.")
@pollingOperation(LoadTestRunOperations.GetTestRun)
CreateOrUpdateTestRun is LongRunningResourceCreateOrUpdate<TestRun>;
@summary("Delete a test run by its name.")
@doc("Delete a test run by its name.")
@route("/test-runs/{testRunId}")
@delete
DeleteTestRun is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
},
void
>;
@summary("Get test run file by file name.")
@doc("Get test run file by file name.")
@route("/test-runs/{testRunId}/files/{fileName}")
@get
GetTestRunFile is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
@doc("Test run file name with file extension")
@path
fileName: string;
},
FileInfo
>;
@summary("Get all test runs with given filters")
@doc("Get all test runs with given filters")
@route("/test-runs")
@get
ListTestRuns is Azure.Core.Foundations.Operation<
{
@doc("""
Sort on the supported fields in (field asc/desc) format. eg: executedDateTime
asc. Supported fields - executedDateTime
""")
@query
orderby?: string;
@doc("""
Prefix based, case sensitive search on searchable fields - description,
executedUser. For example, to search for a test run, with description 500 VUs,
the search parameter can be 500.
""")
@query
search?: string;
@doc("Unique name of an existing load test.")
@query
testId?: string;
@doc("Start DateTime(ISO 8601 literal format) of test-run execution time filter range.")
@query
executionFrom?: offsetDateTime;
@doc("End DateTime(ISO 8601 literal format) of test-run execution time filter range.")
@query
executionTo?: offsetDateTime;
@doc("Comma separated list of test run status.")
@query
status?: string;
@doc("Number of results in response.")
@query
maxpagesize?: int32;
},
TestRunsList
>;
@summary("Stop test run by name.")
@doc("Stop test run by name.")
@route("/test-runs/{testRunId}:stop")
@post
StopTestRun is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
},
TestRun
>;
@summary("List the metric namespaces for a load test run.")
@doc("List the metric namespaces for a load test run.")
@route("/test-runs/{testRunId}/metric-namespaces")
@get
ListMetricNamespaces is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
},
MetricNamespaceCollection
>;
@summary("List the metric definitions for a load test run.")
@doc("List the metric definitions for a load test run.")
@route("/test-runs/{testRunId}/metric-definitions")
@get
ListMetricDefinitions is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
@doc("Metric namespace to query metric definitions for.")
@query
metricNamespace?: string;
},
MetricDefinitionCollection
>;
@summary("List the metric values for a load test run.")
@doc("List the metric values for a load test run.")
@route("/test-runs/{testRunId}/metrics")
@post
ListMetrics is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
@doc("The aggregation")
@query
aggregation?: string;
@doc("The interval (i.e. timegrain) of the query.")
@query
interval?: Interval;
@doc("Metric name")
@query
metricName?: string;
@doc("Metric namespace to query metric definitions for.")
@query
metricNamespace?: string;
@doc("""
The timespan of the query. It is a string with the following format
'startDateTime_ISO/endDateTime_ISO'.
""")
@query
timespan?: string;
@doc("Metric dimension filter ")
@body
body: MetricRequestPayload;
},
Metrics
>;
// @summary("List the dimension values for the given metric dimension name.")
// @doc("List the dimension values for the given metric dimension name.")
// ListMetricDimensionValues is Azure.Core.ResourceList<
// DimensionValueList, QueryParametersTrait<MetricDimensions>
// >;
@summary("Associate an app component (collection of azure resources) to a test run")
@doc("Associate an app component (collection of azure resources) to a test run")
@route("/test-runs/{testRunId}/app-components")
@patch
CreateOrUpdateAppComponents is Azure.Core.Foundations.Operation<
{
@header contentType: "application/merge-patch+json",
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
@doc("App Component model.")
@body
body: TestRunAppComponents;
},
ResourceCreatedOrOkResponse<TestRunAppComponents>
>;
@summary("""
Get associated app component (collection of azure resources) for the given test
run.
""")
@doc("""
Get associated app component (collection of azure resources) for the given test
run.
""")
@route("/test-runs/{testRunId}/app-components")
@get
GetAppComponents is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
},
TestRunAppComponents
>;
@summary("Configure server metrics for a test run")
@doc("Configure server metrics for a test run")
@route("/test-runs/{testRunId}/server-metrics-config")
@patch
CreateOrUpdateServerMetricsConfig is Azure.Core.Foundations.Operation<
{
@header contentType: "application/merge-patch+json",
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
@doc("Server metric configuration model.")
@body
body: TestRunServerMetricConfig;
},
ResourceCreatedOrOkResponse<TestRunServerMetricConfig>
>;
@summary("List server metrics configuration for the given test run.")
@doc("List server metrics configuration for the given test run.")
@route("/test-runs/{testRunId}/server-metrics-config")
@get
GetServerMetricsConfig is Azure.Core.Foundations.Operation<
{
@doc("""
Unique name for the load test run, must contain only lower-case alphabetic,
numeric, underscore or hyphen characters.
""")
@path
testRunId: string;
},
TestRunServerMetricConfig
>;
};