Skip to content

Commit

Permalink
Feature/loadtesting v2023 04 01 preview/draft1 (#25569)
Browse files Browse the repository at this point in the history
* initial tsp

* client.tsp

* client.tsp improvements

* model updates

* update routes

* update implementation

* Sync typespec and swagger change for loadtesting service (#24412)

* Update the diff for put and patch operation

* Change LoadTestAdministrationOperations to LoadTestAdministration to align with the swagger LoadTestAdministration_ prefix

Change LoadTestRunOperations to LoadTestRun to align with the swagger LoadTestRun_ prefix

* update models

* add list metric dimensions op and fix create test run

* update client.tsp

* fix DimensionValueList and update TestRun model

* Configuration changes for LoadTesting (#24481)

* Update the projected name

* Renamed

* update config file

* update folder

* Remove client.tsp

* Update the projected name to old ones

* Adjust the positions

* Update client.tsp

* Update tspconfig.yaml

Added correct options for python emitter.

* Update the metadata

* Change the projectedName to client.tsp

* Remove the projectedName in routes.tsp

* update file

* Update the .Net config

* Remove the projectedName change for load testing

* Revert position change

* Update specification/loadtestservice/LoadTestService/tspconfig.yaml

---------

Co-authored-by: Ray Chen <raychen@microsoft.com>

* update routes to be more accurate

* update client.tsp for python

* python config to avoid breaking (#24801)

* python config

* Update client.tsp

* java, feature/loadtesting, match tsp and swagger (#24878)

* java config

* project for java

* metricNamespace is required

* aggregation is optional

* body is optional

* metricName and timespan is required

* Changes for 2023-04-01-preview version

* Minor refactoring

* Added URL based changes and versioning support (versioning not working)

* Versioning support changes

* Refactoring

* Refactoring

* config changes

* Added examples and few refactoring

* Adding emitters for pythin, ts and csharp

* Updated description for timespan field

* Update tspconfig as validation pipelines failing.

* Rename createOrUpdateTest.json to CreateOrUpdateTest.json

* Rename createOrUpdateTestRun.json to CreateOrUpdateTestRun.json

* Rename createOrUpdateTest.json to CreateOrUpdateTest.json

* Rename createOrUpdateTestRun.json to CreateOrUpdateTestRun.json

* suppress warning in client.tsp

* Updated examples for stable version

* Updated examples based on latest changes

* Updated spec for 2023-04-01-preview

* Added description for APIVersions model

* Updated readme and added examples

* removed tsp-output folder and files in it

* Updated service name in client

* Updated api version parameter

* Pushing updated json

* Removing unused example file

* suppressing warnings in client.tsp

* Changes to use standard templates for operations

* Changing create and update to generic template as it is changing to default resource parameter.

* Updating visibility of FileName

* Minor change in name

* changes in visibility of filename

* Change in model name of fileInfo

* Changing file info to testfileinfo

* Updated jsons

* Changes to rectify warning in pipeline

* changing metricName to metricname

* Updated examples to revert to metricname

* Ran tsp format and update example for metricname parameter

* Added query parameter for list test and testrun operation

* Updated description

* Enable linter rules

* Updated description of models and operations

* Updated specs after internal review of APIs

* Added ContainerInfo in 2023-04-01-preview

* Updated operation id for stop test run

* Updated operation id for stop test run

* Updated default values of properties

* Description changes for few properties and models

* Addressed errors in breaking change pipeline

* Removed unused models, refactored code, addressed PR comments

* nit: changes in client and model tsp

* spec after nit changes

* Changes suggested in API review

* Update specification/loadtestservice/LoadTestService/client.tsp

Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>

* Suggested changes in API review

* updating name and description for ContainerInfo

* Added publicIPDisabled property to Test and TestRun model in 2023-04-01-preview version

* Update properties in examples JSON files

* Linting changes

* Removed example tag and related imports

* Minor linting

* Merge main and changes after run npx command in local

---------

Co-authored-by: Catalina Peralta <catalinaperaltah@hotmail.com>
Co-authored-by: Mary Gao <yanmeigao1210@gmail.com>
Co-authored-by: Ray Chen <raychen@microsoft.com>
Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
Co-authored-by: Weidong Xu <weidxu@microsoft.com>
Co-authored-by: Mike Harder <mharder@microsoft.com>
Co-authored-by: Himanshu Bisht <hbisht@microsoft.com>
Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
  • Loading branch information
9 people authored Dec 22, 2023
1 parent 301696d commit f6278b3
Show file tree
Hide file tree
Showing 112 changed files with 14,713 additions and 1,883 deletions.
60 changes: 60 additions & 0 deletions specification/loadtestservice/LoadTestService/client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using TypeSpec.Versioning;
using Azure.ClientGenerator.Core;
using Microsoft.LoadTestService;

@useDependency(APIVersions.v2022_11_01)
@useDependency(APIVersions.v2023_04_01_preview)
namespace Customizations;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@client({
name: "LoadTestAdministrationClient",
service: Microsoft.LoadTestService,
})
interface AdministrationOperations {
createOrUpdateTest is LoadTestAdministration.createOrUpdateTest;
createOrUpdateAppComponents is LoadTestAdministration.createOrUpdateAppComponents;
createOrUpdateServerMetricsConfig is LoadTestAdministration.createOrUpdateServerMetricsConfig;
getAppComponents is LoadTestAdministration.getAppComponents;
getServerMetricsConfig is LoadTestAdministration.getServerMetricsConfig;
getTest is LoadTestAdministration.getTest;
getTestFile is LoadTestAdministration.getTestFile;
listTestFiles is LoadTestAdministration.listTestFiles;
listTests is LoadTestAdministration.listTests;
#suppress "@azure-tools/typespec-azure-core/byos" "It is limiting for users to have storage first before creating a load test also it will be breaking change for us."
@projectedName("python", "BeginUploadTestFile")
uploadTestFile is LoadTestAdministration.uploadTestFile;
deleteTestFile is LoadTestAdministration.deleteTestFile;
deleteTest is LoadTestAdministration.deleteTest;
}

#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@client({
name: "LoadTestRunClient",
service: Microsoft.LoadTestService,
})
interface TestRunOperations {
@projectedName("python", "BeginTestRun")
createOrUpdateTestRun is LoadTestRun.createOrUpdateTestRun;
createOrUpdateAppComponents is LoadTestRun.createOrUpdateAppComponents;
createOrUpdateServerMetricsConfig is LoadTestRun.createOrUpdateServerMetricsConfig;
deleteTestRun is LoadTestRun.deleteTestRun;
getAppComponents is LoadTestRun.getAppComponents;
getServerMetricsConfig is LoadTestRun.getServerMetricsConfig;
getTestRun is LoadTestRun.getTestRun;
getTestRunFile is LoadTestRun.getTestRunFile;
listMetricDimensionValues is LoadTestRun.listMetricDimensionValues;
@projectedName("python", "get_metric_definitions")
@projectedName("java", "getMetricDefinitions")
listMetricDefinitions is LoadTestRun.listMetricDefinitions;
@projectedName("python", "get_metric_namespaces")
@projectedName("java", "getMetricNamespaces")
listMetricNamespaces is LoadTestRun.listMetricNamespaces;
listMetrics is LoadTestRun.listMetrics;
listTestRuns is LoadTestRun.listTestRuns;
#suppress "@azure-tools/typespec-azure-core/no-operation-id"
stopTestRun is LoadTestRun.stop;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
{
"operationId": "LoadTestAdministration_CreateOrUpdateTest",
"title": "Create or update a load test",
"parameters": {
"api-version": "2022-11-01",
"testId": "12345678-1234-1234-1234-123456789012",
"body": {
"description": "sample description",
"displayName": "Performance_LoadTest",
"loadTestConfiguration": {
"engineInstances": 6,
"splitAllCSVs": true
},
"passFailCriteria": {
"passFailMetrics": {
"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe": {
"clientMetric": "response_time_ms",
"aggregate": "percentage",
"condition": ">",
"value": 20,
"action": "continue"
}
}
},
"secrets": {
"secret1": {
"value": "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827",
"type": "AKV_SECRET_URI"
}
},
"environmentVariables": {
"envvar1": "sampletext"
},
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0",
"keyvaultReferenceIdentityType": "UserAssigned",
"keyvaultReferenceIdentityId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/sampleprovider/sampleresourcetype/sampleresourcename"
}
},
"responses": {
"200": {
"body": {
"testId": "12345678-1234-1234-1234-123456789012",
"description": "sample description",
"displayName": "Performance_LoadTest",
"loadTestConfiguration": {
"engineInstances": 6,
"splitAllCSVs": true
},
"passFailCriteria": {
"passFailMetrics": {
"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe": {
"clientMetric": "response_time_ms",
"aggregate": "percentage",
"condition": ">",
"value": 20,
"action": "continue",
"actualValue": 10,
"result": "passed"
}
}
},
"createdDateTime": "2021-12-05T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2021-12-05T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com",
"inputArtifacts": {
"configFileInfo": {
"url": "https://dummyurl.com/configresource",
"fileName": "config.yaml",
"fileType": "ADDITIONAL_ARTIFACTS",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"testScriptFileInfo": {
"url": "https://dummyurl.com/testscriptresource",
"fileName": "sample.jmx",
"fileType": "JMX_FILE",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": "VALIDATION_SUCCESS"
},
"userPropFileInfo": {
"url": "https://dummyurl.com/userpropresource",
"fileName": "user.properties",
"fileType": "USER_PROPERTIES",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"inputArtifactsZipFileInfo": {
"url": "https://dummyurl.com/inputartifactzipresource",
"fileName": "inputartifacts.zip",
"fileType": "ADDITIONAL_ARTIFACTS",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"additionalFileInfo": []
},
"secrets": {
"secret1": {
"value": "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827",
"type": "AKV_SECRET_URI"
}
},
"environmentVariables": {
"envvar1": "sampletext"
},
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0",
"keyvaultReferenceIdentityType": "UserAssigned",
"keyvaultReferenceIdentityId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"
}
},
"201": {
"body": {
"testId": "12345678-1234-1234-1234-123456789012",
"description": "sample description",
"displayName": "Performance_LoadTest",
"loadTestConfiguration": {
"engineInstances": 6,
"splitAllCSVs": true
},
"passFailCriteria": {
"passFailMetrics": {
"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe": {
"clientMetric": "response_time_ms",
"aggregate": "percentage",
"condition": ">",
"value": 20,
"action": "continue",
"actualValue": 10,
"result": "passed"
}
}
},
"createdDateTime": "2021-12-05T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2021-12-05T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com",
"inputArtifacts": {
"configFileInfo": {
"url": "https://dummyurl.com/configresource",
"fileName": "config.yaml",
"fileType": "ADDITIONAL_ARTIFACTS",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"testScriptFileInfo": {
"url": "https://dummyurl.com/testscriptresource",
"fileName": "sample.jmx",
"fileType": "JMX_FILE",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": "VALIDATION_SUCCESS"
},
"userPropFileInfo": {
"url": "https://dummyurl.com/userpropresource",
"fileName": "user.properties",
"fileType": "USER_PROPERTIES",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"inputArtifactsZipFileInfo": {
"url": "https://dummyurl.com/inputartifactzipresource",
"fileName": "inputartifacts.zip",
"fileType": "ADDITIONAL_ARTIFACTS",
"expireDateTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"additionalFileInfo": []
},
"secrets": {
"secret1": {
"value": "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827",
"type": "AKV_SECRET_URI"
}
},
"environmentVariables": {
"envvar1": "sampletext"
},
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0",
"keyvaultReferenceIdentityType": "UserAssigned",
"keyvaultReferenceIdentityId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"operationId": "LoadTestAdministration_CreateOrUpdateAppComponents",
"title": "Add or update app components to a load test",
"parameters": {
"testId": "ee843bd9-a6d4-4364-a45c-427a03c39fa7",
"api-version": "2022-11-01",
"body": {
"components": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource": {
"resourceType": "microsoft.insights/components",
"resourceName": "appcomponentresource",
"displayName": "Performance_LoadTest_Insights",
"kind": "web"
}
}
}
},
"responses": {
"200": {
"body": {
"testId": "12345678-1234-1234-1234-123456789012",
"components": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource",
"resourceType": "microsoft.insights/components",
"resourceName": "appcomponentresource",
"displayName": "Performance_LoadTest_Insights",
"resourceGroup": "samplerg",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"kind": "web"
}
},
"createdDateTime": "2021-12-05T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2021-12-05T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com"
}
},
"201": {
"body": {
"testId": "12345678-1234-1234-1234-123456789012",
"components": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource",
"resourceType": "microsoft.insights/components",
"resourceName": "appcomponentresource",
"displayName": "Performance_LoadTest_Insights",
"resourceGroup": "samplerg",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"kind": "web"
}
},
"createdDateTime": "2021-12-05T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2021-12-05T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "LoadTestRun_CreateOrUpdateTestRun",
"title": "Create/update and start a load test run",
"parameters": {
"testRunId": "12316678-1234-1234-1234-122451189012",
"oldTestRunId": "12345678-1234-1234-1234-123456789012",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"operationId": "LoadTestRun_CreateOrUpdateAppComponents",
"title": "Add or update app components to a load test run",
"parameters": {
"testRunId": "ee843bd9-a6d4-4364-a45c-427a03c39fa7",
"api-version": "2022-11-01",
"body": {
"components": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource": {
"resourceType": "microsoft.insights/components",
"resourceName": "appcomponentresource",
"displayName": "Performance_LoadTest_Insights",
"kind": "web"
}
}
}
},
"responses": {
"200": {
"body": {
"testRunId": "12316678-1234-1234-1234-122451189012",
"components": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource",
"resourceType": "microsoft.insights/components",
"resourceName": "appcomponentresource",
"displayName": "Performance_LoadTest_Insights",
"resourceGroup": "samplerg",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"kind": "web"
}
},
"createdDateTime": "2021-12-05T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2021-12-05T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com"
}
},
"201": {
"body": {
"testRunId": "12316678-1234-1234-1234-122451189012",
"components": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource",
"resourceType": "microsoft.insights/components",
"resourceName": "appcomponentresource",
"displayName": "Performance_LoadTest_Insights",
"resourceGroup": "samplerg",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"kind": "web"
}
},
"createdDateTime": "2021-12-05T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2021-12-05T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com"
}
}
}
}
Loading

0 comments on commit f6278b3

Please sign in to comment.