Skip to content

Commit

Permalink
[Microsoft.LoadTestService] Improvements to Load Test Service DataPla…
Browse files Browse the repository at this point in the history
…ne Specs for better SDK Generation (#32249)

* Make the query parameters as csv parameters

* Fixing the x-ms-pageable issue

* Prettier fix

* Using the recommended Typespec approach
  • Loading branch information
mitsha-microsoft authored Jan 24, 2025
1 parent e84c20e commit caaa779
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"minEndDateTime": "2024-05-01T16:00:46.072Z",
"maxEndDateTime": "2024-05-01T16:50:46.072Z",
"testProfileIds": "12345678-1234-1234-1234-123456789012",
"statuses": "ACCEPTED",
"statuses": "ACCEPTED,EXECUTING",
"api-version": "2024-05-01-preview"
},
"responses": {
Expand Down Expand Up @@ -38,14 +38,43 @@
}
}
},
"testRunDetails": {},
"createdDateTime": "2024-05-01T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2024-05-01T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com"
},
{
"testProfileRunId": "87654321-1234-1234-1234-122451189012",
"displayName": "Performance_TestProfile_Run1",
"description": "sample description",
"testProfileId": "12345678-1234-1234-1234-123456789012",
"status": "EXECUTING",
"startDateTime": "2024-05-01T16:43:46.072Z",
"endDateTime": "2024-05-01T16:43:46.072Z",
"durationInSeconds": 400,
"targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Web/sites/myfunctionapp",
"targetResourceConfigurations": {
"kind": "FunctionsFlexConsumption",
"configurations": {
"config1": {
"instanceMemoryMB": 2048,
"httpConcurrency": 16
},
"config2": {
"instanceMemoryMB": 4096,
"httpConcurrency": 16
}
}
},
"testRunDetails": {
"testRun1": {
"status": "DONE",
"configurationId": "config1",
"properties": {}
},
"testRun2": {
"status": "DONE",
"status": "EXECUTING",
"configurationId": "config2",
"properties": {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ model ListTestProfileQueryParams {
lastModifiedEndTime?: utcDateTime;

@doc("Comma separated list of IDs of the test profiles to filter.")
@query
testProfileIds?: string;
@query(#{ explode: false })
testProfileIds?: string[];

@doc("Comma separated list IDs of the tests which should be associated with the test profiles to fetch.")
@query
@query(#{ explode: false })
testIds?: string;
}

Expand Down Expand Up @@ -311,14 +311,14 @@ model ListTestProfileRunQueryParams {
createdDateEndTime?: utcDateTime;

@doc("Comma separated list of IDs of the test profile runs to filter.")
@query
testProfileRunIds?: string;
@query(#{ explode: false })
testProfileRunIds?: string[];

@doc("Comma separated IDs of the test profiles which should be associated with the test profile runs to fetch.")
@query
testProfileIds?: string;
@query(#{ explode: false })
testProfileIds?: string[];

@doc("Comma separated list of Statuses of the test profile runs to filter.")
@query
statuses?: string;
@query(#{ explode: false })
statuses?: string[];
}
4 changes: 4 additions & 0 deletions specification/loadtestservice/LoadTestService/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "@typespec/rest";
import "@typespec/http";
import "@azure-tools/typespec-azure-core";

using Azure.Core;
using TypeSpec.Rest;
using TypeSpec.Http;
using TypeSpec.Versioning;
Expand Down Expand Up @@ -1102,16 +1103,19 @@ model DimensionValue {
}

@doc("Metrics dimension values.")
@pagedResult
model DimensionValueList {
@doc("The dimension name")
@visibility("read")
@added(APIVersions.v2023_04_01_preview)
name?: string;

@doc("The dimension value")
@items
value?: string[];

@doc("Link for the next set of values in case of paginated results, if applicable.")
@nextLink
nextLink?: ResourceLocation<DimensionValueList>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@
"List the dimension values for the given metric dimension name.": {
"$ref": "./examples/ListMetricDimensionValues.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@
"List the dimension values for the given metric dimension name.": {
"$ref": "./examples/ListMetricDimensionValues.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"minEndDateTime": "2024-05-01T16:00:46.072Z",
"maxEndDateTime": "2024-05-01T16:50:46.072Z",
"testProfileIds": "12345678-1234-1234-1234-123456789012",
"statuses": "ACCEPTED",
"statuses": "ACCEPTED,EXECUTING",
"api-version": "2024-05-01-preview"
},
"responses": {
Expand Down Expand Up @@ -38,14 +38,43 @@
}
}
},
"testRunDetails": {},
"createdDateTime": "2024-05-01T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2024-05-01T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com"
},
{
"testProfileRunId": "87654321-1234-1234-1234-122451189012",
"displayName": "Performance_TestProfile_Run1",
"description": "sample description",
"testProfileId": "12345678-1234-1234-1234-123456789012",
"status": "EXECUTING",
"startDateTime": "2024-05-01T16:43:46.072Z",
"endDateTime": "2024-05-01T16:43:46.072Z",
"durationInSeconds": 400,
"targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Web/sites/myfunctionapp",
"targetResourceConfigurations": {
"kind": "FunctionsFlexConsumption",
"configurations": {
"config1": {
"instanceMemoryMB": 2048,
"httpConcurrency": 16
},
"config2": {
"instanceMemoryMB": 4096,
"httpConcurrency": 16
}
}
},
"testRunDetails": {
"testRun1": {
"status": "DONE",
"configurationId": "config1",
"properties": {}
},
"testRun2": {
"status": "DONE",
"status": "EXECUTING",
"configurationId": "config2",
"properties": {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,9 @@
"List the dimension values for the given metric dimension name.": {
"$ref": "./examples/ListMetricDimensionValues.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -5133,7 +5136,11 @@
"in": "query",
"description": "Comma separated list of IDs of the test profiles to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.createdDateEndTime": {
Expand Down Expand Up @@ -5204,23 +5211,35 @@
"in": "query",
"description": "Comma separated list of Statuses of the test profile runs to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.testProfileIds": {
"name": "testProfileIds",
"in": "query",
"description": "Comma separated IDs of the test profiles which should be associated with the test profile runs to fetch.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.testProfileRunIds": {
"name": "testProfileRunIds",
"in": "query",
"description": "Comma separated list of IDs of the test profile runs to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestQueryParams.lastModifiedEndTime": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,9 @@
"List the dimension values for the given metric dimension name.": {
"$ref": "./examples/ListMetricDimensionValues.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -6220,7 +6223,11 @@
"in": "query",
"description": "Comma separated list of IDs of the test profiles to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.createdDateEndTime": {
Expand Down Expand Up @@ -6291,23 +6298,35 @@
"in": "query",
"description": "Comma separated list of Statuses of the test profile runs to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.testProfileIds": {
"name": "testProfileIds",
"in": "query",
"description": "Comma separated IDs of the test profiles which should be associated with the test profile runs to fetch.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.testProfileRunIds": {
"name": "testProfileRunIds",
"in": "query",
"description": "Comma separated list of IDs of the test profile runs to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestQueryParams.lastModifiedEndTime": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,9 @@
"List the dimension values for the given metric dimension name.": {
"$ref": "./examples/ListMetricDimensionValues.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -6905,7 +6908,11 @@
"in": "query",
"description": "Comma separated list of IDs of the test profiles to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.createdDateEndTime": {
Expand Down Expand Up @@ -6976,23 +6983,35 @@
"in": "query",
"description": "Comma separated list of Statuses of the test profile runs to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.testProfileIds": {
"name": "testProfileIds",
"in": "query",
"description": "Comma separated IDs of the test profiles which should be associated with the test profile runs to fetch.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestProfileRunQueryParams.testProfileRunIds": {
"name": "testProfileRunIds",
"in": "query",
"description": "Comma separated list of IDs of the test profile runs to filter.",
"required": false,
"type": "string",
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"x-ms-parameter-location": "method"
},
"ListTestQueryParams.lastModifiedEndTime": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@
"List the dimension values for the given metric dimension name.": {
"$ref": "./examples/ListMetricDimensionValues.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
Expand Down

0 comments on commit caaa779

Please sign in to comment.