From 635a0acee4c65575a3c9086c7b130f82c3cdffce Mon Sep 17 00:00:00 2001 From: Harshan B Date: Tue, 23 Aug 2022 19:59:56 +0530 Subject: [PATCH 01/18] Initial java generation with minor fixes --- eng/versioning/version_client.txt | 1 + .../azure-developer-loadtesting/CHANGELOG.md | 13 + .../azure-developer-loadtesting/README.md | 92 + .../azure-developer-loadtesting/pom.xml | 85 + .../loadtesting/AppComponentAsyncClient.java | 205 ++ .../loadtesting/AppComponentClient.java | 201 ++ .../AppComponentClientBuilder.java | 296 +++ .../loadtesting/LoadTestServiceVersion.java | 34 + .../loadtesting/ServerMetricsAsyncClient.java | 282 +++ .../loadtesting/ServerMetricsClient.java | 276 +++ .../ServerMetricsClientBuilder.java | 296 +++ .../loadtesting/TestAsyncClient.java | 517 +++++ .../developer/loadtesting/TestClient.java | 513 +++++ .../loadtesting/TestClientBuilder.java | 296 +++ .../loadtesting/TestRunAsyncClient.java | 757 ++++++++ .../developer/loadtesting/TestRunClient.java | 753 ++++++++ .../loadtesting/TestRunClientBuilder.java | 296 +++ .../implementation/AppComponentsImpl.java | 506 +++++ .../implementation/LoadTestClientImpl.java | 163 ++ .../implementation/ServerMetricsImpl.java | 708 +++++++ .../implementation/TestRunsImpl.java | 1721 +++++++++++++++++ .../loadtesting/implementation/TestsImpl.java | 1247 ++++++++++++ .../implementation/models/AppComponent.java | 162 ++ .../models/AppComponentsMap.java | 125 ++ .../models/ClientMetricsFilters.java | 90 + .../models/ClientMetricsRequestModel.java | 176 ++ .../models/ClientMetricsResults.java | 64 + .../DefaultServerMetricsConfigListModel.java | 44 + .../DefaultServerMetricsConfigModel.java | 142 ++ .../implementation/models/Error.java | 117 ++ .../models/ErrorResponseBody.java | 38 + .../implementation/models/FileType.java | 41 + .../implementation/models/FileUrl.java | 171 ++ .../implementation/models/FileUrlList.java | 65 + .../implementation/models/Filters.java | 69 + .../models/InputTestArtifacts.java | 132 ++ .../implementation/models/LoadTestConfig.java | 67 + .../implementation/models/LocalizedName.java | 64 + .../models/OutputTestArtifacts.java | 64 + .../models/PassFailCriteria.java | 39 + .../implementation/models/PassFailMetric.java | 210 ++ .../models/ResourceMetricModel.java | 181 ++ .../implementation/models/SecretMetadata.java | 64 + .../implementation/models/Series.java | 118 ++ .../models/ServerMetricName.java | 57 + .../models/ServerMetricsModel.java | 109 ++ .../models/SupportedResourceType.java | 44 + .../implementation/models/TestArtifacts.java | 77 + .../implementation/models/TestModel.java | 363 ++++ .../models/TestModelResourceList.java | 65 + .../implementation/models/TestRunModel.java | 461 +++++ .../models/TestRunModelResourceList.java | 65 + .../models/TestRunStatisticsModel.java | 222 +++ .../implementation/models/TimeRange.java | 65 + .../implementation/models/TimeSeries.java | 65 + .../implementation/models/package-info.java | 9 + .../implementation/package-info.java | 9 + .../developer/loadtesting/package-info.java | 9 + .../src/main/java/module-info.java | 9 + .../azure-developer-loadtesting.properties | 2 + .../developer/loadtesting/ReadmeSamples.java | 12 + .../generated/CreateAndUpdateTestRun.java | 33 + .../CreateOrUpdateAppComponents.java | 32 + .../CreateOrUpdateServerMetricsConfig.java | 32 + .../generated/CreateOrUpdateTest.java | 31 + .../generated/DeleteAppComponent.java | 28 + .../loadtesting/generated/DeleteLoadTest.java | 27 + .../generated/DeleteServerMetrics.java | 28 + .../loadtesting/generated/DeleteTestFile.java | 28 + .../loadtesting/generated/DeleteTestRun.java | 27 + .../generated/GetAllTestFiles.java | 28 + .../generated/GetAppComponent.java | 28 + .../generated/GetAppComponentByName.java | 29 + .../loadtesting/generated/GetLoadTest.java | 28 + .../generated/GetServerDefaultMetrics.java | 27 + .../generated/GetServerMetrics.java | 28 + .../generated/GetServerMetricsByName.java | 29 + .../loadtesting/generated/GetTestFile.java | 29 + .../loadtesting/generated/GetTestRun.java | 28 + .../generated/GetTestRunClientMetrics.java | 32 + .../GetTestRunClientMetricsFilters.java | 29 + .../loadtesting/generated/GetTestRunFile.java | 29 + .../generated/ListLoadTestSearch.java | 34 + .../generated/ListSupportedResourceType.java | 27 + .../generated/ListTestRunsSearch.java | 36 + .../loadtesting/generated/StopTestRun.java | 28 + .../loadtesting/generated/UploadTestFile.java | 33 + .../generated/AppComponentTests.java | 39 + .../generated/AppComponentsMapTests.java | 62 + .../generated/ClientMetricsFiltersTests.java | 57 + .../ClientMetricsRequestModelTests.java | 47 + .../generated/ClientMetricsResultsTests.java | 78 + .../CreateAndUpdateTestRunTests.java | 28 + .../CreateOrUpdateAppComponentsTests.java | 27 + ...reateOrUpdateServerMetricsConfigTests.java | 27 + .../generated/CreateOrUpdateTestTests.java | 26 + ...aultServerMetricsConfigListModelTests.java | 100 + .../DefaultServerMetricsConfigModelTests.java | 45 + .../generated/DeleteAppComponentTests.java | 23 + .../generated/DeleteLoadTestTests.java | 22 + .../generated/DeleteServerMetricsTests.java | 23 + .../generated/DeleteTestFileTests.java | 23 + .../generated/DeleteTestRunTests.java | 22 + .../generated/ErrorResponseBodyTests.java | 53 + .../loadtesting/generated/ErrorTests.java | 60 + .../generated/FileUrlListTests.java | 68 + .../loadtesting/generated/FileUrlTests.java | 47 + .../loadtesting/generated/FiltersTests.java | 34 + .../generated/GetAllTestFilesTests.java | 28 + .../generated/GetAppComponentByNameTests.java | 29 + .../generated/GetAppComponentTests.java | 28 + .../generated/GetLoadTestTests.java | 28 + .../GetServerDefaultMetricsTests.java | 27 + .../GetServerMetricsByNameTests.java | 29 + .../generated/GetServerMetricsTests.java | 28 + .../generated/GetTestFileTests.java | 29 + .../GetTestRunClientMetricsFiltersTests.java | 29 + .../GetTestRunClientMetricsTests.java | 32 + .../generated/GetTestRunFileTests.java | 29 + .../generated/GetTestRunTests.java | 28 + .../generated/InputTestArtifactsTests.java | 112 ++ .../generated/ListLoadTestSearchTests.java | 34 + .../ListSupportedResourceTypeTests.java | 27 + .../generated/ListTestRunsSearchTests.java | 36 + .../generated/LoadTestClientTestBase.java | 109 ++ .../generated/LoadTestConfigTests.java | 29 + .../generated/LocalizedNameTests.java | 29 + .../generated/OutputTestArtifactsTests.java | 70 + .../generated/PassFailCriteriaTests.java | 87 + .../generated/PassFailMetricTests.java | 45 + .../generated/ResourceMetricModelTests.java | 51 + .../generated/SecretMetadataTests.java | 29 + .../loadtesting/generated/SeriesTests.java | 150 ++ .../generated/ServerMetricNameTests.java | 29 + .../generated/ServerMetricsModelTests.java | 102 + .../generated/StopTestRunTests.java | 28 + .../generated/SupportedResourceTypeTests.java | 27 + .../generated/TestArtifactsTests.java | 83 + .../generated/TestModelResourceListTests.java | 97 + .../loadtesting/generated/TestModelTests.java | 129 ++ .../TestRunModelResourceListTests.java | 90 + .../generated/TestRunModelTests.java | 117 ++ .../TestRunStatisticsModelTests.java | 25 + .../loadtesting/generated/TimeRangeTests.java | 33 + .../generated/TimeSeriesTests.java | 33 + .../generated/UploadTestFileTests.java | 28 + .../swagger/README.md | 20 + sdk/loadtestservice/ci.yml | 3 + sdk/loadtestservice/pom.xml | 3 +- 149 files changed, 16821 insertions(+), 1 deletion(-) create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/README.md create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/pom.xml create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestServiceVersion.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestClientImpl.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index bf8c262f3c9bb..e68a079afd4ec 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -158,6 +158,7 @@ com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-verticals-agrifood-farming;1.0.0-beta.2;1.0.0-beta.3 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-email;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-developer-loadtesting;1.0.0-beta.1;1.0.0-beta.1 com.microsoft.azure:spring-cloud-azure-appconfiguration-config-web;1.3.0;1.4.0-beta.1 com.microsoft.azure:spring-cloud-azure-appconfiguration-config;1.3.0;1.4.0-beta.1 com.microsoft.azure:spring-cloud-azure-feature-management-web;1.3.0;1.4.0-beta.1 diff --git a/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md new file mode 100644 index 0000000000000..49c7e3b3a0043 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure LoadTestClient client library for Java. This package contains Microsoft Azure LoadTestClient client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md new file mode 100644 index 0000000000000..b240c0007e00f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -0,0 +1,92 @@ +# Azure Developer LoadTesting client library for Java + +Azure Developer LoadTesting client library for Java. + +This package contains Microsoft Azure Developer LoadTesting client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-developer-loadtesting;current}) +```xml + + com.azure + azure-developer-loadtesting + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +TestClientBuilder testClientBuilder = new TestClientBuilder(); +TestClient testClient = testClientBuilder + .credential(credential) + .endpoint("") + .buildClient(); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +Authentication in this SDK is similar to Azure Management Libraries. See [Authentication][authenticate] for more options. + +An important distinction is that Azure Management libraries use `authenticate` method to accept credential along with Azure profile, where this SDK uses `credential` method and only accept the credential parameter. + +## Key concepts + +## Examples + +```java com.azure.developer.loadtesting.readme +``` + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md diff --git a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml new file mode 100644 index 0000000000000..b61229c4ed183 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml @@ -0,0 +1,85 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-developer-loadtesting + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for LoadTestClient Management + This package contains Microsoft Azure LoadTestClient client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.31.0 + + + com.azure + azure-core-http-netty + 1.12.4 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + org.mockito + mockito-core + 4.5.1 + test + + + com.azure + azure-core-test + 1.11.0 + test + + + com.azure + azure-identity + 1.5.4 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + + diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java new file mode 100644 index 0000000000000..f01364466f81c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.AppComponentsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous LoadTestClient type. */ +@ServiceClient(builder = AppComponentClientBuilder.class, isAsync = true) +public final class AppComponentAsyncClient { + + @Generated private final AppComponentsImpl serviceClient; + + /** + * Initializes an instance of AppComponentAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AppComponentAsyncClient(AppComponentsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateAppComponentsWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteAppComponentWithResponseAsync(name, requestOptions); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getAppComponentByNameWithResponseAsync(name, requestOptions); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getAppComponentWithResponseAsync(requestOptions); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java new file mode 100644 index 0000000000000..5947d73771f25 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** Initializes a new instance of the synchronous LoadTestClient type. */ +@ServiceClient(builder = AppComponentClientBuilder.class) +public final class AppComponentClient { + + @Generated private final AppComponentAsyncClient client; + + /** + * Initializes an instance of AppComponentClient class. + * + * @param client the async client. + */ + @Generated + AppComponentClient(AppComponentAsyncClient client) { + this.client = client; + } + + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAppComponentsWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateAppComponentsWithResponse(name, body, requestOptions).block(); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteAppComponentWithResponse(name, requestOptions).block(); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { + return this.client.getAppComponentByNameWithResponse(name, requestOptions).block(); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentWithResponse(RequestOptions requestOptions) { + return this.client.getAppComponentWithResponse(requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java new file mode 100644 index 0000000000000..135d5c6e11db7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the AppComponentClient type. */ +@ServiceClientBuilder(serviceClients = {AppComponentClient.class, AppComponentAsyncClient.class}) +public final class AppComponentClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + + @Generated + private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the AppComponentClientBuilder. */ + @Generated + public AppComponentClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public AppComponentClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated private LoadTestServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AppComponentClientBuilder. + */ + @Generated + public AppComponentClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the AppComponentClientBuilder. + */ + @Generated + public AppComponentClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of LoadTestClientImpl with the provided parameters. + * + * @return an instance of LoadTestClientImpl. + */ + @Generated + private LoadTestClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + LoadTestServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); + LoadTestClientImpl client = + new LoadTestClientImpl( + localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AppComponentAsyncClient class. + * + * @return an instance of AppComponentAsyncClient. + */ + @Generated + public AppComponentAsyncClient buildAsyncClient() { + return new AppComponentAsyncClient(buildInnerClient().getAppComponents()); + } + + /** + * Builds an instance of AppComponentClient class. + * + * @return an instance of AppComponentClient. + */ + @Generated + public AppComponentClient buildClient() { + return new AppComponentClient(new AppComponentAsyncClient(buildInnerClient().getAppComponents())); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestServiceVersion.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestServiceVersion.java new file mode 100644 index 0000000000000..480d1bfb8374c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestServiceVersion.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting; + +import com.azure.core.util.ServiceVersion; + +/** Service version of LoadTestClient. */ +public enum LoadTestServiceVersion implements ServiceVersion { + /** Enum value 2022-06-01-preview. */ + V2022_06_01_PREVIEW("2022-06-01-preview"); + + private final String version; + + LoadTestServiceVersion(String version) { + this.version = version; + } + + /** {@inheritDoc} */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link LoadTestServiceVersion}. + */ + public static LoadTestServiceVersion getLatest() { + return V2022_06_01_PREVIEW; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java new file mode 100644 index 0000000000000..d302d952ad53c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.ServerMetricsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous LoadTestClient type. */ +@ServiceClient(builder = ServerMetricsClientBuilder.class, isAsync = true) +public final class ServerMetricsAsyncClient { + + @Generated private final ServerMetricsImpl serviceClient; + + /** + * Initializes an instance of ServerMetricsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ServerMetricsAsyncClient(ServerMetricsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateServerMetricsConfigWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(name, body, requestOptions); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, requestOptions); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteServerMetricsWithResponseAsync(name, requestOptions); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getServerDefaultMetricsWithResponseAsync(requestOptions); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listSupportedResourceTypeWithResponseAsync(requestOptions); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java new file mode 100644 index 0000000000000..3d5385b9aee77 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** Initializes a new instance of the synchronous LoadTestClient type. */ +@ServiceClient(builder = ServerMetricsClientBuilder.class) +public final class ServerMetricsClient { + + @Generated private final ServerMetricsAsyncClient client; + + /** + * Initializes an instance of ServerMetricsClient class. + * + * @param client the async client. + */ + @Generated + ServerMetricsClient(ServerMetricsAsyncClient client) { + this.client = client; + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateServerMetricsConfigWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateServerMetricsConfigWithResponse(name, body, requestOptions).block(); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.client.getServerMetricsByNameWithResponse(name, requestOptions).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteServerMetricsWithResponse(name, requestOptions).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsWithResponse(RequestOptions requestOptions) { + return this.client.getServerMetricsWithResponse(requestOptions).block(); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return this.client.getServerDefaultMetricsWithResponse(requestOptions).block(); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.client.listSupportedResourceTypeWithResponse(requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java new file mode 100644 index 0000000000000..ee57eacff7e79 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the ServerMetricsClient type. */ +@ServiceClientBuilder(serviceClients = {ServerMetricsClient.class, ServerMetricsAsyncClient.class}) +public final class ServerMetricsClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + + @Generated + private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the ServerMetricsClientBuilder. */ + @Generated + public ServerMetricsClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public ServerMetricsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated private LoadTestServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the ServerMetricsClientBuilder. + */ + @Generated + public ServerMetricsClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the ServerMetricsClientBuilder. + */ + @Generated + public ServerMetricsClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of LoadTestClientImpl with the provided parameters. + * + * @return an instance of LoadTestClientImpl. + */ + @Generated + private LoadTestClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + LoadTestServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); + LoadTestClientImpl client = + new LoadTestClientImpl( + localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of ServerMetricsAsyncClient class. + * + * @return an instance of ServerMetricsAsyncClient. + */ + @Generated + public ServerMetricsAsyncClient buildAsyncClient() { + return new ServerMetricsAsyncClient(buildInnerClient().getServerMetrics()); + } + + /** + * Builds an instance of ServerMetricsClient class. + * + * @return an instance of ServerMetricsClient. + */ + @Generated + public ServerMetricsClient buildClient() { + return new ServerMetricsClient(new ServerMetricsAsyncClient(buildInnerClient().getServerMetrics())); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java new file mode 100644 index 0000000000000..d38b63a5615f5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.TestsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous LoadTestClient type. */ +@ServiceClient(builder = TestClientBuilder.class, isAsync = true) +public final class TestAsyncClient { + + @Generated private final TestsImpl serviceClient; + + /** + * Initializes an instance of TestAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + TestAsyncClient(TestsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateTestWithResponseAsync(testId, body, requestOptions); + } + + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.deleteLoadTestWithResponseAsync(testId, requestOptions); + } + + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.getLoadTestWithResponseAsync(testId, requestOptions); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLoadTestSearchWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listLoadTestSearchWithResponseAsync(requestOptions); + } + + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadTestFileWithResponse( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestFileWithResponse( + String testId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getTestFileWithResponseAsync(testId, fileId, requestOptions); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestFileWithResponse( + String testId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileId, requestOptions); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAllTestFilesWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.getAllTestFilesWithResponseAsync(testId, requestOptions); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java new file mode 100644 index 0000000000000..e4084be132198 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** Initializes a new instance of the synchronous LoadTestClient type. */ +@ServiceClient(builder = TestClientBuilder.class) +public final class TestClient { + + @Generated private final TestAsyncClient client; + + /** + * Initializes an instance of TestClient class. + * + * @param client the async client. + */ + @Generated + TestClient(TestAsyncClient client) { + this.client = client; + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateTestWithResponse(testId, body, requestOptions).block(); + } + + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return this.client.deleteLoadTestWithResponse(testId, requestOptions).block(); + } + + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return this.client.getLoadTestWithResponse(testId, requestOptions).block(); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listLoadTestSearchWithResponse(RequestOptions requestOptions) { + return this.client.listLoadTestSearchWithResponse(requestOptions).block(); + } + + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadTestFileWithResponse( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + return this.client.uploadTestFileWithResponse(testId, fileId, file, requestOptions).block(); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return this.client.getTestFileWithResponse(testId, fileId, requestOptions).block(); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return this.client.deleteTestFileWithResponse(testId, fileId, requestOptions).block(); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAllTestFilesWithResponse(String testId, RequestOptions requestOptions) { + return this.client.getAllTestFilesWithResponse(testId, requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java new file mode 100644 index 0000000000000..fb46d28c075ea --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the TestClient type. */ +@ServiceClientBuilder(serviceClients = {TestClient.class, TestAsyncClient.class}) +public final class TestClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + + @Generated + private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the TestClientBuilder. */ + @Generated + public TestClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated private LoadTestServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the TestClientBuilder. + */ + @Generated + public TestClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the TestClientBuilder. + */ + @Generated + public TestClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of LoadTestClientImpl with the provided parameters. + * + * @return an instance of LoadTestClientImpl. + */ + @Generated + private LoadTestClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + LoadTestServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); + LoadTestClientImpl client = + new LoadTestClientImpl( + localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of TestAsyncClient class. + * + * @return an instance of TestAsyncClient. + */ + @Generated + public TestAsyncClient buildAsyncClient() { + return new TestAsyncClient(buildInnerClient().getTests()); + } + + /** + * Builds an instance of TestClient class. + * + * @return an instance of TestClient. + */ + @Generated + public TestClient buildClient() { + return new TestClient(new TestAsyncClient(buildInnerClient().getTests())); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java new file mode 100644 index 0000000000000..cd54d159c20d4 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -0,0 +1,757 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.TestRunsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous LoadTestClient type. */ +@ServiceClient(builder = TestRunClientBuilder.class, isAsync = true) +public final class TestRunAsyncClient { + + @Generated private final TestRunsImpl serviceClient; + + /** + * Initializes an instance of TestRunAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + TestRunAsyncClient(TestRunsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Delete a test run by its name. + * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.deleteTestRunWithResponseAsync(testRunId, requestOptions); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAndUpdateTestWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createAndUpdateTestWithResponseAsync(testRunId, body, requestOptions); + } + + /** + * Get test run details by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunWithResponseAsync(testRunId, requestOptions); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs with given filters along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestRunsSearchWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listTestRunsSearchWithResponseAsync(requestOptions); + } + + /** + * Stop test run by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.stopTestRunWithResponseAsync(testRunId, requestOptions); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java new file mode 100644 index 0000000000000..9f720891009df --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -0,0 +1,753 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** Initializes a new instance of the synchronous LoadTestClient type. */ +@ServiceClient(builder = TestRunClientBuilder.class) +public final class TestRunClient { + + @Generated private final TestRunAsyncClient client; + + /** + * Initializes an instance of TestRunClient class. + * + * @param client the async client. + */ + @Generated + TestRunClient(TestRunAsyncClient client) { + this.client = client; + } + + /** + * Delete a test run by its name. + * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.deleteTestRunWithResponse(testRunId, requestOptions).block(); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAndUpdateTestWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.client.createAndUpdateTestWithResponse(testRunId, body, requestOptions).block(); + } + + /** + * Get test run details by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.getTestRunWithResponse(testRunId, requestOptions).block(); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.client.getTestRunFileWithResponse(testRunId, fileId, requestOptions).block(); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs with given filters along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listTestRunsSearchWithResponse(RequestOptions requestOptions) { + return this.client.listTestRunsSearchWithResponse(requestOptions).block(); + } + + /** + * Stop test run by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunClientMetricsWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.client.getTestRunClientMetricsWithResponse(testRunId, body, requestOptions).block(); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.client.getTestRunClientMetricsFiltersWithResponse(testRunId, requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java new file mode 100644 index 0000000000000..0ad1d247b647b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the TestRunClient type. */ +@ServiceClientBuilder(serviceClients = {TestRunClient.class, TestRunAsyncClient.class}) +public final class TestRunClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + + @Generated + private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the TestRunClientBuilder. */ + @Generated + public TestRunClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated private LoadTestServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the TestRunClientBuilder. + */ + @Generated + public TestRunClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the TestRunClientBuilder. + */ + @Generated + public TestRunClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of LoadTestClientImpl with the provided parameters. + * + * @return an instance of LoadTestClientImpl. + */ + @Generated + private LoadTestClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + LoadTestServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); + LoadTestClientImpl client = + new LoadTestClientImpl( + localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of TestRunAsyncClient class. + * + * @return an instance of TestRunAsyncClient. + */ + @Generated + public TestRunAsyncClient buildAsyncClient() { + return new TestRunAsyncClient(buildInnerClient().getTestRuns()); + } + + /** + * Builds an instance of TestRunClient class. + * + * @return an instance of TestRunClient. + */ + @Generated + public TestRunClient buildClient() { + return new TestRunClient(new TestRunAsyncClient(buildInnerClient().getTestRuns())); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java new file mode 100644 index 0000000000000..36a21de83575d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AppComponents. */ +public final class AppComponentsImpl { + /** The proxy service used to perform REST calls. */ + private final AppComponentsService service; + + /** The service client containing this operation class. */ + private final LoadTestClientImpl client; + + /** + * Initializes an instance of AppComponentsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppComponentsImpl(LoadTestClientImpl client) { + this.service = + RestProxy.create(AppComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestClientAppComponents to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestClientAppCom") + private interface AppComponentsService { + @Patch("/appcomponents/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateAppComponents( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/appcomponents/{name}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteAppComponent( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/appcomponents/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAppComponentByName( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/appcomponents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAppComponent( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + } + + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateAppComponentsWithResponseAsync( + String name, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdateAppComponents( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAppComponentsWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions).block(); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAppComponentWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteAppComponent( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { + return deleteAppComponentWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentByNameWithResponseAsync( + String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAppComponentByName( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { + return getAppComponentByNameWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAppComponent( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentWithResponse(RequestOptions requestOptions) { + return getAppComponentWithResponseAsync(requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestClientImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestClientImpl.java new file mode 100644 index 0000000000000..5c11c8bb4ff65 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestClientImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.developer.loadtesting.LoadTestServiceVersion; + +/** Initializes a new instance of the LoadTestClient type. */ +public final class LoadTestClientImpl { + /** URL to perform data plane API operations on the resource. */ + private final String endpoint; + + /** + * Gets URL to perform data plane API operations on the resource. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Service version. */ + private final LoadTestServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public LoadTestServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The AppComponentsImpl object to access its operations. */ + private final AppComponentsImpl appComponents; + + /** + * Gets the AppComponentsImpl object to access its operations. + * + * @return the AppComponentsImpl object. + */ + public AppComponentsImpl getAppComponents() { + return this.appComponents; + } + + /** The ServerMetricsImpl object to access its operations. */ + private final ServerMetricsImpl serverMetrics; + + /** + * Gets the ServerMetricsImpl object to access its operations. + * + * @return the ServerMetricsImpl object. + */ + public ServerMetricsImpl getServerMetrics() { + return this.serverMetrics; + } + + /** The TestsImpl object to access its operations. */ + private final TestsImpl tests; + + /** + * Gets the TestsImpl object to access its operations. + * + * @return the TestsImpl object. + */ + public TestsImpl getTests() { + return this.tests; + } + + /** The TestRunsImpl object to access its operations. */ + private final TestRunsImpl testRuns; + + /** + * Gets the TestRunsImpl object to access its operations. + * + * @return the TestRunsImpl object. + */ + public TestRunsImpl getTestRuns() { + return this.testRuns; + } + + /** + * Initializes an instance of LoadTestClient client. + * + * @param endpoint URL to perform data plane API operations on the resource. + * @param serviceVersion Service version. + */ + public LoadTestClientImpl(String endpoint, LoadTestServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + endpoint, + serviceVersion); + } + + /** + * Initializes an instance of LoadTestClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint URL to perform data plane API operations on the resource. + * @param serviceVersion Service version. + */ + public LoadTestClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of LoadTestClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint URL to perform data plane API operations on the resource. + * @param serviceVersion Service version. + */ + public LoadTestClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String endpoint, + LoadTestServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.appComponents = new AppComponentsImpl(this); + this.serverMetrics = new ServerMetricsImpl(this); + this.tests = new TestsImpl(this); + this.testRuns = new TestRunsImpl(this); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java new file mode 100644 index 0000000000000..711a8fb0faaae --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java @@ -0,0 +1,708 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServerMetrics. */ +public final class ServerMetricsImpl { + /** The proxy service used to perform REST calls. */ + private final ServerMetricsService service; + + /** The service client containing this operation class. */ + private final LoadTestClientImpl client; + + /** + * Initializes an instance of ServerMetricsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServerMetricsImpl(LoadTestClientImpl client) { + this.service = + RestProxy.create(ServerMetricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestClientServerMetrics to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestClientServer") + private interface ServerMetricsService { + @Patch("/serverMetricsConfig/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateServerMetricsConfig( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getServerMetricsByName( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/serverMetricsConfig/{name}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteServerMetrics( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getServerMetrics( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getServerDefaultMetrics( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig/supportedResourceTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listSupportedResourceType( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateServerMetricsConfigWithResponseAsync( + String name, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdateServerMetricsConfig( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateServerMetricsConfigWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateServerMetricsConfigWithResponseAsync(name, body, requestOptions).block(); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsByNameWithResponseAsync( + String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getServerMetricsByName( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return getServerMetricsByNameWithResponseAsync(name, requestOptions).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteServerMetricsWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteServerMetrics( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return deleteServerMetricsWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getServerMetrics( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsWithResponse(RequestOptions requestOptions) { + return getServerMetricsWithResponseAsync(requestOptions).block(); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerDefaultMetricsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getServerDefaultMetrics( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return getServerDefaultMetricsWithResponseAsync(requestOptions).block(); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSupportedResourceTypeWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listSupportedResourceType( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return listSupportedResourceTypeWithResponseAsync(requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java new file mode 100644 index 0000000000000..9389023756201 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java @@ -0,0 +1,1721 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TestRuns. */ +public final class TestRunsImpl { + /** The proxy service used to perform REST calls. */ + private final TestRunsService service; + + /** The service client containing this operation class. */ + private final LoadTestClientImpl client; + + /** + * Initializes an instance of TestRunsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestRunsImpl(LoadTestClientImpl client) { + this.service = RestProxy.create(TestRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestClientTestRuns to be used by the proxy service to perform + * REST calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestClientTestRu") + private interface TestRunsService { + @Delete("/testruns/{testRunId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTestRun( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Patch("/testruns/{testRunId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createAndUpdateTest( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testruns/{testRunId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestRun( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testruns/{testRunId}/files/{fileId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestRunFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testruns/sortAndFilter") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTestRunsSearch( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Post("/testruns/{testRunId}:stop") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> stopTestRun( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Post("/testruns/{testRunId}/clientMetrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestRunClientMetrics( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testruns/{testRunId}/clientMetricsFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestRunClientMetricsFilters( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + } + + /** + * Delete a test run by its name. + * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete a test run by its name. + * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return deleteTestRunWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAndUpdateTestWithResponseAsync( + String testRunId, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createAndUpdateTest( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAndUpdateTestWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return createAndUpdateTestWithResponseAsync(testRunId, body, requestOptions).block(); + } + + /** + * Get test run details by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get test run details by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return getTestRunWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunFileWithResponseAsync( + String testRunId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getTestRunFile( + this.client.getEndpoint(), + testRunId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions).block(); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs with given filters along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestRunsSearchWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listTestRunsSearch( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs with given filters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listTestRunsSearchWithResponse(RequestOptions requestOptions) { + return listTestRunsSearchWithResponseAsync(requestOptions).block(); + } + + /** + * Stop test run by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.stopTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Stop test run by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return stopTestRunWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsWithResponseAsync( + String testRunId, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getTestRunClientMetrics( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunClientMetricsWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions).block(); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsFiltersWithResponseAsync( + String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getTestRunClientMetricsFilters( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java new file mode 100644 index 0000000000000..8c585824f17b2 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java @@ -0,0 +1,1247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Tests. */ +public final class TestsImpl { + /** The proxy service used to perform REST calls. */ + private final TestsService service; + + /** The service client containing this operation class. */ + private final LoadTestClientImpl client; + + /** + * Initializes an instance of TestsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestsImpl(LoadTestClientImpl client) { + this.service = RestProxy.create(TestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestClientTests to be used by the proxy service to perform REST + * calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestClientTests") + private interface TestsService { + @Patch("/loadtests/{testId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateTest( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/loadtests/{testId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLoadTest( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLoadTest( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/sortAndFilter") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listLoadTestSearch( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + // @Multipart not supported by RestProxy + @Put("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadTestFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @BodyParam("multipart/form-data") BinaryData file, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTestFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}/files") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAllTestFiles( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTestWithResponseAsync( + String testId, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdateTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + body, + accept, + requestOptions, + context)); + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateTestWithResponseAsync(testId, body, requestOptions).block(); + } + + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLoadTestWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteLoadTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context)); + } + + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return deleteLoadTestWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLoadTestWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getLoadTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context)); + } + + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return getLoadTestWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLoadTestSearchWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listLoadTestSearch( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listLoadTestSearchWithResponse(RequestOptions requestOptions) { + return listLoadTestSearchWithResponseAsync(requestOptions).block(); + } + + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadTestFileWithResponseAsync( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + final String accept = "application/json"; + // Replace file with a request body containing file and multipart boundary + return FluxUtil.withContext( + context -> + service.uploadTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + file, + accept, + requestOptions, + context)); + } + + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadTestFileWithResponse( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + return uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions).block(); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return getTestFileWithResponseAsync(testId, fileId, requestOptions).block(); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return deleteTestFileWithResponseAsync(testId, fileId, requestOptions).block(); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAllTestFilesWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAllTestFiles( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context)); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAllTestFilesWithResponse(String testId, RequestOptions requestOptions) { + return getAllTestFilesWithResponseAsync(testId, requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java new file mode 100644 index 0000000000000..c085ca3c4c019 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Azure resource object (Refer azure generic resource model : + * https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource). + */ +@Fluent +public final class AppComponent { + /* + * Fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * Azure resource name + */ + @JsonProperty(value = "resourceName", required = true) + private String resourceName; + + /* + * Azure resource type + */ + @JsonProperty(value = "resourceType", required = true) + private String resourceType; + + /* + * Azure resource display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Resource group name of the Azure resource + */ + @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /* + * Subscription Id of the Azure resource + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * Kind of Azure resource type + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * Creates an instance of AppComponent class. + * + * @param resourceId the resourceId value to set. + * @param resourceName the resourceName value to set. + * @param resourceType the resourceType value to set. + */ + @JsonCreator + public AppComponent( + @JsonProperty(value = "resourceId", required = true) String resourceId, + @JsonProperty(value = "resourceName", required = true) String resourceName, + @JsonProperty(value = "resourceType", required = true) String resourceType) { + this.resourceId = resourceId; + this.resourceName = resourceName; + this.resourceType = resourceType; + } + + /** + * Get the resourceId property: Fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * @return the resourceId value. + */ + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the resourceName property: Azure resource name. + * + * @return the resourceName value. + */ + public String getResourceName() { + return this.resourceName; + } + + /** + * Get the resourceType property: Azure resource type. + * + * @return the resourceType value. + */ + public String getResourceType() { + return this.resourceType; + } + + /** + * Get the displayName property: Azure resource display name. + * + * @return the displayName value. + */ + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Azure resource display name. + * + * @param displayName the displayName value to set. + * @return the AppComponent object itself. + */ + public AppComponent setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the resourceGroup property: Resource group name of the Azure resource. + * + * @return the resourceGroup value. + */ + public String getResourceGroup() { + return this.resourceGroup; + } + + /** + * Get the subscriptionId property: Subscription Id of the Azure resource. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Get the kind property: Kind of Azure resource type. + * + * @return the kind value. + */ + public String getKind() { + return this.kind; + } + + /** + * Set the kind property: Kind of Azure resource type. + * + * @param kind the kind value to set. + * @return the AppComponent object itself. + */ + public AppComponent setKind(String kind) { + this.kind = kind; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java new file mode 100644 index 0000000000000..3f4df73160a27 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** App Components model. */ +@Fluent +public final class AppComponentsMap { + /* + * Azure Load Testing resource Id + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * [Required, if testRunId is not given] Load test unique identifier + */ + @JsonProperty(value = "testId") + private String testId; + + /* + * [Required if testId is not given] Load test run unique identifier + */ + @JsonProperty(value = "testRunId") + private String testRunId; + + /* + * AppComponent name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * AppComponents Map { resource id (Fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource + * object } + */ + @JsonProperty(value = "value", required = true) + private Map value; + + /** + * Creates an instance of AppComponentsMap class. + * + * @param value the value value to set. + */ + @JsonCreator + public AppComponentsMap(@JsonProperty(value = "value", required = true) Map value) { + this.value = value; + } + + /** + * Get the resourceId property: Azure Load Testing resource Id. + * + * @return the resourceId value. + */ + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the testId property: [Required, if testRunId is not given] Load test unique identifier. + * + * @return the testId value. + */ + public String getTestId() { + return this.testId; + } + + /** + * Set the testId property: [Required, if testRunId is not given] Load test unique identifier. + * + * @param testId the testId value to set. + * @return the AppComponentsMap object itself. + */ + public AppComponentsMap setTestId(String testId) { + this.testId = testId; + return this; + } + + /** + * Get the testRunId property: [Required if testId is not given] Load test run unique identifier. + * + * @return the testRunId value. + */ + public String getTestRunId() { + return this.testRunId; + } + + /** + * Set the testRunId property: [Required if testId is not given] Load test run unique identifier. + * + * @param testRunId the testRunId value to set. + * @return the AppComponentsMap object itself. + */ + public AppComponentsMap setTestRunId(String testRunId) { + this.testRunId = testRunId; + return this; + } + + /** + * Get the name property: AppComponent name. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Get the value property: AppComponents Map { resource id (Fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource + * object }. + * + * @return the value value. + */ + public Map getValue() { + return this.value; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java new file mode 100644 index 0000000000000..175cd8b85fc83 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ClientMetricsFilters model. */ +@Fluent +public final class ClientMetricsFilters { + /* + * Test run name for which client metrics filters is required. + */ + @JsonProperty(value = "testRunId") + private String testRunId; + + /* + * The filters property. + */ + @JsonProperty(value = "filters") + private Filters filters; + + /* + * The timeRange property. + */ + @JsonProperty(value = "timeRange") + private TimeRange timeRange; + + /** + * Get the testRunId property: Test run name for which client metrics filters is required. + * + * @return the testRunId value. + */ + public String getTestRunId() { + return this.testRunId; + } + + /** + * Set the testRunId property: Test run name for which client metrics filters is required. + * + * @param testRunId the testRunId value to set. + * @return the ClientMetricsFilters object itself. + */ + public ClientMetricsFilters setTestRunId(String testRunId) { + this.testRunId = testRunId; + return this; + } + + /** + * Get the filters property: The filters property. + * + * @return the filters value. + */ + public Filters getFilters() { + return this.filters; + } + + /** + * Set the filters property: The filters property. + * + * @param filters the filters value to set. + * @return the ClientMetricsFilters object itself. + */ + public ClientMetricsFilters setFilters(Filters filters) { + this.filters = filters; + return this; + } + + /** + * Get the timeRange property: The timeRange property. + * + * @return the timeRange value. + */ + public TimeRange getTimeRange() { + return this.timeRange; + } + + /** + * Set the timeRange property: The timeRange property. + * + * @param timeRange the timeRange value to set. + * @return the ClientMetricsFilters object itself. + */ + public ClientMetricsFilters setTimeRange(TimeRange timeRange) { + this.timeRange = timeRange; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java new file mode 100644 index 0000000000000..92012513734c4 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Client metrics request payload. */ +@Fluent +public final class ClientMetricsRequestModel { + /* + * List of request samplers, maximum supported samplers for queries are 20. In case of empty, it will return + * metrics for maximum 20 samplers + */ + @JsonProperty(value = "requestSamplers") + private List requestSamplers; + + /* + * List of errors, maximum supported errors for queries are 20. In case of empty, by default will return metrics + * for maximum 20 errors + */ + @JsonProperty(value = "errors") + private List errors; + + /* + * List of percentiles values for response time, supported values 50,90,99,95. Default value is 50th percentile. + */ + @JsonProperty(value = "percentiles") + private List percentiles; + + /* + * For test duration less than 10 minutes group by time interval can be any one of 5s,10s,1m,5m.\n\nFor test + * duration greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. Default value is 1m. + */ + @JsonProperty(value = "groupByInterval") + private String groupByInterval; + + /* + * Start time + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * End time + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /** + * Creates an instance of ClientMetricsRequestModel class. + * + * @param startTime the startTime value to set. + * @param endTime the endTime value to set. + */ + @JsonCreator + public ClientMetricsRequestModel( + @JsonProperty(value = "startTime", required = true) OffsetDateTime startTime, + @JsonProperty(value = "endTime", required = true) OffsetDateTime endTime) { + this.startTime = startTime; + this.endTime = endTime; + } + + /** + * Get the requestSamplers property: List of request samplers, maximum supported samplers for queries are 20. In + * case of empty, it will return metrics for maximum 20 samplers. + * + * @return the requestSamplers value. + */ + public List getRequestSamplers() { + return this.requestSamplers; + } + + /** + * Set the requestSamplers property: List of request samplers, maximum supported samplers for queries are 20. In + * case of empty, it will return metrics for maximum 20 samplers. + * + * @param requestSamplers the requestSamplers value to set. + * @return the ClientMetricsRequestModel object itself. + */ + public ClientMetricsRequestModel setRequestSamplers(List requestSamplers) { + this.requestSamplers = requestSamplers; + return this; + } + + /** + * Get the errors property: List of errors, maximum supported errors for queries are 20. In case of empty, by + * default will return metrics for maximum 20 errors. + * + * @return the errors value. + */ + public List getErrors() { + return this.errors; + } + + /** + * Set the errors property: List of errors, maximum supported errors for queries are 20. In case of empty, by + * default will return metrics for maximum 20 errors. + * + * @param errors the errors value to set. + * @return the ClientMetricsRequestModel object itself. + */ + public ClientMetricsRequestModel setErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the percentiles property: List of percentiles values for response time, supported values 50,90,99,95. Default + * value is 50th percentile. + * + * @return the percentiles value. + */ + public List getPercentiles() { + return this.percentiles; + } + + /** + * Set the percentiles property: List of percentiles values for response time, supported values 50,90,99,95. Default + * value is 50th percentile. + * + * @param percentiles the percentiles value to set. + * @return the ClientMetricsRequestModel object itself. + */ + public ClientMetricsRequestModel setPercentiles(List percentiles) { + this.percentiles = percentiles; + return this; + } + + /** + * Get the groupByInterval property: For test duration less than 10 minutes group by time interval can be any one of + * 5s,10s,1m,5m.\n\nFor test duration greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. + * Default value is 1m. + * + * @return the groupByInterval value. + */ + public String getGroupByInterval() { + return this.groupByInterval; + } + + /** + * Set the groupByInterval property: For test duration less than 10 minutes group by time interval can be any one of + * 5s,10s,1m,5m.\n\nFor test duration greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. + * Default value is 1m. + * + * @param groupByInterval the groupByInterval value to set. + * @return the ClientMetricsRequestModel object itself. + */ + public ClientMetricsRequestModel setGroupByInterval(String groupByInterval) { + this.groupByInterval = groupByInterval; + return this; + } + + /** + * Get the startTime property: Start time. + * + * @return the startTime value. + */ + public OffsetDateTime getStartTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time. + * + * @return the endTime value. + */ + public OffsetDateTime getEndTime() { + return this.endTime; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java new file mode 100644 index 0000000000000..524c9d66c68d3 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ClientMetricsResults model. */ +@Fluent +public final class ClientMetricsResults { + /* + * Test run name for which client metrics results is required. + */ + @JsonProperty(value = "testRunId") + private String testRunId; + + /* + * The timeSeries property. + */ + @JsonProperty(value = "timeSeries") + private Series timeSeries; + + /** + * Get the testRunId property: Test run name for which client metrics results is required. + * + * @return the testRunId value. + */ + public String getTestRunId() { + return this.testRunId; + } + + /** + * Set the testRunId property: Test run name for which client metrics results is required. + * + * @param testRunId the testRunId value to set. + * @return the ClientMetricsResults object itself. + */ + public ClientMetricsResults setTestRunId(String testRunId) { + this.testRunId = testRunId; + return this; + } + + /** + * Get the timeSeries property: The timeSeries property. + * + * @return the timeSeries value. + */ + public Series getTimeSeries() { + return this.timeSeries; + } + + /** + * Set the timeSeries property: The timeSeries property. + * + * @param timeSeries the timeSeries value to set. + * @return the ClientMetricsResults object itself. + */ + public ClientMetricsResults setTimeSeries(Series timeSeries) { + this.timeSeries = timeSeries; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java new file mode 100644 index 0000000000000..0da9f7bb76d70 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Default server metrics config. */ +@Fluent +public final class DefaultServerMetricsConfigListModel { + /* + * Default metrics map {resourceType : list of metrics config} (Refer for metrics structure: + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition) + */ + @JsonProperty(value = "defaultMetrics") + private Map> defaultMetrics; + + /** + * Get the defaultMetrics property: Default metrics map {resourceType : list of metrics config} (Refer for metrics + * structure: https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + * + * @return the defaultMetrics value. + */ + public Map> getDefaultMetrics() { + return this.defaultMetrics; + } + + /** + * Set the defaultMetrics property: Default metrics map {resourceType : list of metrics config} (Refer for metrics + * structure: https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + * + * @param defaultMetrics the defaultMetrics value to set. + * @return the DefaultServerMetricsConfigListModel object itself. + */ + public DefaultServerMetricsConfigListModel setDefaultMetrics( + Map> defaultMetrics) { + this.defaultMetrics = defaultMetrics; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java new file mode 100644 index 0000000000000..77df25bfa1f88 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Metrics config model. */ +@Fluent +public final class DefaultServerMetricsConfigModel { + /* + * The metricnamespace property. + */ + @JsonProperty(value = "metricnamespace") + private String metricnamespace; + + /* + * The aggregation property. + */ + @JsonProperty(value = "aggregation") + private String aggregation; + + /* + * The name property. + */ + @JsonProperty(value = "name") + private LocalizedName name; + + /* + * The unit property. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The displayDescription property. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Get the metricnamespace property: The metricnamespace property. + * + * @return the metricnamespace value. + */ + public String getMetricnamespace() { + return this.metricnamespace; + } + + /** + * Set the metricnamespace property: The metricnamespace property. + * + * @param metricnamespace the metricnamespace value to set. + * @return the DefaultServerMetricsConfigModel object itself. + */ + public DefaultServerMetricsConfigModel setMetricnamespace(String metricnamespace) { + this.metricnamespace = metricnamespace; + return this; + } + + /** + * Get the aggregation property: The aggregation property. + * + * @return the aggregation value. + */ + public String getAggregation() { + return this.aggregation; + } + + /** + * Set the aggregation property: The aggregation property. + * + * @param aggregation the aggregation value to set. + * @return the DefaultServerMetricsConfigModel object itself. + */ + public DefaultServerMetricsConfigModel setAggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public LocalizedName getName() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the DefaultServerMetricsConfigModel object itself. + */ + public DefaultServerMetricsConfigModel setName(LocalizedName name) { + this.name = name; + return this; + } + + /** + * Get the unit property: The unit property. + * + * @return the unit value. + */ + public String getUnit() { + return this.unit; + } + + /** + * Set the unit property: The unit property. + * + * @param unit the unit value to set. + * @return the DefaultServerMetricsConfigModel object itself. + */ + public DefaultServerMetricsConfigModel setUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the displayDescription property: The displayDescription property. + * + * @return the displayDescription value. + */ + public String getDisplayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: The displayDescription property. + * + * @param displayDescription the displayDescription value to set. + * @return the DefaultServerMetricsConfigModel object itself. + */ + public DefaultServerMetricsConfigModel setDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java new file mode 100644 index 0000000000000..6cde42082d973 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Error from a REST request. */ +@Fluent +public final class Error { + /* + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The error target. + */ + @JsonProperty(value = "target") + private String target; + + /* + * Additional details and inner errors. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String getCode() { + return this.code; + } + + /** + * Set the code property: The error code. + * + * @param code the code value to set. + * @return the Error object itself. + */ + public Error setCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Set the message property: The error message. + * + * @param message the message value to set. + * @return the Error object itself. + */ + public Error setMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String getTarget() { + return this.target; + } + + /** + * Set the target property: The error target. + * + * @param target the target value to set. + * @return the Error object itself. + */ + public Error setTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details property: Additional details and inner errors. + * + * @return the details value. + */ + public List getDetails() { + return this.details; + } + + /** + * Set the details property: Additional details and inner errors. + * + * @param details the details value to set. + * @return the Error object itself. + */ + public Error setDetails(List details) { + this.details = details; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java new file mode 100644 index 0000000000000..0eb2d138f7b38 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of an error object. */ +@Fluent +public final class ErrorResponseBody { + /* + * Error from a REST request. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get the error property: Error from a REST request. + * + * @return the error value. + */ + public Error getError() { + return this.error; + } + + /** + * Set the error property: Error from a REST request. + * + * @param error the error value to set. + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody setError(Error error) { + this.error = error; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java new file mode 100644 index 0000000000000..00c68b7973bf7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). */ +public final class FileType extends ExpandableStringEnum { + /** Static value 0 for FileType. */ + public static final FileType ZERO = fromInt(0); + + /** Static value 1 for FileType. */ + public static final FileType ONE = fromInt(1); + + /** Static value 2 for FileType. */ + public static final FileType TWO = fromInt(2); + + /** + * Creates or finds a FileType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileType. + */ + @JsonCreator + public static FileType fromInt(int name) { + return fromString(String.valueOf(name), FileType.class); + } + + /** + * Gets known FileType values. + * + * @return known FileType values. + */ + public static Collection values() { + return values(FileType.class); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java new file mode 100644 index 0000000000000..1be29279a48e7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** FileUrl Model. */ +@Fluent +public final class FileUrl { + /* + * File URL. + */ + @JsonProperty(value = "url") + private String url; + + /* + * File unique identifier. + */ + @JsonProperty(value = "fileId") + private String fileId; + + /* + * Name of the file. + */ + @JsonProperty(value = "filename") + private String filename; + + /* + * Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS) + */ + @JsonProperty(value = "fileType") + private FileType fileType; + + /* + * Expiry time of the file + */ + @JsonProperty(value = "expireTime") + private OffsetDateTime expireTime; + + /* + * Validation status of the file + */ + @JsonProperty(value = "validationStatus") + private String validationStatus; + + /** + * Get the url property: File URL. + * + * @return the url value. + */ + public String getUrl() { + return this.url; + } + + /** + * Set the url property: File URL. + * + * @param url the url value to set. + * @return the FileUrl object itself. + */ + public FileUrl setUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the fileId property: File unique identifier. + * + * @return the fileId value. + */ + public String getFileId() { + return this.fileId; + } + + /** + * Set the fileId property: File unique identifier. + * + * @param fileId the fileId value to set. + * @return the FileUrl object itself. + */ + public FileUrl setFileId(String fileId) { + this.fileId = fileId; + return this; + } + + /** + * Get the filename property: Name of the file. + * + * @return the filename value. + */ + public String getFilename() { + return this.filename; + } + + /** + * Set the filename property: Name of the file. + * + * @param filename the filename value to set. + * @return the FileUrl object itself. + */ + public FileUrl setFilename(String filename) { + this.filename = filename; + return this; + } + + /** + * Get the fileType property: Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = + * ADDITIONAL_ARTIFACTS). + * + * @return the fileType value. + */ + public FileType getFileType() { + return this.fileType; + } + + /** + * Set the fileType property: Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = + * ADDITIONAL_ARTIFACTS). + * + * @param fileType the fileType value to set. + * @return the FileUrl object itself. + */ + public FileUrl setFileType(FileType fileType) { + this.fileType = fileType; + return this; + } + + /** + * Get the expireTime property: Expiry time of the file. + * + * @return the expireTime value. + */ + public OffsetDateTime getExpireTime() { + return this.expireTime; + } + + /** + * Set the expireTime property: Expiry time of the file. + * + * @param expireTime the expireTime value to set. + * @return the FileUrl object itself. + */ + public FileUrl setExpireTime(OffsetDateTime expireTime) { + this.expireTime = expireTime; + return this; + } + + /** + * Get the validationStatus property: Validation status of the file. + * + * @return the validationStatus value. + */ + public String getValidationStatus() { + return this.validationStatus; + } + + /** + * Set the validationStatus property: Validation status of the file. + * + * @param validationStatus the validationStatus value to set. + * @return the FileUrl object itself. + */ + public FileUrl setValidationStatus(String validationStatus) { + this.validationStatus = validationStatus; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java new file mode 100644 index 0000000000000..38abbb51c353b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The FileUrlList model. */ +@Fluent +public final class FileUrlList { + /* + * List of file URLs. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link for the next list of file URLs, if applicable + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of FileUrlList class. + * + * @param value the value value to set. + */ + @JsonCreator + public FileUrlList(@JsonProperty(value = "value", required = true) List value) { + this.value = value; + } + + /** + * Get the value property: List of file URLs. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: Link for the next list of file URLs, if applicable. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next list of file URLs, if applicable. + * + * @param nextLink the nextLink value to set. + * @return the FileUrlList object itself. + */ + public FileUrlList setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java new file mode 100644 index 0000000000000..f2ebb85169d09 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Filters model. */ +@Fluent +public final class Filters { + /* + * List of request sampler for the test run, for which client metrics can be filtered. + */ + @JsonProperty(value = "requestSamplerValues") + private List requestSamplerValues; + + /* + * List of errors occurred for the test run, for which client metrics can be filtered. + */ + @JsonProperty(value = "errorFiltersValues") + private List errorFiltersValues; + + /** + * Get the requestSamplerValues property: List of request sampler for the test run, for which client metrics can be + * filtered. + * + * @return the requestSamplerValues value. + */ + public List getRequestSamplerValues() { + return this.requestSamplerValues; + } + + /** + * Set the requestSamplerValues property: List of request sampler for the test run, for which client metrics can be + * filtered. + * + * @param requestSamplerValues the requestSamplerValues value to set. + * @return the Filters object itself. + */ + public Filters setRequestSamplerValues(List requestSamplerValues) { + this.requestSamplerValues = requestSamplerValues; + return this; + } + + /** + * Get the errorFiltersValues property: List of errors occurred for the test run, for which client metrics can be + * filtered. + * + * @return the errorFiltersValues value. + */ + public List getErrorFiltersValues() { + return this.errorFiltersValues; + } + + /** + * Set the errorFiltersValues property: List of errors occurred for the test run, for which client metrics can be + * filtered. + * + * @param errorFiltersValues the errorFiltersValues value to set. + * @return the Filters object itself. + */ + public Filters setErrorFiltersValues(List errorFiltersValues) { + this.errorFiltersValues = errorFiltersValues; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java new file mode 100644 index 0000000000000..0b6a7c3ca38c2 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The input artifacts for the test. */ +@Fluent +public final class InputTestArtifacts { + /* + * FileUrl Model. + */ + @JsonProperty(value = "configUrl") + private FileUrl configUrl; + + /* + * FileUrl Model. + */ + @JsonProperty(value = "testScriptUrl") + private FileUrl testScriptUrl; + + /* + * FileUrl Model. + */ + @JsonProperty(value = "userPropUrl") + private FileUrl userPropUrl; + + /* + * FileUrl Model. + */ + @JsonProperty(value = "inputArtifactsZipFileurl") + private FileUrl inputArtifactsZipFileurl; + + /* + * The input artifacts file { name : url } map for the test run. + */ + @JsonProperty(value = "additionalUrls", access = JsonProperty.Access.WRITE_ONLY) + private List additionalUrls; + + /** + * Get the configUrl property: FileUrl Model. + * + * @return the configUrl value. + */ + public FileUrl getConfigUrl() { + return this.configUrl; + } + + /** + * Set the configUrl property: FileUrl Model. + * + * @param configUrl the configUrl value to set. + * @return the InputTestArtifacts object itself. + */ + public InputTestArtifacts setConfigUrl(FileUrl configUrl) { + this.configUrl = configUrl; + return this; + } + + /** + * Get the testScriptUrl property: FileUrl Model. + * + * @return the testScriptUrl value. + */ + public FileUrl getTestScriptUrl() { + return this.testScriptUrl; + } + + /** + * Set the testScriptUrl property: FileUrl Model. + * + * @param testScriptUrl the testScriptUrl value to set. + * @return the InputTestArtifacts object itself. + */ + public InputTestArtifacts setTestScriptUrl(FileUrl testScriptUrl) { + this.testScriptUrl = testScriptUrl; + return this; + } + + /** + * Get the userPropUrl property: FileUrl Model. + * + * @return the userPropUrl value. + */ + public FileUrl getUserPropUrl() { + return this.userPropUrl; + } + + /** + * Set the userPropUrl property: FileUrl Model. + * + * @param userPropUrl the userPropUrl value to set. + * @return the InputTestArtifacts object itself. + */ + public InputTestArtifacts setUserPropUrl(FileUrl userPropUrl) { + this.userPropUrl = userPropUrl; + return this; + } + + /** + * Get the inputArtifactsZipFileurl property: FileUrl Model. + * + * @return the inputArtifactsZipFileurl value. + */ + public FileUrl getInputArtifactsZipFileurl() { + return this.inputArtifactsZipFileurl; + } + + /** + * Set the inputArtifactsZipFileurl property: FileUrl Model. + * + * @param inputArtifactsZipFileurl the inputArtifactsZipFileurl value to set. + * @return the InputTestArtifacts object itself. + */ + public InputTestArtifacts setInputArtifactsZipFileurl(FileUrl inputArtifactsZipFileurl) { + this.inputArtifactsZipFileurl = inputArtifactsZipFileurl; + return this; + } + + /** + * Get the additionalUrls property: The input artifacts file { name : url } map for the test run. + * + * @return the additionalUrls value. + */ + public List getAdditionalUrls() { + return this.additionalUrls; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java new file mode 100644 index 0000000000000..ab6588f7fa6bd --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The load test configuration. */ +@Fluent +public final class LoadTestConfig { + /* + * The number of engine instances to execute load test. Supported values are in range of 1-45. Required for + * creating a new test. + */ + @JsonProperty(value = "engineInstances") + private Integer engineInstances; + + /* + * Whether all the input CSV files should be split evenly across all engines. + */ + @JsonProperty(value = "splitAllCSVs") + private Boolean splitAllCSVs; + + /** + * Get the engineInstances property: The number of engine instances to execute load test. Supported values are in + * range of 1-45. Required for creating a new test. + * + * @return the engineInstances value. + */ + public Integer getEngineInstances() { + return this.engineInstances; + } + + /** + * Set the engineInstances property: The number of engine instances to execute load test. Supported values are in + * range of 1-45. Required for creating a new test. + * + * @param engineInstances the engineInstances value to set. + * @return the LoadTestConfig object itself. + */ + public LoadTestConfig setEngineInstances(Integer engineInstances) { + this.engineInstances = engineInstances; + return this; + } + + /** + * Get the splitAllCSVs property: Whether all the input CSV files should be split evenly across all engines. + * + * @return the splitAllCSVs value. + */ + public Boolean isSplitAllCSVs() { + return this.splitAllCSVs; + } + + /** + * Set the splitAllCSVs property: Whether all the input CSV files should be split evenly across all engines. + * + * @param splitAllCSVs the splitAllCSVs value to set. + * @return the LoadTestConfig object itself. + */ + public LoadTestConfig setSplitAllCSVs(Boolean splitAllCSVs) { + this.splitAllCSVs = splitAllCSVs; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java new file mode 100644 index 0000000000000..80a5e50ad2cd1 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LocalizedName model. */ +@Fluent +public final class LocalizedName { + /* + * The value property. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The localizedValue property. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public String getValue() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the LocalizedName object itself. + */ + public LocalizedName setValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: The localizedValue property. + * + * @return the localizedValue value. + */ + public String getLocalizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: The localizedValue property. + * + * @param localizedValue the localizedValue value to set. + * @return the LocalizedName object itself. + */ + public LocalizedName setLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java new file mode 100644 index 0000000000000..834308e57edef --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The output artifacts for the test run. */ +@Fluent +public final class OutputTestArtifacts { + /* + * FileUrl Model. + */ + @JsonProperty(value = "resultUrl") + private FileUrl resultUrl; + + /* + * FileUrl Model. + */ + @JsonProperty(value = "logsUrl") + private FileUrl logsUrl; + + /** + * Get the resultUrl property: FileUrl Model. + * + * @return the resultUrl value. + */ + public FileUrl getResultUrl() { + return this.resultUrl; + } + + /** + * Set the resultUrl property: FileUrl Model. + * + * @param resultUrl the resultUrl value to set. + * @return the OutputTestArtifacts object itself. + */ + public OutputTestArtifacts setResultUrl(FileUrl resultUrl) { + this.resultUrl = resultUrl; + return this; + } + + /** + * Get the logsUrl property: FileUrl Model. + * + * @return the logsUrl value. + */ + public FileUrl getLogsUrl() { + return this.logsUrl; + } + + /** + * Set the logsUrl property: FileUrl Model. + * + * @param logsUrl the logsUrl value to set. + * @return the OutputTestArtifacts object itself. + */ + public OutputTestArtifacts setLogsUrl(FileUrl logsUrl) { + this.logsUrl = logsUrl; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java new file mode 100644 index 0000000000000..1d4df534f051b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Pass fail criteria for a test. */ +@Fluent +public final class PassFailCriteria { + /* + * Map of id and pass fail metrics { id : pass fail metrics }. + */ + @JsonProperty(value = "passFailMetrics") + private Map passFailMetrics; + + /** + * Get the passFailMetrics property: Map of id and pass fail metrics { id : pass fail metrics }. + * + * @return the passFailMetrics value. + */ + public Map getPassFailMetrics() { + return this.passFailMetrics; + } + + /** + * Set the passFailMetrics property: Map of id and pass fail metrics { id : pass fail metrics }. + * + * @param passFailMetrics the passFailMetrics value to set. + * @return the PassFailCriteria object itself. + */ + public PassFailCriteria setPassFailMetrics(Map passFailMetrics) { + this.passFailMetrics = passFailMetrics; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java new file mode 100644 index 0000000000000..fd2b1b6c0b64e --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PassFailMetric model. */ +@Fluent +public final class PassFailMetric { + /* + * The client metric on which the criteria should be applied. Allowed values - ‘response_time_ms’ , ‘latency’, + * ‘error’, ‘requests’, ‘requests_per_sec’. + */ + @JsonProperty(value = "clientmetric") + private String clientmetric; + + /* + * The aggregation function to be applied on the client metric. Allowed functions - ‘percentage’ - for error metric + * ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and latency metric, ‘avg’ - for + * requests_per_sec, ‘count’ - for requests. + */ + @JsonProperty(value = "aggregate") + private String aggregate; + + /* + * The comparison operator. Supported types ‘>’ + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Request name for which the Pass fail criteria has to be applied. + */ + @JsonProperty(value = "requestName") + private String requestName; + + /* + * The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] unit- % ’, response_time_ms + * and latency : any integer value unit- ms. + */ + @JsonProperty(value = "value") + private Double value; + + /* + * Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. + */ + @JsonProperty(value = "action") + private String action; + + /* + * The actual value of the client metric for the test run. + */ + @JsonProperty(value = "actualValue", access = JsonProperty.Access.WRITE_ONLY) + private Double actualValue; + + /* + * Outcome of the test run. possible outcome - ‘passed’ , ‘failed’ , ‘undetermined’. + */ + @JsonProperty(value = "result", access = JsonProperty.Access.WRITE_ONLY) + private String result; + + /** + * Get the clientmetric property: The client metric on which the criteria should be applied. Allowed values - + * ‘response_time_ms’ , ‘latency’, ‘error’, ‘requests’, ‘requests_per_sec’. + * + * @return the clientmetric value. + */ + public String getClientmetric() { + return this.clientmetric; + } + + /** + * Set the clientmetric property: The client metric on which the criteria should be applied. Allowed values - + * ‘response_time_ms’ , ‘latency’, ‘error’, ‘requests’, ‘requests_per_sec’. + * + * @param clientmetric the clientmetric value to set. + * @return the PassFailMetric object itself. + */ + public PassFailMetric setClientmetric(String clientmetric) { + this.clientmetric = clientmetric; + return this; + } + + /** + * Get the aggregate property: The aggregation function to be applied on the client metric. Allowed functions - + * ‘percentage’ - for error metric ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and + * latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests. + * + * @return the aggregate value. + */ + public String getAggregate() { + return this.aggregate; + } + + /** + * Set the aggregate property: The aggregation function to be applied on the client metric. Allowed functions - + * ‘percentage’ - for error metric ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and + * latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests. + * + * @param aggregate the aggregate value to set. + * @return the PassFailMetric object itself. + */ + public PassFailMetric setAggregate(String aggregate) { + this.aggregate = aggregate; + return this; + } + + /** + * Get the condition property: The comparison operator. Supported types ‘>’. + * + * @return the condition value. + */ + public String getCondition() { + return this.condition; + } + + /** + * Set the condition property: The comparison operator. Supported types ‘>’. + * + * @param condition the condition value to set. + * @return the PassFailMetric object itself. + */ + public PassFailMetric setCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the requestName property: Request name for which the Pass fail criteria has to be applied. + * + * @return the requestName value. + */ + public String getRequestName() { + return this.requestName; + } + + /** + * Set the requestName property: Request name for which the Pass fail criteria has to be applied. + * + * @param requestName the requestName value to set. + * @return the PassFailMetric object itself. + */ + public PassFailMetric setRequestName(String requestName) { + this.requestName = requestName; + return this; + } + + /** + * Get the value property: The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] + * unit- % ’, response_time_ms and latency : any integer value unit- ms. + * + * @return the value value. + */ + public Double getValue() { + return this.value; + } + + /** + * Set the value property: The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] + * unit- % ’, response_time_ms and latency : any integer value unit- ms. + * + * @param value the value value to set. + * @return the PassFailMetric object itself. + */ + public PassFailMetric setValue(Double value) { + this.value = value; + return this; + } + + /** + * Get the action property: Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. + * + * @return the action value. + */ + public String getAction() { + return this.action; + } + + /** + * Set the action property: Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. + * + * @param action the action value to set. + * @return the PassFailMetric object itself. + */ + public PassFailMetric setAction(String action) { + this.action = action; + return this; + } + + /** + * Get the actualValue property: The actual value of the client metric for the test run. + * + * @return the actualValue value. + */ + public Double getActualValue() { + return this.actualValue; + } + + /** + * Get the result property: Outcome of the test run. possible outcome - ‘passed’ , ‘failed’ , ‘undetermined’. + * + * @return the result value. + */ + public String getResult() { + return this.result; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java new file mode 100644 index 0000000000000..a01119f47e1a0 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Associated metric definition for particular metrics of the azure resource ( Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + */ +@Fluent +public final class ResourceMetricModel { + /* + * Unique identifier for metric. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Azure resource Id. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * Metric name space. + */ + @JsonProperty(value = "metricnamespace", required = true) + private String metricnamespace; + + /* + * Metric description. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Metric name object. + */ + @JsonProperty(value = "name", required = true) + private ServerMetricName name; + + /* + * Metric aggregation. + */ + @JsonProperty(value = "aggregation", required = true) + private String aggregation; + + /* + * Metric unit. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Azure resource type. + */ + @JsonProperty(value = "resourceType", required = true) + private String resourceType; + + /** + * Creates an instance of ResourceMetricModel class. + * + * @param resourceId the resourceId value to set. + * @param metricnamespace the metricnamespace value to set. + * @param name the name value to set. + * @param aggregation the aggregation value to set. + * @param resourceType the resourceType value to set. + */ + @JsonCreator + public ResourceMetricModel( + @JsonProperty(value = "resourceId", required = true) String resourceId, + @JsonProperty(value = "metricnamespace", required = true) String metricnamespace, + @JsonProperty(value = "name", required = true) ServerMetricName name, + @JsonProperty(value = "aggregation", required = true) String aggregation, + @JsonProperty(value = "resourceType", required = true) String resourceType) { + this.resourceId = resourceId; + this.metricnamespace = metricnamespace; + this.name = name; + this.aggregation = aggregation; + this.resourceType = resourceType; + } + + /** + * Get the id property: Unique identifier for metric. + * + * @return the id value. + */ + public String getId() { + return this.id; + } + + /** + * Get the resourceId property: Azure resource Id. + * + * @return the resourceId value. + */ + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the metricnamespace property: Metric name space. + * + * @return the metricnamespace value. + */ + public String getMetricnamespace() { + return this.metricnamespace; + } + + /** + * Get the displayDescription property: Metric description. + * + * @return the displayDescription value. + */ + public String getDisplayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Metric description. + * + * @param displayDescription the displayDescription value to set. + * @return the ResourceMetricModel object itself. + */ + public ResourceMetricModel setDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the name property: Metric name object. + * + * @return the name value. + */ + public ServerMetricName getName() { + return this.name; + } + + /** + * Get the aggregation property: Metric aggregation. + * + * @return the aggregation value. + */ + public String getAggregation() { + return this.aggregation; + } + + /** + * Get the unit property: Metric unit. + * + * @return the unit value. + */ + public String getUnit() { + return this.unit; + } + + /** + * Set the unit property: Metric unit. + * + * @param unit the unit value to set. + * @return the ResourceMetricModel object itself. + */ + public ResourceMetricModel setUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the resourceType property: Azure resource type. + * + * @return the resourceType value. + */ + public String getResourceType() { + return this.resourceType; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java new file mode 100644 index 0000000000000..c917db6cb083b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SecretMetadata model. */ +@Fluent +public final class SecretMetadata { + /* + * The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE + */ + @JsonProperty(value = "value") + private String value; + + /* + * Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the value property: The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE. + * + * @return the value value. + */ + public String getValue() { + return this.value; + } + + /** + * Set the value property: The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE. + * + * @param value the value value to set. + * @return the SecretMetadata object itself. + */ + public SecretMetadata setValue(String value) { + this.value = value; + return this; + } + + /** + * Get the type property: Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE. + * + * @return the type value. + */ + public String getType() { + return this.type; + } + + /** + * Set the type property: Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE. + * + * @param type the type value to set. + * @return the SecretMetadata object itself. + */ + public SecretMetadata setType(String type) { + this.type = type; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java new file mode 100644 index 0000000000000..f79156aacfcfe --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The Series model. */ +@Fluent +public final class Series { + /* + * Active users time series data. + */ + @JsonProperty(value = "activeUsers") + private Map> activeUsers; + + /* + * Response time, time series data. + */ + @JsonProperty(value = "responseTime") + private Map> responseTime; + + /* + * Throughput time series data. + */ + @JsonProperty(value = "throughput") + private Map> throughput; + + /* + * Errors time series data. + */ + @JsonProperty(value = "errors") + private Map> errors; + + /** + * Get the activeUsers property: Active users time series data. + * + * @return the activeUsers value. + */ + public Map> getActiveUsers() { + return this.activeUsers; + } + + /** + * Set the activeUsers property: Active users time series data. + * + * @param activeUsers the activeUsers value to set. + * @return the Series object itself. + */ + public Series setActiveUsers(Map> activeUsers) { + this.activeUsers = activeUsers; + return this; + } + + /** + * Get the responseTime property: Response time, time series data. + * + * @return the responseTime value. + */ + public Map> getResponseTime() { + return this.responseTime; + } + + /** + * Set the responseTime property: Response time, time series data. + * + * @param responseTime the responseTime value to set. + * @return the Series object itself. + */ + public Series setResponseTime(Map> responseTime) { + this.responseTime = responseTime; + return this; + } + + /** + * Get the throughput property: Throughput time series data. + * + * @return the throughput value. + */ + public Map> getThroughput() { + return this.throughput; + } + + /** + * Set the throughput property: Throughput time series data. + * + * @param throughput the throughput value to set. + * @return the Series object itself. + */ + public Series setThroughput(Map> throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the errors property: Errors time series data. + * + * @return the errors value. + */ + public Map> getErrors() { + return this.errors; + } + + /** + * Set the errors property: Errors time series data. + * + * @param errors the errors value to set. + * @return the Series object itself. + */ + public Series setErrors(Map> errors) { + this.errors = errors; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java new file mode 100644 index 0000000000000..d98943bfe3d3a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Metric name object. */ +@Fluent +public final class ServerMetricName { + /* + * Metric name value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Metric localized name. + */ + @JsonProperty(value = "localizedValue", required = true) + private String localizedValue; + + /** + * Creates an instance of ServerMetricName class. + * + * @param value the value value to set. + * @param localizedValue the localizedValue value to set. + */ + @JsonCreator + public ServerMetricName( + @JsonProperty(value = "value", required = true) String value, + @JsonProperty(value = "localizedValue", required = true) String localizedValue) { + this.value = value; + this.localizedValue = localizedValue; + } + + /** + * Get the value property: Metric name value. + * + * @return the value value. + */ + public String getValue() { + return this.value; + } + + /** + * Get the localizedValue property: Metric localized name. + * + * @return the localizedValue value. + */ + public String getLocalizedValue() { + return this.localizedValue; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java new file mode 100644 index 0000000000000..1fbe5868da2da --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Server metrics config model. */ +@Fluent +public final class ServerMetricsModel { + /* + * Server metrics config name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * [Required, if testRunId is not given] Load test unique identifier + */ + @JsonProperty(value = "testId") + private String testId; + + /* + * [Required, if testId is not given] Load test run unique identifier + */ + @JsonProperty(value = "testRunId") + private String testRunId; + + /* + * Metrics map {metric id : metrics object} (Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). + */ + @JsonProperty(value = "metrics") + private Map metrics; + + /** + * Get the name property: Server metrics config name. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Get the testId property: [Required, if testRunId is not given] Load test unique identifier. + * + * @return the testId value. + */ + public String getTestId() { + return this.testId; + } + + /** + * Set the testId property: [Required, if testRunId is not given] Load test unique identifier. + * + * @param testId the testId value to set. + * @return the ServerMetricsModel object itself. + */ + public ServerMetricsModel setTestId(String testId) { + this.testId = testId; + return this; + } + + /** + * Get the testRunId property: [Required, if testId is not given] Load test run unique identifier. + * + * @return the testRunId value. + */ + public String getTestRunId() { + return this.testRunId; + } + + /** + * Set the testRunId property: [Required, if testId is not given] Load test run unique identifier. + * + * @param testRunId the testRunId value to set. + * @return the ServerMetricsModel object itself. + */ + public ServerMetricsModel setTestRunId(String testRunId) { + this.testRunId = testRunId; + return this; + } + + /** + * Get the metrics property: Metrics map {metric id : metrics object} (Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). + * + * @return the metrics value. + */ + public Map getMetrics() { + return this.metrics; + } + + /** + * Set the metrics property: Metrics map {metric id : metrics object} (Refer : + * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). + * + * @param metrics the metrics value to set. + * @return the ServerMetricsModel object itself. + */ + public ServerMetricsModel setMetrics(Map metrics) { + this.metrics = metrics; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java new file mode 100644 index 0000000000000..8497b87d0b7de --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Supported azure resource types for App Component like Microsoft.LoadTestService/loadtests, Microsoft.ClassicCompute, + * Microsoft.ClassicStorage etc. (Refer for full list of available resource types in azure : + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types, some of them + * we are supporting for server side metrics configuration). + */ +@Fluent +public final class SupportedResourceType { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the SupportedResourceType object itself. + */ + public SupportedResourceType setValue(List value) { + this.value = value; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java new file mode 100644 index 0000000000000..1abc3b20383f5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TestArtifacts model. */ +@Fluent +public final class TestArtifacts { + /* + * The input artifacts for the test. + */ + @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.READ_WRITE) + private InputTestArtifacts inputArtifacts; + + /* + * The output artifacts for the test run. + */ + @JsonProperty(value = "outputArtifacts") + private OutputTestArtifacts outputArtifacts; + + /** + * Creates an instance of TestArtifacts class. + * + * @param inputArtifacts the inputArtifacts value to set. + */ + @JsonCreator + public TestArtifacts( + @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.READ_WRITE) + InputTestArtifacts inputArtifacts) { + this.inputArtifacts = inputArtifacts; + } + + /** + * Get the inputArtifacts property: The input artifacts for the test. + * + * @return the inputArtifacts value. + */ + public InputTestArtifacts getInputArtifacts() { + return this.inputArtifacts; + } + + /** + * Get the outputArtifacts property: The output artifacts for the test run. + * + * @return the outputArtifacts value. + */ + public OutputTestArtifacts getOutputArtifacts() { + return this.outputArtifacts; + } + + /** + * Set the outputArtifacts property: The output artifacts for the test run. + * + * @param outputArtifacts the outputArtifacts value to set. + * @return the TestArtifacts object itself. + */ + public TestArtifacts setInputArtifacts(InputTestArtifacts inputArtifacts) { + this.inputArtifacts = inputArtifacts; + return this; + } + + /** + * Set the outputArtifacts property: The output artifacts for the test run. + * + * @param outputArtifacts the outputArtifacts value to set. + * @return the TestArtifacts object itself. + */ + public TestArtifacts setOutputArtifacts(OutputTestArtifacts outputArtifacts) { + this.outputArtifacts = outputArtifacts; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java new file mode 100644 index 0000000000000..2618c24a5276d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Load test model. */ +@Fluent +public final class TestModel { + /* + * Unique test name as identifier. + */ + @JsonProperty(value = "testId", access = JsonProperty.Access.WRITE_ONLY) + private String testId; + + /* + * The test description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Display name of a test. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Fully qualified resource Id e.g + * /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * The load test configuration. + */ + @JsonProperty(value = "loadTestConfig") + private LoadTestConfig loadTestConfig; + + /* + * Pass fail criteria for a test. + */ + @JsonProperty(value = "passFailCriteria") + private PassFailCriteria passFailCriteria; + + /* + * The created DateTime(ISO 8601 literal format) of the test model. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The user that created the test model. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private String createdBy; + + /* + * The last Modified DateTime(ISO 8601 literal format) of the test model. + */ + @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified the test model. + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedBy; + + /* + * The input artifacts for the test. + */ + @JsonProperty(value = "inputArtifacts", access = JsonProperty.Access.WRITE_ONLY) + private InputTestArtifacts inputArtifacts; + + /* + * Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key + * Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. + */ + @JsonProperty(value = "secrets") + private Map secrets; + + /* + * Environment variables which are defined as a set of pairs. + */ + @JsonProperty(value = "environmentVariables") + private Map environmentVariables; + + /* + * Subnet ID on which the load test instances should run. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /* + * Type of the managed identity referencing the Key vault. + */ + @JsonProperty(value = "keyvaultReferenceIdentityType") + private String keyvaultReferenceIdentityType; + + /* + * Resource Id of the managed identity referencing the Key vault. + */ + @JsonProperty(value = "keyvaultReferenceIdentityId") + private String keyvaultReferenceIdentityId; + + /** + * Get the testId property: Unique test name as identifier. + * + * @return the testId value. + */ + public String getTestId() { + return this.testId; + } + + /** + * Get the description property: The test description. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The test description. + * + * @param description the description value to set. + * @return the TestModel object itself. + */ + public TestModel setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the displayName property: Display name of a test. + * + * @return the displayName value. + */ + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of a test. + * + * @param displayName the displayName value to set. + * @return the TestModel object itself. + */ + public TestModel setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the resourceId property: Fully qualified resource Id e.g + * /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * @return the resourceId value. + */ + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the loadTestConfig property: The load test configuration. + * + * @return the loadTestConfig value. + */ + public LoadTestConfig getLoadTestConfig() { + return this.loadTestConfig; + } + + /** + * Set the loadTestConfig property: The load test configuration. + * + * @param loadTestConfig the loadTestConfig value to set. + * @return the TestModel object itself. + */ + public TestModel setLoadTestConfig(LoadTestConfig loadTestConfig) { + this.loadTestConfig = loadTestConfig; + return this; + } + + /** + * Get the passFailCriteria property: Pass fail criteria for a test. + * + * @return the passFailCriteria value. + */ + public PassFailCriteria getPassFailCriteria() { + return this.passFailCriteria; + } + + /** + * Set the passFailCriteria property: Pass fail criteria for a test. + * + * @param passFailCriteria the passFailCriteria value to set. + * @return the TestModel object itself. + */ + public TestModel setPassFailCriteria(PassFailCriteria passFailCriteria) { + this.passFailCriteria = passFailCriteria; + return this; + } + + /** + * Get the createdDateTime property: The created DateTime(ISO 8601 literal format) of the test model. + * + * @return the createdDateTime value. + */ + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created the test model. + * + * @return the createdBy value. + */ + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified DateTime(ISO 8601 literal format) of the test model. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified the test model. + * + * @return the lastModifiedBy value. + */ + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Get the inputArtifacts property: The input artifacts for the test. + * + * @return the inputArtifacts value. + */ + public InputTestArtifacts getInputArtifacts() { + return this.inputArtifacts; + } + + /** + * Get the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is + * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If + * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. + * + * @return the secrets value. + */ + public Map getSecrets() { + return this.secrets; + } + + /** + * Set the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is + * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If + * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. + * + * @param secrets the secrets value to set. + * @return the TestModel object itself. + */ + public TestModel setSecrets(Map secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @return the environmentVariables value. + */ + public Map getEnvironmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @param environmentVariables the environmentVariables value to set. + * @return the TestModel object itself. + */ + public TestModel setEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the subnetId property: Subnet ID on which the load test instances should run. + * + * @return the subnetId value. + */ + public String getSubnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Subnet ID on which the load test instances should run. + * + * @param subnetId the subnetId value to set. + * @return the TestModel object itself. + */ + public TestModel setSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the keyvaultReferenceIdentityType property: Type of the managed identity referencing the Key vault. + * + * @return the keyvaultReferenceIdentityType value. + */ + public String getKeyvaultReferenceIdentityType() { + return this.keyvaultReferenceIdentityType; + } + + /** + * Set the keyvaultReferenceIdentityType property: Type of the managed identity referencing the Key vault. + * + * @param keyvaultReferenceIdentityType the keyvaultReferenceIdentityType value to set. + * @return the TestModel object itself. + */ + public TestModel setKeyvaultReferenceIdentityType(String keyvaultReferenceIdentityType) { + this.keyvaultReferenceIdentityType = keyvaultReferenceIdentityType; + return this; + } + + /** + * Get the keyvaultReferenceIdentityId property: Resource Id of the managed identity referencing the Key vault. + * + * @return the keyvaultReferenceIdentityId value. + */ + public String getKeyvaultReferenceIdentityId() { + return this.keyvaultReferenceIdentityId; + } + + /** + * Set the keyvaultReferenceIdentityId property: Resource Id of the managed identity referencing the Key vault. + * + * @param keyvaultReferenceIdentityId the keyvaultReferenceIdentityId value to set. + * @return the TestModel object itself. + */ + public TestModel setKeyvaultReferenceIdentityId(String keyvaultReferenceIdentityId) { + this.keyvaultReferenceIdentityId = keyvaultReferenceIdentityId; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java new file mode 100644 index 0000000000000..e965cac8b2a04 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Resources. */ +@Fluent +public final class TestModelResourceList { + /* + * List of Resources + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link for the next list of resources in case of paginated results, if applicable + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of TestModelResourceList class. + * + * @param value the value value to set. + */ + @JsonCreator + public TestModelResourceList(@JsonProperty(value = "value", required = true) List value) { + this.value = value; + } + + /** + * Get the value property: List of Resources. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: Link for the next list of resources in case of paginated results, if applicable. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next list of resources in case of paginated results, if applicable. + * + * @param nextLink the nextLink value to set. + * @return the TestModelResourceList object itself. + */ + public TestModelResourceList setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java new file mode 100644 index 0000000000000..610b9a2f1af85 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Load test run model. */ +@Fluent +public final class TestRunModel { + /* + * Unique test run name as identifier. + */ + @JsonProperty(value = "testRunId", access = JsonProperty.Access.WRITE_ONLY) + private String testRunId; + + /* + * Display name of a test run. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Associated test Id. + */ + @JsonProperty(value = "testId") + private String testId; + + /* + * Load test resource Id. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * The test run description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The test run status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The test run start DateTime(ISO 8601 literal format). + */ + @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDateTime; + + /* + * The test run end DateTime(ISO 8601 literal format). + */ + @JsonProperty(value = "endDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endDateTime; + + /* + * The load test configuration. + */ + @JsonProperty(value = "loadTestConfig") + private LoadTestConfig loadTestConfig; + + /* + * Test result for pass/Fail criteria used during the test run. possible outcome - ‘Passed’ , ‘Failed’ , ‘Not + * Applicable’. + */ + @JsonProperty(value = "testResult", access = JsonProperty.Access.WRITE_ONLY) + private String testResult; + + /* + * Pass fail criteria for a test. + */ + @JsonProperty(value = "passFailCriteria") + private PassFailCriteria passFailCriteria; + + /* + * The testArtifacts property. + */ + @JsonProperty(value = "testArtifacts", access = JsonProperty.Access.WRITE_ONLY) + private TestArtifacts testArtifacts; + + /* + * Test run initiated time + */ + @JsonProperty(value = "executedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime executedDateTime; + + /* + * Number of virtual users, for which test has been run. + */ + @JsonProperty(value = "vusers", access = JsonProperty.Access.WRITE_ONLY) + private Integer vusers; + + /* + * Test run statistics + */ + @JsonProperty(value = "testRunStatistics", access = JsonProperty.Access.WRITE_ONLY) + private Map testRunStatistics; + + /* + * The created DateTime(ISO 8601 literal format) of the test run. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The user that created the test run. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private String createdBy; + + /* + * The last updated DateTime(ISO 8601 literal format) of the test run. + */ + @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that updated the test run. + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedBy; + + /* + * Portal url. + */ + @JsonProperty(value = "portalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String portalUrl; + + /* + * Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key + * Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. + */ + @JsonProperty(value = "secrets") + private Map secrets; + + /* + * Environment variables which are defined as a set of pairs. + */ + @JsonProperty(value = "environmentVariables") + private Map environmentVariables; + + /* + * Test run duration in milliseconds. + */ + @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY) + private Long duration; + + /* + * Subnet ID on which the load test instances should run. + */ + @JsonProperty(value = "subnetId", access = JsonProperty.Access.WRITE_ONLY) + private String subnetId; + + /** + * Get the testRunId property: Unique test run name as identifier. + * + * @return the testRunId value. + */ + public String getTestRunId() { + return this.testRunId; + } + + /** + * Get the displayName property: Display name of a test run. + * + * @return the displayName value. + */ + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of a test run. + * + * @param displayName the displayName value to set. + * @return the TestRunModel object itself. + */ + public TestRunModel setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the testId property: Associated test Id. + * + * @return the testId value. + */ + public String getTestId() { + return this.testId; + } + + /** + * Set the testId property: Associated test Id. + * + * @param testId the testId value to set. + * @return the TestRunModel object itself. + */ + public TestRunModel setTestId(String testId) { + this.testId = testId; + return this; + } + + /** + * Get the resourceId property: Load test resource Id. + * + * @return the resourceId value. + */ + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the description property: The test run description. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The test run description. + * + * @param description the description value to set. + * @return the TestRunModel object itself. + */ + public TestRunModel setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: The test run status. + * + * @return the status value. + */ + public String getStatus() { + return this.status; + } + + /** + * Get the startDateTime property: The test run start DateTime(ISO 8601 literal format). + * + * @return the startDateTime value. + */ + public OffsetDateTime getStartDateTime() { + return this.startDateTime; + } + + /** + * Get the endDateTime property: The test run end DateTime(ISO 8601 literal format). + * + * @return the endDateTime value. + */ + public OffsetDateTime getEndDateTime() { + return this.endDateTime; + } + + /** + * Get the loadTestConfig property: The load test configuration. + * + * @return the loadTestConfig value. + */ + public LoadTestConfig getLoadTestConfig() { + return this.loadTestConfig; + } + + /** + * Set the loadTestConfig property: The load test configuration. + * + * @param loadTestConfig the loadTestConfig value to set. + * @return the TestRunModel object itself. + */ + public TestRunModel setLoadTestConfig(LoadTestConfig loadTestConfig) { + this.loadTestConfig = loadTestConfig; + return this; + } + + /** + * Get the testResult property: Test result for pass/Fail criteria used during the test run. possible outcome - + * ‘Passed’ , ‘Failed’ , ‘Not Applicable’. + * + * @return the testResult value. + */ + public String getTestResult() { + return this.testResult; + } + + /** + * Get the passFailCriteria property: Pass fail criteria for a test. + * + * @return the passFailCriteria value. + */ + public PassFailCriteria getPassFailCriteria() { + return this.passFailCriteria; + } + + /** + * Set the passFailCriteria property: Pass fail criteria for a test. + * + * @param passFailCriteria the passFailCriteria value to set. + * @return the TestRunModel object itself. + */ + public TestRunModel setPassFailCriteria(PassFailCriteria passFailCriteria) { + this.passFailCriteria = passFailCriteria; + return this; + } + + /** + * Get the testArtifacts property: The testArtifacts property. + * + * @return the testArtifacts value. + */ + public TestArtifacts getTestArtifacts() { + return this.testArtifacts; + } + + /** + * Get the executedDateTime property: Test run initiated time. + * + * @return the executedDateTime value. + */ + public OffsetDateTime getExecutedDateTime() { + return this.executedDateTime; + } + + /** + * Get the vusers property: Number of virtual users, for which test has been run. + * + * @return the vusers value. + */ + public Integer getVusers() { + return this.vusers; + } + + /** + * Get the testRunStatistics property: Test run statistics. + * + * @return the testRunStatistics value. + */ + public Map getTestRunStatistics() { + return this.testRunStatistics; + } + + /** + * Get the createdDateTime property: The created DateTime(ISO 8601 literal format) of the test run. + * + * @return the createdDateTime value. + */ + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created the test run. + * + * @return the createdBy value. + */ + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last updated DateTime(ISO 8601 literal format) of the test run. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that updated the test run. + * + * @return the lastModifiedBy value. + */ + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Get the portalUrl property: Portal url. + * + * @return the portalUrl value. + */ + public String getPortalUrl() { + return this.portalUrl; + } + + /** + * Get the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is + * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If + * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. + * + * @return the secrets value. + */ + public Map getSecrets() { + return this.secrets; + } + + /** + * Set the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is + * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If + * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. + * + * @param secrets the secrets value to set. + * @return the TestRunModel object itself. + */ + public TestRunModel setSecrets(Map secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @return the environmentVariables value. + */ + public Map getEnvironmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @param environmentVariables the environmentVariables value to set. + * @return the TestRunModel object itself. + */ + public TestRunModel setEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the duration property: Test run duration in milliseconds. + * + * @return the duration value. + */ + public Long getDuration() { + return this.duration; + } + + /** + * Get the subnetId property: Subnet ID on which the load test instances should run. + * + * @return the subnetId value. + */ + public String getSubnetId() { + return this.subnetId; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java new file mode 100644 index 0000000000000..d5a82f6a7c4f6 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Resources. */ +@Fluent +public final class TestRunModelResourceList { + /* + * List of Resources + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link for the next list of resources in case of paginated results, if applicable + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of TestRunModelResourceList class. + * + * @param value the value value to set. + */ + @JsonCreator + public TestRunModelResourceList(@JsonProperty(value = "value", required = true) List value) { + this.value = value; + } + + /** + * Get the value property: List of Resources. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: Link for the next list of resources in case of paginated results, if applicable. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link for the next list of resources in case of paginated results, if applicable. + * + * @param nextLink the nextLink value to set. + * @return the TestRunModelResourceList object itself. + */ + public TestRunModelResourceList setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java new file mode 100644 index 0000000000000..a338088ad19c9 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Test run statistics. */ +@Immutable +public final class TestRunStatisticsModel { + /* + * Transaction name. + */ + @JsonProperty(value = "transaction", access = JsonProperty.Access.WRITE_ONLY) + private String transaction; + + /* + * Sampler count. + */ + @JsonProperty(value = "sampleCount", access = JsonProperty.Access.WRITE_ONLY) + private Double sampleCount; + + /* + * Error count. + */ + @JsonProperty(value = "errorCount", access = JsonProperty.Access.WRITE_ONLY) + private Double errorCount; + + /* + * Error percentage. + */ + @JsonProperty(value = "errorPct", access = JsonProperty.Access.WRITE_ONLY) + private Double errorPct; + + /* + * Mean response time. + */ + @JsonProperty(value = "meanResTime", access = JsonProperty.Access.WRITE_ONLY) + private Double meanResTime; + + /* + * Median response time. + */ + @JsonProperty(value = "medianResTime", access = JsonProperty.Access.WRITE_ONLY) + private Double medianResTime; + + /* + * Max response time. + */ + @JsonProperty(value = "maxResTime", access = JsonProperty.Access.WRITE_ONLY) + private Double maxResTime; + + /* + * Minimum response time. + */ + @JsonProperty(value = "minResTime", access = JsonProperty.Access.WRITE_ONLY) + private Double minResTime; + + /* + * 90 percentile response time. + */ + @JsonProperty(value = "pct1ResTime", access = JsonProperty.Access.WRITE_ONLY) + private Double pct1ResTime; + + /* + * 95 percentile response time. + */ + @JsonProperty(value = "pct2ResTime", access = JsonProperty.Access.WRITE_ONLY) + private Double pct2ResTime; + + /* + * 99 percentile response time. + */ + @JsonProperty(value = "pct3ResTime", access = JsonProperty.Access.WRITE_ONLY) + private Double pct3ResTime; + + /* + * Throughput. + */ + @JsonProperty(value = "throughput", access = JsonProperty.Access.WRITE_ONLY) + private Double throughput; + + /* + * Received network bytes. + */ + @JsonProperty(value = "receivedKBytesPerSec", access = JsonProperty.Access.WRITE_ONLY) + private Double receivedKBytesPerSec; + + /* + * Sent network bytes. + */ + @JsonProperty(value = "sentKBytesPerSec", access = JsonProperty.Access.WRITE_ONLY) + private Double sentKBytesPerSec; + + /** + * Get the transaction property: Transaction name. + * + * @return the transaction value. + */ + public String getTransaction() { + return this.transaction; + } + + /** + * Get the sampleCount property: Sampler count. + * + * @return the sampleCount value. + */ + public Double getSampleCount() { + return this.sampleCount; + } + + /** + * Get the errorCount property: Error count. + * + * @return the errorCount value. + */ + public Double getErrorCount() { + return this.errorCount; + } + + /** + * Get the errorPct property: Error percentage. + * + * @return the errorPct value. + */ + public Double getErrorPct() { + return this.errorPct; + } + + /** + * Get the meanResTime property: Mean response time. + * + * @return the meanResTime value. + */ + public Double getMeanResTime() { + return this.meanResTime; + } + + /** + * Get the medianResTime property: Median response time. + * + * @return the medianResTime value. + */ + public Double getMedianResTime() { + return this.medianResTime; + } + + /** + * Get the maxResTime property: Max response time. + * + * @return the maxResTime value. + */ + public Double getMaxResTime() { + return this.maxResTime; + } + + /** + * Get the minResTime property: Minimum response time. + * + * @return the minResTime value. + */ + public Double getMinResTime() { + return this.minResTime; + } + + /** + * Get the pct1ResTime property: 90 percentile response time. + * + * @return the pct1ResTime value. + */ + public Double getPct1ResTime() { + return this.pct1ResTime; + } + + /** + * Get the pct2ResTime property: 95 percentile response time. + * + * @return the pct2ResTime value. + */ + public Double getPct2ResTime() { + return this.pct2ResTime; + } + + /** + * Get the pct3ResTime property: 99 percentile response time. + * + * @return the pct3ResTime value. + */ + public Double getPct3ResTime() { + return this.pct3ResTime; + } + + /** + * Get the throughput property: Throughput. + * + * @return the throughput value. + */ + public Double getThroughput() { + return this.throughput; + } + + /** + * Get the receivedKBytesPerSec property: Received network bytes. + * + * @return the receivedKBytesPerSec value. + */ + public Double getReceivedKBytesPerSec() { + return this.receivedKBytesPerSec; + } + + /** + * Get the sentKBytesPerSec property: Sent network bytes. + * + * @return the sentKBytesPerSec value. + */ + public Double getSentKBytesPerSec() { + return this.sentKBytesPerSec; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java new file mode 100644 index 0000000000000..f2c8876794026 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The TimeRange model. */ +@Fluent +public final class TimeRange { + /* + * start DateTime(ISO 8601 literal format) for the requested client metrics filter. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * end DateTime(ISO 8601 literal format) for the requested client metrics filter. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /** + * Get the startTime property: start DateTime(ISO 8601 literal format) for the requested client metrics filter. + * + * @return the startTime value. + */ + public OffsetDateTime getStartTime() { + return this.startTime; + } + + /** + * Set the startTime property: start DateTime(ISO 8601 literal format) for the requested client metrics filter. + * + * @param startTime the startTime value to set. + * @return the TimeRange object itself. + */ + public TimeRange setStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: end DateTime(ISO 8601 literal format) for the requested client metrics filter. + * + * @return the endTime value. + */ + public OffsetDateTime getEndTime() { + return this.endTime; + } + + /** + * Set the endTime property: end DateTime(ISO 8601 literal format) for the requested client metrics filter. + * + * @param endTime the endTime value to set. + * @return the TimeRange object itself. + */ + public TimeRange setEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java new file mode 100644 index 0000000000000..708caf4aac6ec --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The TimeSeries model. */ +@Fluent +public final class TimeSeries { + /* + * Timestamp(ISO 8601 literal format). + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * Value at timestamp. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the timestamp property: Timestamp(ISO 8601 literal format). + * + * @return the timestamp value. + */ + public OffsetDateTime getTimestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: Timestamp(ISO 8601 literal format). + * + * @param timestamp the timestamp value to set. + * @return the TimeSeries object itself. + */ + public TimeSeries setTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the value property: Value at timestamp. + * + * @return the value value. + */ + public Double getValue() { + return this.value; + } + + /** + * Set the value property: Value at timestamp. + * + * @param value the value value to set. + * @return the TimeSeries object itself. + */ + public TimeSeries setValue(Double value) { + this.value = value; + return this; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java new file mode 100644 index 0000000000000..ebc21eb2f320d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for LoadTestClient. These APIs allow end users to create, view and run load tests + * using Azure Load Test Service. + */ +package com.azure.developer.loadtesting.implementation.models; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java new file mode 100644 index 0000000000000..8e1b31e6eedc1 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for LoadTestClient. These APIs allow end users to create, view and run load + * tests using Azure Load Test Service. + */ +package com.azure.developer.loadtesting.implementation; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java new file mode 100644 index 0000000000000..7cb0913984705 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for LoadTestClient. These APIs allow end users to create, view and run load tests + * using Azure Load Test Service. + */ +package com.azure.developer.loadtesting; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java new file mode 100644 index 0000000000000..cf894ad61a922 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java @@ -0,0 +1,9 @@ +module com.azure.developer.loadtesting { + requires transitive com.azure.core; + + exports com.azure.developer.loadtesting; + + opens com.azure.developer.loadtesting.implementation.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties b/sdk/loadtestservice/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties new file mode 100644 index 0000000000000..ca812989b4f27 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java new file mode 100644 index 0000000000000..75e13b453d91d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.developer.loadtesting.readme + // END: com.azure.developer.loadtesting.readme + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java new file mode 100644 index 0000000000000..d2a9f0cb4ed83 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateAndUpdateTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testruncreateandupdatetest.createandupdatetestrun + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest_Run1\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"testId\":\"12345678-1234-1234-1234-123456789012\"}"); + RequestOptions requestOptions = + new RequestOptions().addQueryParam("oldTestRunId", "12345678-1234-1234-1234-123456789012"); + Response response = + testRunClient.createAndUpdateTestWithResponse( + "12316678-1234-1234-1234-122451189012", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.testruncreateandupdatetest.createandupdatetestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java new file mode 100644 index 0000000000000..5fcd6b6df0df6 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateOrUpdateAppComponents { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentcreateorupdateappcomponents.createorupdateappcomponents + BinaryData body = + BinaryData.fromString( + "{\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\"}}}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.createOrUpdateAppComponentsWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentcreateorupdateappcomponents.createorupdateappcomponents + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java new file mode 100644 index 0000000000000..91b96583f53b8 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateOrUpdateServerMetricsConfig { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricscreateorupdateservermetricsconfig.createorupdateservermetricsconfig + BinaryData body = + BinaryData.fromString( + "{\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.createOrUpdateServerMetricsConfigWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricscreateorupdateservermetricsconfig.createorupdateservermetricsconfig + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java new file mode 100644 index 0000000000000..a0604bd611f43 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateOrUpdateTest { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testcreateorupdatetest.createorupdatetest + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/sampleprovider/sampleresourcetype/sampleresourcename\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.createOrUpdateTestWithResponse("12345678-1234-1234-1234-123456789012", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.testcreateorupdatetest.createorupdatetest + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java new file mode 100644 index 0000000000000..256cb1e887dfd --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteAppComponent { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentdeleteappcomponent.deleteappcomponent + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.deleteAppComponentWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentdeleteappcomponent.deleteappcomponent + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java new file mode 100644 index 0000000000000..c63cfc3f45db2 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteLoadTest { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testdeleteloadtest.deleteloadtest + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.deleteLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testdeleteloadtest.deleteloadtest + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java new file mode 100644 index 0000000000000..13fd16b9d3575 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteServerMetrics { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsdeleteservermetrics.deleteservermetrics + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.deleteServerMetricsWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsdeleteservermetrics.deleteservermetrics + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java new file mode 100644 index 0000000000000..6261d5040b597 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteTestFile { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testdeletetestfile.deletetestfile + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.deleteTestFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testdeletetestfile.deletetestfile + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java new file mode 100644 index 0000000000000..db284de2f58cb --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrundeletetestrun.deletetestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.deleteTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrundeletetestrun.deletetestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java new file mode 100644 index 0000000000000..9e227b3e82a49 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetAllTestFiles { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testgetalltestfiles.getalltestfiles + RequestOptions requestOptions = new RequestOptions().addQueryParam("continuationToken", "continuation token"); + Response response = + testClient.getAllTestFilesWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testgetalltestfiles.getalltestfiles + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java new file mode 100644 index 0000000000000..f3eeedf58bd78 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetAppComponent { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentgetappcomponent.getappcomponent + RequestOptions requestOptions = + new RequestOptions().addQueryParam("testRunId", "12316678-1234-1234-1234-122451189012"); + Response response = appComponentClient.getAppComponentWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentgetappcomponent.getappcomponent + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java new file mode 100644 index 0000000000000..7151d7a2c16ad --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetAppComponentByName { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentgetappcomponentbyname.getappcomponentbyname + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.getAppComponentByNameWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentgetappcomponentbyname.getappcomponentbyname + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java new file mode 100644 index 0000000000000..45f957f4f8eed --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetLoadTest { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testgetloadtest.getloadtest + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testgetloadtest.getloadtest + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java new file mode 100644 index 0000000000000..ef80d1f1d2879 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetServerDefaultMetrics { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetserverdefaultmetrics.getserverdefaultmetrics + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.getServerDefaultMetricsWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsgetserverdefaultmetrics.getserverdefaultmetrics + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java new file mode 100644 index 0000000000000..09aaba337f575 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetServerMetrics { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetservermetrics.getservermetrics + RequestOptions requestOptions = + new RequestOptions().addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); + Response response = serverMetricsClient.getServerMetricsWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsgetservermetrics.getservermetrics + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java new file mode 100644 index 0000000000000..04a250e98ef42 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetServerMetricsByName { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetservermetricsbyname.getservermetricsbyname + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.getServerMetricsByNameWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsgetservermetricsbyname.getservermetricsbyname + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java new file mode 100644 index 0000000000000..dada186b5ffa3 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetTestFile { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testgettestfile.gettestfile + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getTestFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testgettestfile.gettestfile + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java new file mode 100644 index 0000000000000..1fb64ce89bf9c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrun.gettestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrungettestrun.gettestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java new file mode 100644 index 0000000000000..5a3ac940f43fa --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetTestRunClientMetrics { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrunclientmetrics.gettestrunclientmetrics + BinaryData body = + BinaryData.fromString( + "{\"endTime\":\"2021-12-05T16:43:49.590Z\",\"errors\":[\"500\"],\"groupByInterval\":\"10s\",\"percentiles\":[\"95\"],\"requestSamplers\":[\"Homepage\"],\"startTime\":\"2021-12-05T16:43:49.590Z\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunClientMetricsWithResponse( + "12316678-1234-1234-1234-122451189012", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.testrungettestrunclientmetrics.gettestrunclientmetrics + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java new file mode 100644 index 0000000000000..46513497e696a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetTestRunClientMetricsFilters { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrunclientmetricsfilters.gettestrunclientmetricsfilters + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunClientMetricsFiltersWithResponse( + "12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrungettestrunclientmetricsfilters.gettestrunclientmetricsfilters + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java new file mode 100644 index 0000000000000..b68c1c827462a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetTestRunFile { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrunfile.gettestrunfile + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunFileWithResponse( + "12316678-1234-1234-1234-122451189012", "92345678-1234-1111-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrungettestrunfile.gettestrunfile + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java new file mode 100644 index 0000000000000..f339249bed0a5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListLoadTestSearch { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testlistloadtestsearch.listloadtestsearch + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("lastUpdatedEndTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("lastUpdatedStartTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest"); + Response response = testClient.listLoadTestSearchWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.testlistloadtestsearch.listloadtestsearch + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java new file mode 100644 index 0000000000000..2804475d49297 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListSupportedResourceType { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricslistsupportedresourcetype.listsupportedresourcetype + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.listSupportedResourceTypeWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricslistsupportedresourcetype.listsupportedresourcetype + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java new file mode 100644 index 0000000000000..b444011132551 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListTestRunsSearch { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunlisttestrunssearch.listtestrunssearch + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("executionFrom", "2021-12-05T16:43:48.805Z") + .addQueryParam("executionTo", "2021-12-05T16:43:48.805Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest_Run1") + .addQueryParam("status", "DONE,EXECUTING") + .addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); + Response response = testRunClient.listTestRunsSearchWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunlisttestrunssearch.listtestrunssearch + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java new file mode 100644 index 0000000000000..e5562e170845b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class StopTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunstoptestrun.stoptestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.stopTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunstoptestrun.stoptestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java new file mode 100644 index 0000000000000..979af920d0236 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class UploadTestFile { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testuploadtestfile.uploadtestfile + BinaryData file = BinaryData.fromString("\"multipart-form-data\""); + RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); + Response response = + testClient.uploadTestFileWithResponse( + "12345678-1234-1234-1234-123456789012", + "92345678-1234-1111-1234-123456789012", + file, + requestOptions); + // END:com.azure.developer.loadtesting.generated.testuploadtestfile.uploadtestfile + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java new file mode 100644 index 0000000000000..349622ede3e9f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.AppComponent; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class AppComponentTests { + @Test + public void testDeserialize() { + AppComponent model = + BinaryData.fromString( + "{\"resourceId\":\"znrb\",\"resourceName\":\"cqqjnqglhqgn\",\"resourceType\":\"foooj\",\"displayName\":\"ifsqesaagdfmg\",\"resourceGroup\":\"lhjxr\",\"subscriptionId\":\"kwm\",\"kind\":\"ktsizntocipaou\"}") + .toObject(AppComponent.class); + Assertions.assertEquals("znrb", model.getResourceId()); + Assertions.assertEquals("cqqjnqglhqgn", model.getResourceName()); + Assertions.assertEquals("foooj", model.getResourceType()); + Assertions.assertEquals("ifsqesaagdfmg", model.getDisplayName()); + Assertions.assertEquals("ktsizntocipaou", model.getKind()); + } + + @Test + public void testSerialize() { + AppComponent model = + new AppComponent("znrb", "cqqjnqglhqgn", "foooj") + .setDisplayName("ifsqesaagdfmg") + .setKind("ktsizntocipaou"); + model = BinaryData.fromObject(model).toObject(AppComponent.class); + Assertions.assertEquals("znrb", model.getResourceId()); + Assertions.assertEquals("cqqjnqglhqgn", model.getResourceName()); + Assertions.assertEquals("foooj", model.getResourceType()); + Assertions.assertEquals("ifsqesaagdfmg", model.getDisplayName()); + Assertions.assertEquals("ktsizntocipaou", model.getKind()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java new file mode 100644 index 0000000000000..ba80ea9270851 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.AppComponent; +import com.azure.developer.loadtesting.implementation.models.AppComponentsMap; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class AppComponentsMapTests { + @Test + public void testDeserialize() { + AppComponentsMap model = + BinaryData.fromString( + "{\"resourceId\":\"mhquvgjxp\",\"testId\":\"czmehmtzopbsp\",\"testRunId\":\"upi\",\"name\":\"sybbejhph\",\"value\":{\"fp\":{\"resourceId\":\"cmsxaobhdxbm\",\"resourceName\":\"qioqjzehtbmu\",\"resourceType\":\"p\",\"displayName\":\"noi\",\"resourceGroup\":\"wlrxyb\",\"subscriptionId\":\"oqijgkdmbpaz\",\"kind\":\"bc\"}}}") + .toObject(AppComponentsMap.class); + Assertions.assertEquals("czmehmtzopbsp", model.getTestId()); + Assertions.assertEquals("upi", model.getTestRunId()); + Assertions.assertEquals("cmsxaobhdxbm", model.getValue().get("fp").getResourceId()); + Assertions.assertEquals("qioqjzehtbmu", model.getValue().get("fp").getResourceName()); + Assertions.assertEquals("p", model.getValue().get("fp").getResourceType()); + Assertions.assertEquals("noi", model.getValue().get("fp").getDisplayName()); + Assertions.assertEquals("bc", model.getValue().get("fp").getKind()); + } + + @Test + public void testSerialize() { + AppComponentsMap model = + new AppComponentsMap( + mapOf( + "fp", + new AppComponent("cmsxaobhdxbm", "qioqjzehtbmu", "p") + .setDisplayName("noi") + .setKind("bc"))) + .setTestId("czmehmtzopbsp") + .setTestRunId("upi"); + model = BinaryData.fromObject(model).toObject(AppComponentsMap.class); + Assertions.assertEquals("czmehmtzopbsp", model.getTestId()); + Assertions.assertEquals("upi", model.getTestRunId()); + Assertions.assertEquals("cmsxaobhdxbm", model.getValue().get("fp").getResourceId()); + Assertions.assertEquals("qioqjzehtbmu", model.getValue().get("fp").getResourceName()); + Assertions.assertEquals("p", model.getValue().get("fp").getResourceType()); + Assertions.assertEquals("noi", model.getValue().get("fp").getDisplayName()); + Assertions.assertEquals("bc", model.getValue().get("fp").getKind()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java new file mode 100644 index 0000000000000..1175956831df2 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.ClientMetricsFilters; +import com.azure.developer.loadtesting.implementation.models.Filters; +import com.azure.developer.loadtesting.implementation.models.TimeRange; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ClientMetricsFiltersTests { + @Test + public void testDeserialize() { + ClientMetricsFilters model = + BinaryData.fromString( + "{\"testRunId\":\"keqdcvdrhvoods\",\"filters\":{\"requestSamplerValues\":[\"bzdopcj\",\"vnhdldwmgxcxr\",\"lpmutwuoegrpkhj\",\"niyqslui\"],\"errorFiltersValues\":[\"ggkzzlvmbmpa\",\"modfvuefywsbpfvm\",\"yhrfouyftaakcpw\",\"yzvqt\"]},\"timeRange\":{\"startTime\":\"2021-09-22T09:26:58Z\",\"endTime\":\"2021-09-15T15:14:36Z\"}}") + .toObject(ClientMetricsFilters.class); + Assertions.assertEquals("keqdcvdrhvoods", model.getTestRunId()); + Assertions.assertEquals("bzdopcj", model.getFilters().getRequestSamplerValues().get(0)); + Assertions.assertEquals("ggkzzlvmbmpa", model.getFilters().getErrorFiltersValues().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T09:26:58Z"), model.getTimeRange().getStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T15:14:36Z"), model.getTimeRange().getEndTime()); + } + + @Test + public void testSerialize() { + ClientMetricsFilters model = + new ClientMetricsFilters() + .setTestRunId("keqdcvdrhvoods") + .setFilters( + new Filters() + .setRequestSamplerValues( + Arrays.asList( + "bzdopcj", "vnhdldwmgxcxr", "lpmutwuoegrpkhj", "niyqslui")) + .setErrorFiltersValues( + Arrays.asList( + "ggkzzlvmbmpa", + "modfvuefywsbpfvm", + "yhrfouyftaakcpw", + "yzvqt"))) + .setTimeRange( + new TimeRange() + .setStartTime(OffsetDateTime.parse("2021-09-22T09:26:58Z")) + .setEndTime(OffsetDateTime.parse("2021-09-15T15:14:36Z"))); + model = BinaryData.fromObject(model).toObject(ClientMetricsFilters.class); + Assertions.assertEquals("keqdcvdrhvoods", model.getTestRunId()); + Assertions.assertEquals("bzdopcj", model.getFilters().getRequestSamplerValues().get(0)); + Assertions.assertEquals("ggkzzlvmbmpa", model.getFilters().getErrorFiltersValues().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T09:26:58Z"), model.getTimeRange().getStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T15:14:36Z"), model.getTimeRange().getEndTime()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java new file mode 100644 index 0000000000000..5fc220c38ecbb --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.ClientMetricsRequestModel; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ClientMetricsRequestModelTests { + @Test + public void testDeserialize() { + ClientMetricsRequestModel model = + BinaryData.fromString( + "{\"requestSamplers\":[\"n\",\"bglzpswi\",\"d\"],\"errors\":[\"yhz\",\"xssadbzmnvdf\"],\"percentiles\":[\"daodvxzbncblyl\"],\"groupByInterval\":\"tdbhhxsrzdzu\",\"startTime\":\"2021-10-15T02:58:18Z\",\"endTime\":\"2021-03-02T12:53:08Z\"}") + .toObject(ClientMetricsRequestModel.class); + Assertions.assertEquals("n", model.getRequestSamplers().get(0)); + Assertions.assertEquals("yhz", model.getErrors().get(0)); + Assertions.assertEquals("daodvxzbncblyl", model.getPercentiles().get(0)); + Assertions.assertEquals("tdbhhxsrzdzu", model.getGroupByInterval()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T02:58:18Z"), model.getStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T12:53:08Z"), model.getEndTime()); + } + + @Test + public void testSerialize() { + ClientMetricsRequestModel model = + new ClientMetricsRequestModel( + OffsetDateTime.parse("2021-10-15T02:58:18Z"), + OffsetDateTime.parse("2021-03-02T12:53:08Z")) + .setRequestSamplers(Arrays.asList("n", "bglzpswi", "d")) + .setErrors(Arrays.asList("yhz", "xssadbzmnvdf")) + .setPercentiles(Arrays.asList("daodvxzbncblyl")) + .setGroupByInterval("tdbhhxsrzdzu"); + model = BinaryData.fromObject(model).toObject(ClientMetricsRequestModel.class); + Assertions.assertEquals("n", model.getRequestSamplers().get(0)); + Assertions.assertEquals("yhz", model.getErrors().get(0)); + Assertions.assertEquals("daodvxzbncblyl", model.getPercentiles().get(0)); + Assertions.assertEquals("tdbhhxsrzdzu", model.getGroupByInterval()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T02:58:18Z"), model.getStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T12:53:08Z"), model.getEndTime()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java new file mode 100644 index 0000000000000..d2de54524602a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.ClientMetricsResults; +import com.azure.developer.loadtesting.implementation.models.Series; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ClientMetricsResultsTests { + @Test + public void testDeserialize() { + ClientMetricsResults model = + BinaryData.fromString( + "{\"testRunId\":\"cdntnevfiwjmy\",\"timeSeries\":{\"activeUsers\":{\"lswtmweriofzpyqs\":[],\"wab\":[],\"tshhszhedp\":[],\"wiwubm\":[]},\"responseTime\":{\"sldnkwwtppjflcxo\":[],\"okonzmnsikvmkqz\":[],\"qkdltfz\":[],\"hhvh\":[]},\"throughput\":{\"odkwobd\":[]},\"errors\":{\"ibqdxbxwakbogqx\":[],\"lkzgxhuriplbp\":[],\"xunkbebxmubyynt\":[],\"rbqtkoie\":[]}}}") + .toObject(ClientMetricsResults.class); + Assertions.assertEquals("cdntnevfiwjmy", model.getTestRunId()); + } + + @Test + public void testSerialize() { + ClientMetricsResults model = + new ClientMetricsResults() + .setTestRunId("cdntnevfiwjmy") + .setTimeSeries( + new Series() + .setActiveUsers( + mapOf( + "lswtmweriofzpyqs", + Arrays.asList(), + "wab", + Arrays.asList(), + "tshhszhedp", + Arrays.asList(), + "wiwubm", + Arrays.asList())) + .setResponseTime( + mapOf( + "sldnkwwtppjflcxo", + Arrays.asList(), + "okonzmnsikvmkqz", + Arrays.asList(), + "qkdltfz", + Arrays.asList(), + "hhvh", + Arrays.asList())) + .setThroughput(mapOf("odkwobd", Arrays.asList())) + .setErrors( + mapOf( + "ibqdxbxwakbogqx", + Arrays.asList(), + "lkzgxhuriplbp", + Arrays.asList(), + "xunkbebxmubyynt", + Arrays.asList(), + "rbqtkoie", + Arrays.asList()))); + model = BinaryData.fromObject(model).toObject(ClientMetricsResults.class); + Assertions.assertEquals("cdntnevfiwjmy", model.getTestRunId()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java new file mode 100644 index 0000000000000..9adde3608faab --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateAndUpdateTestRunTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testCreateAndUpdateTestRunTests() { + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest_Run1\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"testId\":\"12345678-1234-1234-1234-123456789012\"}"); + RequestOptions requestOptions = + new RequestOptions().addQueryParam("oldTestRunId", "12345678-1234-1234-1234-123456789012"); + Response response = + testRunClient.createAndUpdateTestWithResponse( + "12316678-1234-1234-1234-122451189012", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java new file mode 100644 index 0000000000000..ab6f7ab823b54 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateAppComponentsTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateAppComponentsTests() { + BinaryData body = + BinaryData.fromString( + "{\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\"}}}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.createOrUpdateAppComponentsWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java new file mode 100644 index 0000000000000..b02a2dfe1913f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateServerMetricsConfigTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateServerMetricsConfigTests() { + BinaryData body = + BinaryData.fromString( + "{\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.createOrUpdateServerMetricsConfigWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java new file mode 100644 index 0000000000000..13bf5d713cf3d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateTestTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateTestTests() { + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/sampleprovider/sampleresourcetype/sampleresourcename\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.createOrUpdateTestWithResponse("12345678-1234-1234-1234-123456789012", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java new file mode 100644 index 0000000000000..25299875f3467 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.DefaultServerMetricsConfigListModel; +import com.azure.developer.loadtesting.implementation.models.DefaultServerMetricsConfigModel; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class DefaultServerMetricsConfigListModelTests { + @Test + public void testDeserialize() { + DefaultServerMetricsConfigListModel model = + BinaryData.fromString( + "{\"defaultMetrics\":{\"kzsmodm\":[{\"metricnamespace\":\"ftyhxhurokf\",\"aggregation\":\"xolniwpwcukjfk\",\"unit\":\"w\",\"displayDescription\":\"lryplwckbasyy\"},{\"metricnamespace\":\"ddhsgcbacphe\",\"aggregation\":\"ot\",\"unit\":\"gou\",\"displayDescription\":\"ndlik\"},{\"metricnamespace\":\"qkgfgibma\",\"aggregation\":\"akeqs\",\"unit\":\"bzqqedqytbciq\",\"displayDescription\":\"uflmm\"}],\"lnerkujysvleju\":[{\"metricnamespace\":\"ugpbkw\",\"aggregation\":\"utduqktapspwgcu\",\"unit\":\"umkdosvqwhbmd\",\"displayDescription\":\"bjf\"},{\"metricnamespace\":\"gmbmbexppbh\",\"aggregation\":\"qrolfpf\",\"unit\":\"lgbquxig\",\"displayDescription\":\"jgzjaoyfhrtx\"}],\"jcmmxdcufufsrp\":[{\"metricnamespace\":\"awrlyx\",\"aggregation\":\"kcprbnw\",\"unit\":\"jvtbvpyss\",\"displayDescription\":\"nruj\"},{\"metricnamespace\":\"uhmuouqfprwzwbn\",\"aggregation\":\"itnwuizgazxufi\",\"unit\":\"kyfi\",\"displayDescription\":\"fidfvzw\"},{\"metricnamespace\":\"uht\",\"aggregation\":\"wisdkft\",\"unit\":\"mnteiwao\",\"displayDescription\":\"km\"}]}}") + .toObject(DefaultServerMetricsConfigListModel.class); + Assertions.assertEquals("ftyhxhurokf", model.getDefaultMetrics().get("kzsmodm").get(0).getMetricnamespace()); + Assertions.assertEquals("xolniwpwcukjfk", model.getDefaultMetrics().get("kzsmodm").get(0).getAggregation()); + Assertions.assertEquals("w", model.getDefaultMetrics().get("kzsmodm").get(0).getUnit()); + Assertions.assertEquals( + "lryplwckbasyy", model.getDefaultMetrics().get("kzsmodm").get(0).getDisplayDescription()); + } + + @Test + public void testSerialize() { + DefaultServerMetricsConfigListModel model = + new DefaultServerMetricsConfigListModel() + .setDefaultMetrics( + mapOf( + "kzsmodm", + Arrays.asList( + new DefaultServerMetricsConfigModel() + .setMetricnamespace("ftyhxhurokf") + .setAggregation("xolniwpwcukjfk") + .setUnit("w") + .setDisplayDescription("lryplwckbasyy"), + new DefaultServerMetricsConfigModel() + .setMetricnamespace("ddhsgcbacphe") + .setAggregation("ot") + .setUnit("gou") + .setDisplayDescription("ndlik"), + new DefaultServerMetricsConfigModel() + .setMetricnamespace("qkgfgibma") + .setAggregation("akeqs") + .setUnit("bzqqedqytbciq") + .setDisplayDescription("uflmm")), + "lnerkujysvleju", + Arrays.asList( + new DefaultServerMetricsConfigModel() + .setMetricnamespace("ugpbkw") + .setAggregation("utduqktapspwgcu") + .setUnit("umkdosvqwhbmd") + .setDisplayDescription("bjf"), + new DefaultServerMetricsConfigModel() + .setMetricnamespace("gmbmbexppbh") + .setAggregation("qrolfpf") + .setUnit("lgbquxig") + .setDisplayDescription("jgzjaoyfhrtx")), + "jcmmxdcufufsrp", + Arrays.asList( + new DefaultServerMetricsConfigModel() + .setMetricnamespace("awrlyx") + .setAggregation("kcprbnw") + .setUnit("jvtbvpyss") + .setDisplayDescription("nruj"), + new DefaultServerMetricsConfigModel() + .setMetricnamespace("uhmuouqfprwzwbn") + .setAggregation("itnwuizgazxufi") + .setUnit("kyfi") + .setDisplayDescription("fidfvzw"), + new DefaultServerMetricsConfigModel() + .setMetricnamespace("uht") + .setAggregation("wisdkft") + .setUnit("mnteiwao") + .setDisplayDescription("km")))); + model = BinaryData.fromObject(model).toObject(DefaultServerMetricsConfigListModel.class); + Assertions.assertEquals("ftyhxhurokf", model.getDefaultMetrics().get("kzsmodm").get(0).getMetricnamespace()); + Assertions.assertEquals("xolniwpwcukjfk", model.getDefaultMetrics().get("kzsmodm").get(0).getAggregation()); + Assertions.assertEquals("w", model.getDefaultMetrics().get("kzsmodm").get(0).getUnit()); + Assertions.assertEquals( + "lryplwckbasyy", model.getDefaultMetrics().get("kzsmodm").get(0).getDisplayDescription()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java new file mode 100644 index 0000000000000..48e1523460f96 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.DefaultServerMetricsConfigModel; +import com.azure.developer.loadtesting.implementation.models.LocalizedName; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class DefaultServerMetricsConfigModelTests { + @Test + public void testDeserialize() { + DefaultServerMetricsConfigModel model = + BinaryData.fromString( + "{\"metricnamespace\":\"zidnsezcxtbzsgfy\",\"aggregation\":\"sne\",\"name\":{\"value\":\"wzjeiach\",\"localizedValue\":\"osfln\"},\"unit\":\"sfqpteehz\",\"displayDescription\":\"ypyqrimzinp\"}") + .toObject(DefaultServerMetricsConfigModel.class); + Assertions.assertEquals("zidnsezcxtbzsgfy", model.getMetricnamespace()); + Assertions.assertEquals("sne", model.getAggregation()); + Assertions.assertEquals("wzjeiach", model.getName().getValue()); + Assertions.assertEquals("osfln", model.getName().getLocalizedValue()); + Assertions.assertEquals("sfqpteehz", model.getUnit()); + Assertions.assertEquals("ypyqrimzinp", model.getDisplayDescription()); + } + + @Test + public void testSerialize() { + DefaultServerMetricsConfigModel model = + new DefaultServerMetricsConfigModel() + .setMetricnamespace("zidnsezcxtbzsgfy") + .setAggregation("sne") + .setName(new LocalizedName().setValue("wzjeiach").setLocalizedValue("osfln")) + .setUnit("sfqpteehz") + .setDisplayDescription("ypyqrimzinp"); + model = BinaryData.fromObject(model).toObject(DefaultServerMetricsConfigModel.class); + Assertions.assertEquals("zidnsezcxtbzsgfy", model.getMetricnamespace()); + Assertions.assertEquals("sne", model.getAggregation()); + Assertions.assertEquals("wzjeiach", model.getName().getValue()); + Assertions.assertEquals("osfln", model.getName().getLocalizedValue()); + Assertions.assertEquals("sfqpteehz", model.getUnit()); + Assertions.assertEquals("ypyqrimzinp", model.getDisplayDescription()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java new file mode 100644 index 0000000000000..929e92ed5d360 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteAppComponentTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testDeleteAppComponentTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.deleteAppComponentWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java new file mode 100644 index 0000000000000..f389678e84cd2 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteLoadTestTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testDeleteLoadTestTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.deleteLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java new file mode 100644 index 0000000000000..f2da5a20e9092 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteServerMetricsTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testDeleteServerMetricsTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.deleteServerMetricsWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java new file mode 100644 index 0000000000000..966566bca782c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteTestFileTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testDeleteTestFileTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.deleteTestFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java new file mode 100644 index 0000000000000..0970bd7356296 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteTestRunTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testDeleteTestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.deleteTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java new file mode 100644 index 0000000000000..2570bae6e2069 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.Error; +import com.azure.developer.loadtesting.implementation.models.ErrorResponseBody; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ErrorResponseBodyTests { + @Test + public void testDeserialize() { + ErrorResponseBody model = + BinaryData.fromString( + "{\"error\":{\"code\":\"s\",\"message\":\"cmpoyfdkfogkny\",\"target\":\"ofjdde\",\"details\":[{\"code\":\"eupewnwreitjz\",\"message\":\"lusarh\",\"target\":\"fcqhsmyurkd\",\"details\":[]}]}}") + .toObject(ErrorResponseBody.class); + Assertions.assertEquals("s", model.getError().getCode()); + Assertions.assertEquals("cmpoyfdkfogkny", model.getError().getMessage()); + Assertions.assertEquals("ofjdde", model.getError().getTarget()); + Assertions.assertEquals("eupewnwreitjz", model.getError().getDetails().get(0).getCode()); + Assertions.assertEquals("lusarh", model.getError().getDetails().get(0).getMessage()); + Assertions.assertEquals("fcqhsmyurkd", model.getError().getDetails().get(0).getTarget()); + } + + @Test + public void testSerialize() { + ErrorResponseBody model = + new ErrorResponseBody() + .setError( + new Error() + .setCode("s") + .setMessage("cmpoyfdkfogkny") + .setTarget("ofjdde") + .setDetails( + Arrays.asList( + new Error() + .setCode("eupewnwreitjz") + .setMessage("lusarh") + .setTarget("fcqhsmyurkd") + .setDetails(Arrays.asList())))); + model = BinaryData.fromObject(model).toObject(ErrorResponseBody.class); + Assertions.assertEquals("s", model.getError().getCode()); + Assertions.assertEquals("cmpoyfdkfogkny", model.getError().getMessage()); + Assertions.assertEquals("ofjdde", model.getError().getTarget()); + Assertions.assertEquals("eupewnwreitjz", model.getError().getDetails().get(0).getCode()); + Assertions.assertEquals("lusarh", model.getError().getDetails().get(0).getMessage()); + Assertions.assertEquals("fcqhsmyurkd", model.getError().getDetails().get(0).getTarget()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java new file mode 100644 index 0000000000000..e8194b1bf9328 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.Error; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ErrorTests { + @Test + public void testDeserialize() { + Error model = + BinaryData.fromString( + "{\"code\":\"xhekuksjtxukcdm\",\"message\":\"rcryuanzwuxzdxta\",\"target\":\"lhmwhfpmrqobm\",\"details\":[{\"code\":\"nryrtihf\",\"message\":\"ijbpzvgnwzsymgl\",\"target\":\"fcyzkohdbihanufh\",\"details\":[]},{\"code\":\"y\",\"message\":\"git\",\"target\":\"qhabifpikxwcz\",\"details\":[]},{\"code\":\"npqxuh\",\"message\":\"y\",\"target\":\"iwbybrkxvdumjg\",\"details\":[]}]}") + .toObject(Error.class); + Assertions.assertEquals("xhekuksjtxukcdm", model.getCode()); + Assertions.assertEquals("rcryuanzwuxzdxta", model.getMessage()); + Assertions.assertEquals("lhmwhfpmrqobm", model.getTarget()); + Assertions.assertEquals("nryrtihf", model.getDetails().get(0).getCode()); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.getDetails().get(0).getMessage()); + Assertions.assertEquals("fcyzkohdbihanufh", model.getDetails().get(0).getTarget()); + } + + @Test + public void testSerialize() { + Error model = + new Error() + .setCode("xhekuksjtxukcdm") + .setMessage("rcryuanzwuxzdxta") + .setTarget("lhmwhfpmrqobm") + .setDetails( + Arrays.asList( + new Error() + .setCode("nryrtihf") + .setMessage("ijbpzvgnwzsymgl") + .setTarget("fcyzkohdbihanufh") + .setDetails(Arrays.asList()), + new Error() + .setCode("y") + .setMessage("git") + .setTarget("qhabifpikxwcz") + .setDetails(Arrays.asList()), + new Error() + .setCode("npqxuh") + .setMessage("y") + .setTarget("iwbybrkxvdumjg") + .setDetails(Arrays.asList()))); + model = BinaryData.fromObject(model).toObject(Error.class); + Assertions.assertEquals("xhekuksjtxukcdm", model.getCode()); + Assertions.assertEquals("rcryuanzwuxzdxta", model.getMessage()); + Assertions.assertEquals("lhmwhfpmrqobm", model.getTarget()); + Assertions.assertEquals("nryrtihf", model.getDetails().get(0).getCode()); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.getDetails().get(0).getMessage()); + Assertions.assertEquals("fcyzkohdbihanufh", model.getDetails().get(0).getTarget()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java new file mode 100644 index 0000000000000..5237ba094d3e3 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.FileType; +import com.azure.developer.loadtesting.implementation.models.FileUrl; +import com.azure.developer.loadtesting.implementation.models.FileUrlList; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class FileUrlListTests { + @Test + public void testDeserialize() { + FileUrlList model = + BinaryData.fromString( + "{\"value\":[{\"url\":\"kzjancuxrhdwbav\",\"fileId\":\"niwdjsw\",\"filename\":\"s\",\"fileType\":2,\"expireTime\":\"2021-10-19T12:26:50Z\",\"validationStatus\":\"ytxhp\"},{\"url\":\"bzpfzab\",\"fileId\":\"cuh\",\"filename\":\"tcty\",\"fileType\":0,\"expireTime\":\"2021-06-27T19:00:45Z\",\"validationStatus\":\"ovplw\"},{\"url\":\"hvgyuguosvmk\",\"fileId\":\"sxqu\",\"filename\":\"fpl\",\"fileType\":2,\"expireTime\":\"2021-10-07T01:44:34Z\",\"validationStatus\":\"kjz\"}],\"nextLink\":\"es\"}") + .toObject(FileUrlList.class); + Assertions.assertEquals("kzjancuxrhdwbav", model.getValue().get(0).getUrl()); + Assertions.assertEquals("niwdjsw", model.getValue().get(0).getFileId()); + Assertions.assertEquals("s", model.getValue().get(0).getFilename()); + Assertions.assertEquals(FileType.TWO, model.getValue().get(0).getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T12:26:50Z"), model.getValue().get(0).getExpireTime()); + Assertions.assertEquals("ytxhp", model.getValue().get(0).getValidationStatus()); + Assertions.assertEquals("es", model.getNextLink()); + } + + @Test + public void testSerialize() { + FileUrlList model = + new FileUrlList( + Arrays.asList( + new FileUrl() + .setUrl("kzjancuxrhdwbav") + .setFileId("niwdjsw") + .setFilename("s") + .setFileType(FileType.TWO) + .setExpireTime(OffsetDateTime.parse("2021-10-19T12:26:50Z")) + .setValidationStatus("ytxhp"), + new FileUrl() + .setUrl("bzpfzab") + .setFileId("cuh") + .setFilename("tcty") + .setFileType(FileType.ZERO) + .setExpireTime(OffsetDateTime.parse("2021-06-27T19:00:45Z")) + .setValidationStatus("ovplw"), + new FileUrl() + .setUrl("hvgyuguosvmk") + .setFileId("sxqu") + .setFilename("fpl") + .setFileType(FileType.TWO) + .setExpireTime(OffsetDateTime.parse("2021-10-07T01:44:34Z")) + .setValidationStatus("kjz"))) + .setNextLink("es"); + model = BinaryData.fromObject(model).toObject(FileUrlList.class); + Assertions.assertEquals("kzjancuxrhdwbav", model.getValue().get(0).getUrl()); + Assertions.assertEquals("niwdjsw", model.getValue().get(0).getFileId()); + Assertions.assertEquals("s", model.getValue().get(0).getFilename()); + Assertions.assertEquals(FileType.TWO, model.getValue().get(0).getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T12:26:50Z"), model.getValue().get(0).getExpireTime()); + Assertions.assertEquals("ytxhp", model.getValue().get(0).getValidationStatus()); + Assertions.assertEquals("es", model.getNextLink()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java new file mode 100644 index 0000000000000..6e5d5e2a3ac45 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.FileType; +import com.azure.developer.loadtesting.implementation.models.FileUrl; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class FileUrlTests { + @Test + public void testDeserialize() { + FileUrl model = + BinaryData.fromString( + "{\"url\":\"senhwlrs\",\"fileId\":\"rzpwvlqdqgbiq\",\"filename\":\"ihkaetcktvfc\",\"fileType\":1,\"expireTime\":\"2021-09-20T06:05:50Z\",\"validationStatus\":\"ymuctqhjfbebrj\"}") + .toObject(FileUrl.class); + Assertions.assertEquals("senhwlrs", model.getUrl()); + Assertions.assertEquals("rzpwvlqdqgbiq", model.getFileId()); + Assertions.assertEquals("ihkaetcktvfc", model.getFilename()); + Assertions.assertEquals(FileType.ONE, model.getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T06:05:50Z"), model.getExpireTime()); + Assertions.assertEquals("ymuctqhjfbebrj", model.getValidationStatus()); + } + + @Test + public void testSerialize() { + FileUrl model = + new FileUrl() + .setUrl("senhwlrs") + .setFileId("rzpwvlqdqgbiq") + .setFilename("ihkaetcktvfc") + .setFileType(FileType.ONE) + .setExpireTime(OffsetDateTime.parse("2021-09-20T06:05:50Z")) + .setValidationStatus("ymuctqhjfbebrj"); + model = BinaryData.fromObject(model).toObject(FileUrl.class); + Assertions.assertEquals("senhwlrs", model.getUrl()); + Assertions.assertEquals("rzpwvlqdqgbiq", model.getFileId()); + Assertions.assertEquals("ihkaetcktvfc", model.getFilename()); + Assertions.assertEquals(FileType.ONE, model.getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T06:05:50Z"), model.getExpireTime()); + Assertions.assertEquals("ymuctqhjfbebrj", model.getValidationStatus()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java new file mode 100644 index 0000000000000..b9959560cf89c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.Filters; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class FiltersTests { + @Test + public void testDeserialize() { + Filters model = + BinaryData.fromString( + "{\"requestSamplerValues\":[\"zksmondj\"],\"errorFiltersValues\":[\"xvy\",\"omgkopkwho\",\"v\",\"ajqgxy\"]}") + .toObject(Filters.class); + Assertions.assertEquals("zksmondj", model.getRequestSamplerValues().get(0)); + Assertions.assertEquals("xvy", model.getErrorFiltersValues().get(0)); + } + + @Test + public void testSerialize() { + Filters model = + new Filters() + .setRequestSamplerValues(Arrays.asList("zksmondj")) + .setErrorFiltersValues(Arrays.asList("xvy", "omgkopkwho", "v", "ajqgxy")); + model = BinaryData.fromObject(model).toObject(Filters.class); + Assertions.assertEquals("zksmondj", model.getRequestSamplerValues().get(0)); + Assertions.assertEquals("xvy", model.getErrorFiltersValues().get(0)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java new file mode 100644 index 0000000000000..af46110b469a5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetAllTestFilesTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetAllTestFilesTests() { + RequestOptions requestOptions = new RequestOptions().addQueryParam("continuationToken", "continuation token"); + Response response = + testClient.getAllTestFilesWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"nextLink\":null,\"value\":[{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java new file mode 100644 index 0000000000000..2d561eada0a2a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetAppComponentByNameTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetAppComponentByNameTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.getAppComponentByNameWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"ee843bd9-a6d4-4364-a45c-427a03c39fa7\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceGroup\":\"samplerg\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java new file mode 100644 index 0000000000000..053ab5b9b7b07 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetAppComponentTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetAppComponentTests() { + RequestOptions requestOptions = + new RequestOptions().addQueryParam("testRunId", "12316678-1234-1234-1234-122451189012"); + Response response = appComponentClient.getAppComponentWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"ee843bd9-a6d4-4364-a45c-427a03c39fa7\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceGroup\":\"samplerg\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java new file mode 100644 index 0000000000000..ea4a36b6ac878 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetLoadTestTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetLoadTestTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":0,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":null,\"value\":20}}},\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testId\":\"12345678-1234-1234-1234-123456789012\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java new file mode 100644 index 0000000000000..8c0633ddbda24 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetServerDefaultMetricsTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetServerDefaultMetricsTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.getServerDefaultMetricsWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"defaultMetrics\":{\"microsoft.cache/redis\":[{\"name\":{\"localizedValue\":\"Server Load\",\"value\":\"serverLoad\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Cache Latency\",\"value\":\"cacheLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Cache Hits\",\"value\":\"cachehits\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Connected Clients\",\"value\":\"connectedclients\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null}],\"microsoft.classiccompute/virtualmachines\":[{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success E2E Latency\",\"value\":\"SuccessE2ELatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success Server Latency\",\"value\":\"SuccessServerLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Used Capacity\",\"value\":\"UsedCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/blobservices\":[{\"name\":{\"localizedValue\":\"Blob Count\",\"value\":\"BlobCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Index Capacity\",\"value\":\"ContainerCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Capacity\",\"value\":\"BlobCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/fileservices\":[{\"name\":{\"localizedValue\":\"File Capacity\",\"value\":\"FileCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"File Count\",\"value\":\"FileCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/queueservices\":[{\"name\":{\"localizedValue\":\"Queue Count\",\"value\":\"QueueCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Queue Capacity\",\"value\":\"QueueCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/tableservices\":[{\"name\":{\"localizedValue\":\"Table Count\",\"value\":\"TableCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Capacity\",\"value\":\"TableCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null}],\"microsoft.compute/virtualmachines\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null}],\"microsoft.compute/virtualmachinescalesets\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null}],\"microsoft.containerinstance/containergroups\":[{\"name\":{\"localizedValue\":\"CPU Usage\",\"value\":\"CpuUsage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerinstance/containergroups\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory Usage\",\"value\":\"MemoryUsage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerinstance/containergroups\",\"unit\":null}],\"microsoft.containerservice/managedclusters\":[{\"name\":{\"localizedValue\":\"Total number of available cpu cores in a managed cluster\",\"value\":\"kube_node_status_allocatable_cpu_cores\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Total amount of available memory in a managed cluster\",\"value\":\"kube_node_status_allocatable_memory_bytes\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Number of pods in Ready state\",\"value\":\"kube_pod_status_ready\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null}],\"microsoft.dbformariadb/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null}],\"microsoft.dbformysql/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null}],\"microsoft.dbforpostgresql/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null}],\"microsoft.dbforpostgresql/serversv2\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/serversv2\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/serversv2\",\"unit\":null}],\"microsoft.dbforpostgresql/singleservers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/singleservers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/singleservers\",\"unit\":null}],\"microsoft.documentdb/databaseaccounts\":[{\"name\":{\"localizedValue\":\"Total Requests\",\"value\":\"TotalRequests\"},\"aggregation\":\"Count\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Provisioned Throughput\",\"value\":\"ProvisionedThroughput\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Normalized RU Consumption\",\"value\":\"NormalizedRUConsumption\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null}],\"microsoft.eventhub/clusters\":[{\"name\":{\"localizedValue\":\"CPU\",\"value\":\"CPU\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Available Memory\",\"value\":\"AvailableMemory\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Errors\",\"value\":\"ServerErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Successful Requests\",\"value\":\"SuccessfulRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Quota Exceeded Errors\",\"value\":\"QuotaExceededErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null}],\"microsoft.eventhub/namespaces\":[{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Successful Requests\",\"value\":\"SuccessfulRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Quota Exceeded Errors\",\"value\":\"QuotaExceededErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Errors\",\"value\":\"ServerErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null}],\"microsoft.insights/components\":[{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null},{\"name\":{\"localizedValue\":\"Failed Request\",\"value\":\"requests/failed\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Requests\",\"value\":\"requests/count\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null}],\"microsoft.keyvault/vaults\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null},{\"name\":{\"localizedValue\":\"Total Service Api Hits\",\"value\":\"ServiceApiHit\"},\"aggregation\":\"Count\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null},{\"name\":{\"localizedValue\":\"Overall Service Api Latency\",\"value\":\"ServiceApiLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null}],\"microsoft.servicebus/namespaces\":[{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of active messages in a Queue/Topic\",\"value\":\"ActiveMessages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"CPU\",\"value\":\"NamespaceCpuUsage\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Incoming Messages\",\"value\":\"IncomingMessages\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Incoming Requests\",\"value\":\"IncomingRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of messages in a Queue/Topic\",\"value\":\"Messages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of dead-lettered message\",\"value\":\"DeadletteredMessages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null}],\"microsoft.servicefabricmesh/applications\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null}],\"microsoft.sql/managedinstances\":[{\"name\":{\"localizedValue\":\"Storage space reserved\",\"value\":\"reserved_storage_mb\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO bytes written\",\"value\":\"io_bytes_written\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"Average CPU percentage\",\"value\":\"avg_cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"Storage space used\",\"value\":\"storage_space_used_mb\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO bytes read\",\"value\":\"io_bytes_read\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null}],\"microsoft.sql/servers/databases\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null},{\"name\":{\"localizedValue\":\"Connection Failed\",\"value\":\"connection_failed\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null},{\"name\":{\"localizedValue\":\"Deadlocks\",\"value\":\"deadlock\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null}],\"microsoft.sql/servers/elasticpools\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/elasticpools\",\"unit\":null},{\"name\":{\"localizedValue\":\"Data space used percent\",\"value\":\"storage_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/elasticpools\",\"unit\":null}],\"microsoft.storage/storageaccounts\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success E2E Latency\",\"value\":\"SuccessE2ELatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Used Capacity\",\"value\":\"UsedCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success Server Latency\",\"value\":\"SuccessServerLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null}],\"microsoft.storage/storageaccounts/blobservices\":[{\"name\":{\"localizedValue\":\"Blob Container Count\",\"value\":\"ContainerCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Count\",\"value\":\"BlobCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Capacity\",\"value\":\"BlobCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/fileservices\":[{\"name\":{\"localizedValue\":\"File Count\",\"value\":\"FileCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"File Capacity\",\"value\":\"FileCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/queueservices\":[{\"name\":{\"localizedValue\":\"Queue Count\",\"value\":\"QueueCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Queue Capacity\",\"value\":\"QueueCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/tableservices\":[{\"name\":{\"localizedValue\":\"Table Count\",\"value\":\"TableCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Capacity\",\"value\":\"TableCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Entity Count\",\"value\":\"TableEntityCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null}],\"microsoft.web/serverfarms\":[{\"name\":{\"localizedValue\":\"CPU Percentage\",\"value\":\"CpuPercentage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/serverfarms\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory Percentage\",\"value\":\"MemoryPercentage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/serverfarms\",\"unit\":null}],\"microsoft.web/sites\":[{\"name\":{\"localizedValue\":\"Http5xx Error\",\"value\":\"Http5xx\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null},{\"name\":{\"localizedValue\":\"Requests\",\"value\":\"Requests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null},{\"name\":{\"localizedValue\":\"Response Time\",\"value\":\"HttpResponseTime\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null}]}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java new file mode 100644 index 0000000000000..fefe2a773e075 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetServerMetricsByNameTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetServerMetricsByNameTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.getServerMetricsByNameWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"edc6e529-d009-4b99-b763-ca492e3a2823\",\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java new file mode 100644 index 0000000000000..9cf67a2d91ebf --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetServerMetricsTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetServerMetricsTests() { + RequestOptions requestOptions = + new RequestOptions().addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); + Response response = serverMetricsClient.getServerMetricsWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"edc6e529-d009-4b99-b763-ca492e3a2823\",\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java new file mode 100644 index 0000000000000..1415f9087987b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetTestFileTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetTestFileTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getTestFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java new file mode 100644 index 0000000000000..08f2b09e684d8 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetTestRunClientMetricsFiltersTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetTestRunClientMetricsFiltersTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunClientMetricsFiltersWithResponse( + "12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"filters\":{\"errorFiltersValues\":[\"500\"],\"requestSamplerValues\":[\"Homepage\"]},\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"timeRange\":{\"endTime\":\"2021-12-05T16:43:49.590Z\",\"startTime\":\"2021-12-05T16:43:49.590Z\"}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java new file mode 100644 index 0000000000000..b40e4fd092ab1 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetTestRunClientMetricsTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetTestRunClientMetricsTests() { + BinaryData body = + BinaryData.fromString( + "{\"endTime\":\"2021-12-05T16:43:49.590Z\",\"errors\":[\"500\"],\"groupByInterval\":\"10s\",\"percentiles\":[\"95\"],\"requestSamplers\":[\"Homepage\"],\"startTime\":\"2021-12-05T16:43:49.590Z\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunClientMetricsWithResponse( + "12316678-1234-1234-1234-122451189012", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"timeSeries\":{\"activeUsers\":{\"Homepage\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":1}]},\"errors\":{\"500\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":1}]},\"responseTime\":{\"Homepage Pct 95\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":1}]},\"throughput\":{\"Homepage\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":2}]}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java new file mode 100644 index 0000000000000..061023934e351 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetTestRunFileTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetTestRunFileTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunFileWithResponse( + "12316678-1234-1234-1234-122451189012", "92345678-1234-1111-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java new file mode 100644 index 0000000000000..a49c64c3793d6 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetTestRunTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testGetTestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":18,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":20}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"DONE\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":{\"expireTime\":\"2022-05-16T09:14:46.0411793+00:00\",\"fileId\":\"abb846a7-63af-4d63-bb3d-a7aa4caff55c\",\"fileType\":2,\"filename\":\"worker.log\",\"url\":\"https://dummyurl.com/logresource\",\"validationStatus\":\"\"},\"resultUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/dummyresourceresult\",\"validationStatus\":\"VALIDATION_SUCCESS\"}}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"Passed\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":{\"Total\":{\"errorCount\":19,\"errorPct\":17,\"maxResTime\":16,\"meanResTime\":13,\"medianResTime\":10,\"minResTime\":18,\"pct1ResTime\":27,\"pct2ResTime\":20,\"pct3ResTime\":3,\"receivedKBytesPerSec\":13,\"sampleCount\":18,\"sentKBytesPerSec\":4,\"throughput\":5,\"transaction\":\"Total\"}},\"vusers\":4}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java new file mode 100644 index 0000000000000..880959b0f413b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.FileType; +import com.azure.developer.loadtesting.implementation.models.FileUrl; +import com.azure.developer.loadtesting.implementation.models.InputTestArtifacts; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class InputTestArtifactsTests { + @Test + public void testDeserialize() { + InputTestArtifacts model = + BinaryData.fromString( + "{\"configUrl\":{\"url\":\"ocipazyxoeg\",\"fileId\":\"g\",\"filename\":\"piu\",\"fileType\":2,\"expireTime\":\"2021-08-14T19:48:52Z\",\"validationStatus\":\"qzntypm\"},\"testScriptUrl\":{\"url\":\"izcdrqjsd\",\"fileId\":\"dnfyhxdeoejzicwi\",\"filename\":\"jttgzf\",\"fileType\":0,\"expireTime\":\"2021-09-13T12:21:33Z\",\"validationStatus\":\"khaj\"},\"userPropUrl\":{\"url\":\"eamdp\",\"fileId\":\"g\",\"filename\":\"pbuxwgipwhon\",\"fileType\":0,\"expireTime\":\"2021-05-13T18:46:16Z\",\"validationStatus\":\"wankixzbi\"},\"inputArtifactsZipFileurl\":{\"url\":\"pu\",\"fileId\":\"mryw\",\"filename\":\"zoqftiyqzrnkcqvy\",\"fileType\":2,\"expireTime\":\"2021-04-08T10:43:47Z\",\"validationStatus\":\"sicohoqqnwvlry\"},\"additionalUrls\":[{\"url\":\"heun\",\"fileId\":\"qhgyxzkonocukok\",\"filename\":\"axuconuq\",\"fileType\":1,\"expireTime\":\"2021-05-20T10:54:42Z\",\"validationStatus\":\"ypewrmjmwvvjekt\"}]}") + .toObject(InputTestArtifacts.class); + Assertions.assertEquals("ocipazyxoeg", model.getConfigUrl().getUrl()); + Assertions.assertEquals("g", model.getConfigUrl().getFileId()); + Assertions.assertEquals("piu", model.getConfigUrl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getConfigUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T19:48:52Z"), model.getConfigUrl().getExpireTime()); + Assertions.assertEquals("qzntypm", model.getConfigUrl().getValidationStatus()); + Assertions.assertEquals("izcdrqjsd", model.getTestScriptUrl().getUrl()); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.getTestScriptUrl().getFileId()); + Assertions.assertEquals("jttgzf", model.getTestScriptUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getTestScriptUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T12:21:33Z"), model.getTestScriptUrl().getExpireTime()); + Assertions.assertEquals("khaj", model.getTestScriptUrl().getValidationStatus()); + Assertions.assertEquals("eamdp", model.getUserPropUrl().getUrl()); + Assertions.assertEquals("g", model.getUserPropUrl().getFileId()); + Assertions.assertEquals("pbuxwgipwhon", model.getUserPropUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getUserPropUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T18:46:16Z"), model.getUserPropUrl().getExpireTime()); + Assertions.assertEquals("wankixzbi", model.getUserPropUrl().getValidationStatus()); + Assertions.assertEquals("pu", model.getInputArtifactsZipFileurl().getUrl()); + Assertions.assertEquals("mryw", model.getInputArtifactsZipFileurl().getFileId()); + Assertions.assertEquals("zoqftiyqzrnkcqvy", model.getInputArtifactsZipFileurl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getInputArtifactsZipFileurl().getFileType()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-04-08T10:43:47Z"), model.getInputArtifactsZipFileurl().getExpireTime()); + Assertions.assertEquals("sicohoqqnwvlry", model.getInputArtifactsZipFileurl().getValidationStatus()); + } + + @Test + public void testSerialize() { + InputTestArtifacts model = + new InputTestArtifacts() + .setConfigUrl( + new FileUrl() + .setUrl("ocipazyxoeg") + .setFileId("g") + .setFilename("piu") + .setFileType(FileType.TWO) + .setExpireTime(OffsetDateTime.parse("2021-08-14T19:48:52Z")) + .setValidationStatus("qzntypm")) + .setTestScriptUrl( + new FileUrl() + .setUrl("izcdrqjsd") + .setFileId("dnfyhxdeoejzicwi") + .setFilename("jttgzf") + .setFileType(FileType.ZERO) + .setExpireTime(OffsetDateTime.parse("2021-09-13T12:21:33Z")) + .setValidationStatus("khaj")) + .setUserPropUrl( + new FileUrl() + .setUrl("eamdp") + .setFileId("g") + .setFilename("pbuxwgipwhon") + .setFileType(FileType.ZERO) + .setExpireTime(OffsetDateTime.parse("2021-05-13T18:46:16Z")) + .setValidationStatus("wankixzbi")) + .setInputArtifactsZipFileurl( + new FileUrl() + .setUrl("pu") + .setFileId("mryw") + .setFilename("zoqftiyqzrnkcqvy") + .setFileType(FileType.TWO) + .setExpireTime(OffsetDateTime.parse("2021-04-08T10:43:47Z")) + .setValidationStatus("sicohoqqnwvlry")); + model = BinaryData.fromObject(model).toObject(InputTestArtifacts.class); + Assertions.assertEquals("ocipazyxoeg", model.getConfigUrl().getUrl()); + Assertions.assertEquals("g", model.getConfigUrl().getFileId()); + Assertions.assertEquals("piu", model.getConfigUrl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getConfigUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T19:48:52Z"), model.getConfigUrl().getExpireTime()); + Assertions.assertEquals("qzntypm", model.getConfigUrl().getValidationStatus()); + Assertions.assertEquals("izcdrqjsd", model.getTestScriptUrl().getUrl()); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.getTestScriptUrl().getFileId()); + Assertions.assertEquals("jttgzf", model.getTestScriptUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getTestScriptUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T12:21:33Z"), model.getTestScriptUrl().getExpireTime()); + Assertions.assertEquals("khaj", model.getTestScriptUrl().getValidationStatus()); + Assertions.assertEquals("eamdp", model.getUserPropUrl().getUrl()); + Assertions.assertEquals("g", model.getUserPropUrl().getFileId()); + Assertions.assertEquals("pbuxwgipwhon", model.getUserPropUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getUserPropUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T18:46:16Z"), model.getUserPropUrl().getExpireTime()); + Assertions.assertEquals("wankixzbi", model.getUserPropUrl().getValidationStatus()); + Assertions.assertEquals("pu", model.getInputArtifactsZipFileurl().getUrl()); + Assertions.assertEquals("mryw", model.getInputArtifactsZipFileurl().getFileId()); + Assertions.assertEquals("zoqftiyqzrnkcqvy", model.getInputArtifactsZipFileurl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getInputArtifactsZipFileurl().getFileType()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-04-08T10:43:47Z"), model.getInputArtifactsZipFileurl().getExpireTime()); + Assertions.assertEquals("sicohoqqnwvlry", model.getInputArtifactsZipFileurl().getValidationStatus()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java new file mode 100644 index 0000000000000..e72cf0e9a1ab9 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ListLoadTestSearchTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testListLoadTestSearchTests() { + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("lastUpdatedEndTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("lastUpdatedStartTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest"); + Response response = testClient.listLoadTestSearchWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"nextLink\":\"next link\",\"value\":[{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"pfmetric1\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":20}}},\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testId\":\"12345678-1234-1234-1234-123456789012\"}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java new file mode 100644 index 0000000000000..77b76b300c420 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ListSupportedResourceTypeTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testListSupportedResourceTypeTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.listSupportedResourceTypeWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"value\":[\"microsoft.cache/redis\",\"microsoft.compute/virtualmachines\",\"microsoft.compute/virtualmachinescalesets\",\"microsoft.containerservice/managedclusters\",\"microsoft.web/sites\",\"microsoft.web/serverfarms\",\"microsoft.insights/components\",\"microsoft.servicefabricmesh/applications\",\"microsoft.web/staticsites\",\"microsoft.network/trafficmanagerprofiles\",\"microsoft.apimanagement/service\",\"microsoft.classicstorage/storageaccounts\",\"microsoft.storage/storageaccounts\",\"microsoft.storage/storageaccounts/fileservices\",\"microsoft.classicstorage/storageaccounts/fileservices\",\"microsoft.storage/storageaccounts/blobservices\",\"microsoft.classicstorage/storageaccounts/blobservices\",\"microsoft.storage/storageaccounts/tableservices\",\"microsoft.classicstorage/storageaccounts/tableservices\",\"microsoft.documentdb/databaseaccounts\",\"microsoft.sql/managedinstances\",\"microsoft.dbformariadb/servers\",\"microsoft.dbforpostgresql/servers\",\"microsoft.dbforpostgresql/serversv2\",\"microsoft.dbformysql/servers\",\"microsoft.sql/servers/databases\",\"microsoft.sql/servers/elasticpools\",\"microsoft.servicebus/namespaces\",\"microsoft.eventhub/namespaces\",\"microsoft.storage/storageaccounts/queueservices\",\"microsoft.classicstorage/storageaccounts/queueservices\",\"microsoft.eventhub/clusters\",\"microsoft.keyvault/vaults\"]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java new file mode 100644 index 0000000000000..79c5d0e44e3a0 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ListTestRunsSearchTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testListTestRunsSearchTests() { + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("executionFrom", "2021-12-05T16:43:48.805Z") + .addQueryParam("executionTo", "2021-12-05T16:43:48.805Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest_Run1") + .addQueryParam("status", "DONE,EXECUTING") + .addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); + Response response = testRunClient.listTestRunsSearchWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"nextLink\":\"next link\",\"value\":[{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":18,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":10}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"DONE\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":{\"expireTime\":\"2022-05-16T09:14:46.0411793+00:00\",\"fileId\":\"abb846a7-63af-4d63-bb3d-a7aa4caff55c\",\"fileType\":2,\"filename\":\"worker.log\",\"url\":\"https://dummyurl.com/logresource\",\"validationStatus\":\"\"},\"resultUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/dummyresourceresult\",\"validationStatus\":\"VALIDATION_SUCCESS\"}}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"Passed\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":{\"Total\":{\"errorCount\":19,\"errorPct\":17,\"maxResTime\":16,\"meanResTime\":13,\"medianResTime\":10,\"minResTime\":18,\"pct1ResTime\":27,\"pct2ResTime\":20,\"pct3ResTime\":3,\"receivedKBytesPerSec\":13,\"sampleCount\":18,\"sentKBytesPerSec\":4,\"throughput\":5,\"transaction\":\"Total\"}},\"vusers\":4}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java new file mode 100644 index 0000000000000..4656e6803682f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class LoadTestClientTestBase extends TestBase { + protected AppComponentClient appComponentClient; + + protected ServerMetricsClient serverMetricsClient; + + protected TestClient testClient; + + protected TestRunClient testRunClient; + + @Override + protected void beforeTest() { + AppComponentClientBuilder appComponentClientbuilder = + new AppComponentClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + appComponentClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + appComponentClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + appComponentClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + appComponentClient = appComponentClientbuilder.buildClient(); + + ServerMetricsClientBuilder serverMetricsClientbuilder = + new ServerMetricsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + serverMetricsClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + serverMetricsClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + serverMetricsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + serverMetricsClient = serverMetricsClientbuilder.buildClient(); + + TestClientBuilder testClientbuilder = + new TestClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + testClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + testClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + testClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + testClient = testClientbuilder.buildClient(); + + TestRunClientBuilder testRunClientbuilder = + new TestRunClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + testRunClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + testRunClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + testRunClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + testRunClient = testRunClientbuilder.buildClient(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java new file mode 100644 index 0000000000000..556338c1abf27 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class LoadTestConfigTests { + @Test + public void testDeserialize() { + LoadTestConfig model = + BinaryData.fromString("{\"engineInstances\":330627677,\"splitAllCSVs\":false}") + .toObject(LoadTestConfig.class); + Assertions.assertEquals(330627677, model.getEngineInstances()); + Assertions.assertEquals(false, model.isSplitAllCSVs()); + } + + @Test + public void testSerialize() { + LoadTestConfig model = new LoadTestConfig().setEngineInstances(330627677).setSplitAllCSVs(false); + model = BinaryData.fromObject(model).toObject(LoadTestConfig.class); + Assertions.assertEquals(330627677, model.getEngineInstances()); + Assertions.assertEquals(false, model.isSplitAllCSVs()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java new file mode 100644 index 0000000000000..fc774c4856a80 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.LocalizedName; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class LocalizedNameTests { + @Test + public void testDeserialize() { + LocalizedName model = + BinaryData.fromString("{\"value\":\"wjdk\",\"localizedValue\":\"soodqxhcrmnoh\"}") + .toObject(LocalizedName.class); + Assertions.assertEquals("wjdk", model.getValue()); + Assertions.assertEquals("soodqxhcrmnoh", model.getLocalizedValue()); + } + + @Test + public void testSerialize() { + LocalizedName model = new LocalizedName().setValue("wjdk").setLocalizedValue("soodqxhcrmnoh"); + model = BinaryData.fromObject(model).toObject(LocalizedName.class); + Assertions.assertEquals("wjdk", model.getValue()); + Assertions.assertEquals("soodqxhcrmnoh", model.getLocalizedValue()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java new file mode 100644 index 0000000000000..105acaab0a291 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.FileType; +import com.azure.developer.loadtesting.implementation.models.FileUrl; +import com.azure.developer.loadtesting.implementation.models.OutputTestArtifacts; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class OutputTestArtifactsTests { + @Test + public void testDeserialize() { + OutputTestArtifacts model = + BinaryData.fromString( + "{\"resultUrl\":{\"url\":\"sd\",\"fileId\":\"ouwaboekqvkeln\",\"filename\":\"vbxwyjsflhh\",\"fileType\":2,\"expireTime\":\"2021-02-06T03:40:59Z\",\"validationStatus\":\"ixisxyawjoy\"},\"logsUrl\":{\"url\":\"slyjpkiid\",\"fileId\":\"exznelixhnr\",\"filename\":\"folhbnxknal\",\"fileType\":2,\"expireTime\":\"2021-05-05T13:18:41Z\",\"validationStatus\":\"gdtpnapnyiro\"}}") + .toObject(OutputTestArtifacts.class); + Assertions.assertEquals("sd", model.getResultUrl().getUrl()); + Assertions.assertEquals("ouwaboekqvkeln", model.getResultUrl().getFileId()); + Assertions.assertEquals("vbxwyjsflhh", model.getResultUrl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getResultUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T03:40:59Z"), model.getResultUrl().getExpireTime()); + Assertions.assertEquals("ixisxyawjoy", model.getResultUrl().getValidationStatus()); + Assertions.assertEquals("slyjpkiid", model.getLogsUrl().getUrl()); + Assertions.assertEquals("exznelixhnr", model.getLogsUrl().getFileId()); + Assertions.assertEquals("folhbnxknal", model.getLogsUrl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getLogsUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T13:18:41Z"), model.getLogsUrl().getExpireTime()); + Assertions.assertEquals("gdtpnapnyiro", model.getLogsUrl().getValidationStatus()); + } + + @Test + public void testSerialize() { + OutputTestArtifacts model = + new OutputTestArtifacts() + .setResultUrl( + new FileUrl() + .setUrl("sd") + .setFileId("ouwaboekqvkeln") + .setFilename("vbxwyjsflhh") + .setFileType(FileType.TWO) + .setExpireTime(OffsetDateTime.parse("2021-02-06T03:40:59Z")) + .setValidationStatus("ixisxyawjoy")) + .setLogsUrl( + new FileUrl() + .setUrl("slyjpkiid") + .setFileId("exznelixhnr") + .setFilename("folhbnxknal") + .setFileType(FileType.TWO) + .setExpireTime(OffsetDateTime.parse("2021-05-05T13:18:41Z")) + .setValidationStatus("gdtpnapnyiro")); + model = BinaryData.fromObject(model).toObject(OutputTestArtifacts.class); + Assertions.assertEquals("sd", model.getResultUrl().getUrl()); + Assertions.assertEquals("ouwaboekqvkeln", model.getResultUrl().getFileId()); + Assertions.assertEquals("vbxwyjsflhh", model.getResultUrl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getResultUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T03:40:59Z"), model.getResultUrl().getExpireTime()); + Assertions.assertEquals("ixisxyawjoy", model.getResultUrl().getValidationStatus()); + Assertions.assertEquals("slyjpkiid", model.getLogsUrl().getUrl()); + Assertions.assertEquals("exznelixhnr", model.getLogsUrl().getFileId()); + Assertions.assertEquals("folhbnxknal", model.getLogsUrl().getFilename()); + Assertions.assertEquals(FileType.TWO, model.getLogsUrl().getFileType()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T13:18:41Z"), model.getLogsUrl().getExpireTime()); + Assertions.assertEquals("gdtpnapnyiro", model.getLogsUrl().getValidationStatus()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java new file mode 100644 index 0000000000000..f4f8f978a04f5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; +import com.azure.developer.loadtesting.implementation.models.PassFailMetric; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class PassFailCriteriaTests { + @Test + public void testDeserialize() { + PassFailCriteria model = + BinaryData.fromString( + "{\"passFailMetrics\":{\"yiuokktwh\":{\"clientmetric\":\"unqecanoae\",\"aggregate\":\"fhyhltrpmopjmcma\",\"condition\":\"okth\",\"requestName\":\"iuaod\",\"value\":49.02669503174233,\"action\":\"vxodpu\",\"actualValue\":83.70553981890328,\"result\":\"ydagfuaxbe\"},\"d\":{\"clientmetric\":\"xw\",\"aggregate\":\"wqsmbsur\",\"condition\":\"imoryocfsfksym\",\"requestName\":\"ys\",\"value\":0.7116403106567359,\"action\":\"xhqyudxorrqnb\",\"actualValue\":40.67764391393379,\"result\":\"yifqrvkdvjsllrmv\"},\"rsa\":{\"clientmetric\":\"atkpnp\",\"aggregate\":\"exxbczwtr\",\"condition\":\"iqzbq\",\"requestName\":\"sovmyokacspkwl\",\"value\":77.86307144365512,\"action\":\"pxjmflbvvnchr\",\"actualValue\":65.8967024807498,\"result\":\"wzjuqk\"},\"eggzfb\":{\"clientmetric\":\"wkuofoskghsauu\",\"aggregate\":\"jmvxie\",\"condition\":\"ugidyjrr\",\"requestName\":\"y\",\"value\":93.63707158222255,\"action\":\"xc\",\"actualValue\":14.791695296295293,\"result\":\"lhocohslkev\"}}}") + .toObject(PassFailCriteria.class); + Assertions.assertEquals("unqecanoae", model.getPassFailMetrics().get("yiuokktwh").getClientmetric()); + Assertions.assertEquals("fhyhltrpmopjmcma", model.getPassFailMetrics().get("yiuokktwh").getAggregate()); + Assertions.assertEquals("okth", model.getPassFailMetrics().get("yiuokktwh").getCondition()); + Assertions.assertEquals("iuaod", model.getPassFailMetrics().get("yiuokktwh").getRequestName()); + Assertions.assertEquals(49.02669503174233D, model.getPassFailMetrics().get("yiuokktwh").getValue()); + Assertions.assertEquals("vxodpu", model.getPassFailMetrics().get("yiuokktwh").getAction()); + } + + @Test + public void testSerialize() { + PassFailCriteria model = + new PassFailCriteria() + .setPassFailMetrics( + mapOf( + "yiuokktwh", + new PassFailMetric() + .setClientmetric("unqecanoae") + .setAggregate("fhyhltrpmopjmcma") + .setCondition("okth") + .setRequestName("iuaod") + .setValue(49.02669503174233D) + .setAction("vxodpu"), + "d", + new PassFailMetric() + .setClientmetric("xw") + .setAggregate("wqsmbsur") + .setCondition("imoryocfsfksym") + .setRequestName("ys") + .setValue(0.7116403106567359D) + .setAction("xhqyudxorrqnb"), + "rsa", + new PassFailMetric() + .setClientmetric("atkpnp") + .setAggregate("exxbczwtr") + .setCondition("iqzbq") + .setRequestName("sovmyokacspkwl") + .setValue(77.86307144365512D) + .setAction("pxjmflbvvnchr"), + "eggzfb", + new PassFailMetric() + .setClientmetric("wkuofoskghsauu") + .setAggregate("jmvxie") + .setCondition("ugidyjrr") + .setRequestName("y") + .setValue(93.63707158222255D) + .setAction("xc"))); + model = BinaryData.fromObject(model).toObject(PassFailCriteria.class); + Assertions.assertEquals("unqecanoae", model.getPassFailMetrics().get("yiuokktwh").getClientmetric()); + Assertions.assertEquals("fhyhltrpmopjmcma", model.getPassFailMetrics().get("yiuokktwh").getAggregate()); + Assertions.assertEquals("okth", model.getPassFailMetrics().get("yiuokktwh").getCondition()); + Assertions.assertEquals("iuaod", model.getPassFailMetrics().get("yiuokktwh").getRequestName()); + Assertions.assertEquals(49.02669503174233D, model.getPassFailMetrics().get("yiuokktwh").getValue()); + Assertions.assertEquals("vxodpu", model.getPassFailMetrics().get("yiuokktwh").getAction()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java new file mode 100644 index 0000000000000..350e7b5e95e8e --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.PassFailMetric; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class PassFailMetricTests { + @Test + public void testDeserialize() { + PassFailMetric model = + BinaryData.fromString( + "{\"clientmetric\":\"fmvfaxkffeiit\",\"aggregate\":\"vmezy\",\"condition\":\"hxmzsbbzoggig\",\"requestName\":\"wburvjxxjnspydpt\",\"value\":65.57248882227046,\"action\":\"ou\",\"actualValue\":75.86161422302953,\"result\":\"wtiukbldn\"}") + .toObject(PassFailMetric.class); + Assertions.assertEquals("fmvfaxkffeiit", model.getClientmetric()); + Assertions.assertEquals("vmezy", model.getAggregate()); + Assertions.assertEquals("hxmzsbbzoggig", model.getCondition()); + Assertions.assertEquals("wburvjxxjnspydpt", model.getRequestName()); + Assertions.assertEquals(65.57248882227046D, model.getValue()); + Assertions.assertEquals("ou", model.getAction()); + } + + @Test + public void testSerialize() { + PassFailMetric model = + new PassFailMetric() + .setClientmetric("fmvfaxkffeiit") + .setAggregate("vmezy") + .setCondition("hxmzsbbzoggig") + .setRequestName("wburvjxxjnspydpt") + .setValue(65.57248882227046D) + .setAction("ou"); + model = BinaryData.fromObject(model).toObject(PassFailMetric.class); + Assertions.assertEquals("fmvfaxkffeiit", model.getClientmetric()); + Assertions.assertEquals("vmezy", model.getAggregate()); + Assertions.assertEquals("hxmzsbbzoggig", model.getCondition()); + Assertions.assertEquals("wburvjxxjnspydpt", model.getRequestName()); + Assertions.assertEquals(65.57248882227046D, model.getValue()); + Assertions.assertEquals("ou", model.getAction()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java new file mode 100644 index 0000000000000..9b6e8ff8335f7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.ResourceMetricModel; +import com.azure.developer.loadtesting.implementation.models.ServerMetricName; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ResourceMetricModelTests { + @Test + public void testDeserialize() { + ResourceMetricModel model = + BinaryData.fromString( + "{\"id\":\"qrglssainqpjwn\",\"resourceId\":\"lljfmppeeb\",\"metricnamespace\":\"mgxsab\",\"displayDescription\":\"qduujitcjczdz\",\"name\":{\"value\":\"vndhkrwpdapp\",\"localizedValue\":\"sbdkvwr\"},\"aggregation\":\"jfeusnh\",\"unit\":\"je\",\"resourceType\":\"tmrldhugjzzdatq\"}") + .toObject(ResourceMetricModel.class); + Assertions.assertEquals("lljfmppeeb", model.getResourceId()); + Assertions.assertEquals("mgxsab", model.getMetricnamespace()); + Assertions.assertEquals("qduujitcjczdz", model.getDisplayDescription()); + Assertions.assertEquals("vndhkrwpdapp", model.getName().getValue()); + Assertions.assertEquals("sbdkvwr", model.getName().getLocalizedValue()); + Assertions.assertEquals("jfeusnh", model.getAggregation()); + Assertions.assertEquals("je", model.getUnit()); + Assertions.assertEquals("tmrldhugjzzdatq", model.getResourceType()); + } + + @Test + public void testSerialize() { + ResourceMetricModel model = + new ResourceMetricModel( + "lljfmppeeb", + "mgxsab", + new ServerMetricName("vndhkrwpdapp", "sbdkvwr"), + "jfeusnh", + "tmrldhugjzzdatq") + .setDisplayDescription("qduujitcjczdz") + .setUnit("je"); + model = BinaryData.fromObject(model).toObject(ResourceMetricModel.class); + Assertions.assertEquals("lljfmppeeb", model.getResourceId()); + Assertions.assertEquals("mgxsab", model.getMetricnamespace()); + Assertions.assertEquals("qduujitcjczdz", model.getDisplayDescription()); + Assertions.assertEquals("vndhkrwpdapp", model.getName().getValue()); + Assertions.assertEquals("sbdkvwr", model.getName().getLocalizedValue()); + Assertions.assertEquals("jfeusnh", model.getAggregation()); + Assertions.assertEquals("je", model.getUnit()); + Assertions.assertEquals("tmrldhugjzzdatq", model.getResourceType()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java new file mode 100644 index 0000000000000..9cb32bdd178f3 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.SecretMetadata; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class SecretMetadataTests { + @Test + public void testDeserialize() { + SecretMetadata model = + BinaryData.fromString("{\"value\":\"erfuwuttt\",\"type\":\"vjrbirphxepcyvah\"}") + .toObject(SecretMetadata.class); + Assertions.assertEquals("erfuwuttt", model.getValue()); + Assertions.assertEquals("vjrbirphxepcyvah", model.getType()); + } + + @Test + public void testSerialize() { + SecretMetadata model = new SecretMetadata().setValue("erfuwuttt").setType("vjrbirphxepcyvah"); + model = BinaryData.fromObject(model).toObject(SecretMetadata.class); + Assertions.assertEquals("erfuwuttt", model.getValue()); + Assertions.assertEquals("vjrbirphxepcyvah", model.getType()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java new file mode 100644 index 0000000000000..ed36fcb3da97b --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.Series; +import com.azure.developer.loadtesting.implementation.models.TimeSeries; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class SeriesTests { + @Test + public void testDeserialize() { + Series model = + BinaryData.fromString( + "{\"activeUsers\":{\"izxbmpgcjef\":[{\"timestamp\":\"2021-10-04T07:28:11Z\",\"value\":92.22079373726689},{\"timestamp\":\"2021-06-26T20:58:29Z\",\"value\":2.299894041657846},{\"timestamp\":\"2021-03-25T05:26:25Z\",\"value\":94.56387544596132}]},\"responseTime\":{\"d\":[{\"timestamp\":\"2021-05-22T02:28:39Z\",\"value\":98.18414033464762}]},\"throughput\":{\"mnzb\":[{\"timestamp\":\"2021-02-09T00:05:07Z\",\"value\":86.09688986688754}],\"dyhtozfikdowwquu\":[{\"timestamp\":\"2021-09-06T03:21:41Z\",\"value\":25.369948465939373},{\"timestamp\":\"2021-07-30T09:20:18Z\",\"value\":49.83795369512855},{\"timestamp\":\"2021-08-25T15:11:39Z\",\"value\":17.40379051397306},{\"timestamp\":\"2021-03-26T18:18:01Z\",\"value\":13.315355649235116}],\"zonosgg\":[{\"timestamp\":\"2021-05-15T23:08:57Z\",\"value\":83.69136348663503},{\"timestamp\":\"2021-10-23T21:40:50Z\",\"value\":87.05152697933156}],\"iiswacffgdkzze\":[{\"timestamp\":\"2021-04-17T15:34:56Z\",\"value\":26.79557146459449},{\"timestamp\":\"2021-01-27T23:27:37Z\",\"value\":4.689437310526101},{\"timestamp\":\"2021-06-19T07:56:54Z\",\"value\":55.007020519994455}]},\"errors\":{\"ppfufl\":[{\"timestamp\":\"2021-08-19T00:26:37Z\",\"value\":70.37932285828938},{\"timestamp\":\"2021-01-14T03:31:38Z\",\"value\":40.827588761382884}],\"cnihgwqapnedgfbc\":[{\"timestamp\":\"2021-05-23T16:48:47Z\",\"value\":46.16105003491787},{\"timestamp\":\"2021-07-11T09:21:13Z\",\"value\":92.56029614054873},{\"timestamp\":\"2021-07-13T08:45:58Z\",\"value\":37.0611510862625}]}}") + .toObject(Series.class); + Assertions.assertEquals( + OffsetDateTime.parse("2021-10-04T07:28:11Z"), + model.getActiveUsers().get("izxbmpgcjef").get(0).getTimestamp()); + Assertions.assertEquals(92.22079373726689D, model.getActiveUsers().get("izxbmpgcjef").get(0).getValue()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-05-22T02:28:39Z"), model.getResponseTime().get("d").get(0).getTimestamp()); + Assertions.assertEquals(98.18414033464762D, model.getResponseTime().get("d").get(0).getValue()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-02-09T00:05:07Z"), model.getThroughput().get("mnzb").get(0).getTimestamp()); + Assertions.assertEquals(86.09688986688754D, model.getThroughput().get("mnzb").get(0).getValue()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-08-19T00:26:37Z"), model.getErrors().get("ppfufl").get(0).getTimestamp()); + Assertions.assertEquals(70.37932285828938D, model.getErrors().get("ppfufl").get(0).getValue()); + } + + @Test + public void testSerialize() { + Series model = + new Series() + .setActiveUsers( + mapOf( + "izxbmpgcjef", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-10-04T07:28:11Z")) + .setValue(92.22079373726689D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-06-26T20:58:29Z")) + .setValue(2.299894041657846D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-03-25T05:26:25Z")) + .setValue(94.56387544596132D)))) + .setResponseTime( + mapOf( + "d", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-05-22T02:28:39Z")) + .setValue(98.18414033464762D)))) + .setThroughput( + mapOf( + "mnzb", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-02-09T00:05:07Z")) + .setValue(86.09688986688754D)), + "dyhtozfikdowwquu", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-09-06T03:21:41Z")) + .setValue(25.369948465939373D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-07-30T09:20:18Z")) + .setValue(49.83795369512855D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-08-25T15:11:39Z")) + .setValue(17.40379051397306D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-03-26T18:18:01Z")) + .setValue(13.315355649235116D)), + "zonosgg", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-05-15T23:08:57Z")) + .setValue(83.69136348663503D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-10-23T21:40:50Z")) + .setValue(87.05152697933156D)), + "iiswacffgdkzze", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-04-17T15:34:56Z")) + .setValue(26.79557146459449D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-01-27T23:27:37Z")) + .setValue(4.689437310526101D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-06-19T07:56:54Z")) + .setValue(55.007020519994455D)))) + .setErrors( + mapOf( + "ppfufl", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-08-19T00:26:37Z")) + .setValue(70.37932285828938D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-01-14T03:31:38Z")) + .setValue(40.827588761382884D)), + "cnihgwqapnedgfbc", + Arrays.asList( + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-05-23T16:48:47Z")) + .setValue(46.16105003491787D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-07-11T09:21:13Z")) + .setValue(92.56029614054873D), + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-07-13T08:45:58Z")) + .setValue(37.0611510862625D)))); + model = BinaryData.fromObject(model).toObject(Series.class); + Assertions.assertEquals( + OffsetDateTime.parse("2021-10-04T07:28:11Z"), + model.getActiveUsers().get("izxbmpgcjef").get(0).getTimestamp()); + Assertions.assertEquals(92.22079373726689D, model.getActiveUsers().get("izxbmpgcjef").get(0).getValue()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-05-22T02:28:39Z"), model.getResponseTime().get("d").get(0).getTimestamp()); + Assertions.assertEquals(98.18414033464762D, model.getResponseTime().get("d").get(0).getValue()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-02-09T00:05:07Z"), model.getThroughput().get("mnzb").get(0).getTimestamp()); + Assertions.assertEquals(86.09688986688754D, model.getThroughput().get("mnzb").get(0).getValue()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-08-19T00:26:37Z"), model.getErrors().get("ppfufl").get(0).getTimestamp()); + Assertions.assertEquals(70.37932285828938D, model.getErrors().get("ppfufl").get(0).getValue()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java new file mode 100644 index 0000000000000..f454e8b3b461a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.ServerMetricName; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ServerMetricNameTests { + @Test + public void testDeserialize() { + ServerMetricName model = + BinaryData.fromString("{\"value\":\"hocdgeab\",\"localizedValue\":\"gphuticndvka\"}") + .toObject(ServerMetricName.class); + Assertions.assertEquals("hocdgeab", model.getValue()); + Assertions.assertEquals("gphuticndvka", model.getLocalizedValue()); + } + + @Test + public void testSerialize() { + ServerMetricName model = new ServerMetricName("hocdgeab", "gphuticndvka"); + model = BinaryData.fromObject(model).toObject(ServerMetricName.class); + Assertions.assertEquals("hocdgeab", model.getValue()); + Assertions.assertEquals("gphuticndvka", model.getLocalizedValue()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java new file mode 100644 index 0000000000000..239dbb187bea1 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.ResourceMetricModel; +import com.azure.developer.loadtesting.implementation.models.ServerMetricName; +import com.azure.developer.loadtesting.implementation.models.ServerMetricsModel; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class ServerMetricsModelTests { + @Test + public void testDeserialize() { + ServerMetricsModel model = + BinaryData.fromString( + "{\"name\":\"vukxgau\",\"testId\":\"cs\",\"testRunId\":\"s\",\"metrics\":{\"vmkjozkrwfndiodj\":{\"id\":\"ejhkry\",\"resourceId\":\"tnapczwlokjyemkk\",\"metricnamespace\":\"ni\",\"displayDescription\":\"oxzjnchgejspod\",\"name\":{\"value\":\"ailzydehojwyahu\",\"localizedValue\":\"inpm\"},\"aggregation\":\"njaqwixjspro\",\"unit\":\"cputegjvwmfdats\",\"resourceType\":\"mdvpjhulsu\"},\"zfsinzgvf\":{\"id\":\"lwejdpv\",\"resourceId\":\"ryo\",\"metricnamespace\":\"psoacctazakljl\",\"displayDescription\":\"bcryffdfd\",\"name\":{\"value\":\"sy\",\"localizedValue\":\"expa\"},\"aggregation\":\"jakhmsbzjh\",\"unit\":\"zevdphlx\",\"resourceType\":\"olthqtrgqjbp\"},\"usivye\":{\"id\":\"rwzoxxjtfelluwf\",\"resourceId\":\"it\",\"metricnamespace\":\"np\",\"displayDescription\":\"fpjkjlxofp\",\"name\":{\"value\":\"vhpfxxypininmay\",\"localizedValue\":\"uybbkpodep\"},\"aggregation\":\"oginuvamiheognar\",\"unit\":\"xth\",\"resourceType\":\"o\"},\"cjdkwtnhxbnjbi\":{\"id\":\"ciqihnhung\",\"resourceId\":\"wjzrnfygxgisp\",\"metricnamespace\":\"mvtzfkufub\",\"displayDescription\":\"ofx\",\"name\":{\"value\":\"eofjaeqjh\",\"localizedValue\":\"jbasvmsmjqulngs\"},\"aggregation\":\"tnb\",\"unit\":\"kzgcwrwcl\",\"resourceType\":\"xwrljdouskcqvkoc\"}}}") + .toObject(ServerMetricsModel.class); + Assertions.assertEquals("cs", model.getTestId()); + Assertions.assertEquals("s", model.getTestRunId()); + Assertions.assertEquals("tnapczwlokjyemkk", model.getMetrics().get("vmkjozkrwfndiodj").getResourceId()); + Assertions.assertEquals("ni", model.getMetrics().get("vmkjozkrwfndiodj").getMetricnamespace()); + Assertions.assertEquals("oxzjnchgejspod", model.getMetrics().get("vmkjozkrwfndiodj").getDisplayDescription()); + Assertions.assertEquals("ailzydehojwyahu", model.getMetrics().get("vmkjozkrwfndiodj").getName().getValue()); + Assertions.assertEquals("inpm", model.getMetrics().get("vmkjozkrwfndiodj").getName().getLocalizedValue()); + Assertions.assertEquals("njaqwixjspro", model.getMetrics().get("vmkjozkrwfndiodj").getAggregation()); + Assertions.assertEquals("cputegjvwmfdats", model.getMetrics().get("vmkjozkrwfndiodj").getUnit()); + Assertions.assertEquals("mdvpjhulsu", model.getMetrics().get("vmkjozkrwfndiodj").getResourceType()); + } + + @Test + public void testSerialize() { + ServerMetricsModel model = + new ServerMetricsModel() + .setTestId("cs") + .setTestRunId("s") + .setMetrics( + mapOf( + "vmkjozkrwfndiodj", + new ResourceMetricModel( + "tnapczwlokjyemkk", + "ni", + new ServerMetricName("ailzydehojwyahu", "inpm"), + "njaqwixjspro", + "mdvpjhulsu") + .setDisplayDescription("oxzjnchgejspod") + .setUnit("cputegjvwmfdats"), + "zfsinzgvf", + new ResourceMetricModel( + "ryo", + "psoacctazakljl", + new ServerMetricName("sy", "expa"), + "jakhmsbzjh", + "olthqtrgqjbp") + .setDisplayDescription("bcryffdfd") + .setUnit("zevdphlx"), + "usivye", + new ResourceMetricModel( + "it", + "np", + new ServerMetricName("vhpfxxypininmay", "uybbkpodep"), + "oginuvamiheognar", + "o") + .setDisplayDescription("fpjkjlxofp") + .setUnit("xth"), + "cjdkwtnhxbnjbi", + new ResourceMetricModel( + "wjzrnfygxgisp", + "mvtzfkufub", + new ServerMetricName("eofjaeqjh", "jbasvmsmjqulngs"), + "tnb", + "xwrljdouskcqvkoc") + .setDisplayDescription("ofx") + .setUnit("kzgcwrwcl"))); + model = BinaryData.fromObject(model).toObject(ServerMetricsModel.class); + Assertions.assertEquals("cs", model.getTestId()); + Assertions.assertEquals("s", model.getTestRunId()); + Assertions.assertEquals("tnapczwlokjyemkk", model.getMetrics().get("vmkjozkrwfndiodj").getResourceId()); + Assertions.assertEquals("ni", model.getMetrics().get("vmkjozkrwfndiodj").getMetricnamespace()); + Assertions.assertEquals("oxzjnchgejspod", model.getMetrics().get("vmkjozkrwfndiodj").getDisplayDescription()); + Assertions.assertEquals("ailzydehojwyahu", model.getMetrics().get("vmkjozkrwfndiodj").getName().getValue()); + Assertions.assertEquals("inpm", model.getMetrics().get("vmkjozkrwfndiodj").getName().getLocalizedValue()); + Assertions.assertEquals("njaqwixjspro", model.getMetrics().get("vmkjozkrwfndiodj").getAggregation()); + Assertions.assertEquals("cputegjvwmfdats", model.getMetrics().get("vmkjozkrwfndiodj").getUnit()); + Assertions.assertEquals("mdvpjhulsu", model.getMetrics().get("vmkjozkrwfndiodj").getResourceType()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java new file mode 100644 index 0000000000000..47a246cd4a5a9 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class StopTestRunTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testStopTestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.stopTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":null,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"pfmetric1\":{\"action\":\"continue\",\"actualValue\":0,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":null,\"value\":20}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"CANCELLING\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":null,\"resultUrl\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"NOT_APPLICABLE\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":null,\"vusers\":null}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java new file mode 100644 index 0000000000000..6f32295d7fa36 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.SupportedResourceType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class SupportedResourceTypeTests { + @Test + public void testDeserialize() { + SupportedResourceType model = + BinaryData.fromString("{\"value\":[\"kwh\",\"soifiyipjxsqw\"]}").toObject(SupportedResourceType.class); + Assertions.assertEquals("kwh", model.getValue().get(0)); + } + + @Test + public void testSerialize() { + SupportedResourceType model = new SupportedResourceType().setValue(Arrays.asList("kwh", "soifiyipjxsqw")); + model = BinaryData.fromObject(model).toObject(SupportedResourceType.class); + Assertions.assertEquals("kwh", model.getValue().get(0)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java new file mode 100644 index 0000000000000..fc24f3fecc6d8 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.FileType; +import com.azure.developer.loadtesting.implementation.models.FileUrl; +import com.azure.developer.loadtesting.implementation.models.InputTestArtifacts; +import com.azure.developer.loadtesting.implementation.models.OutputTestArtifacts; +import com.azure.developer.loadtesting.implementation.models.TestArtifacts; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class TestArtifactsTests { + @Test + public void testDeserialize() { + TestArtifacts model = + BinaryData.fromString( + "{\"inputArtifacts\":{\"configUrl\":{\"url\":\"cjooxdjebwpucwwf\",\"fileId\":\"vbvmeu\",\"filename\":\"ivyhzceuojgjrwju\",\"fileType\":0,\"expireTime\":\"2021-05-06T21:21:59Z\",\"validationStatus\":\"cdytdxw\"},\"testScriptUrl\":{\"url\":\"nrjawgqwg\",\"fileId\":\"ni\",\"filename\":\"x\",\"fileType\":1,\"expireTime\":\"2021-04-10T12:35:25Z\",\"validationStatus\":\"gklwn\"},\"userPropUrl\":{\"url\":\"jdauwhvy\",\"fileId\":\"zbtd\",\"filename\":\"ujznb\",\"fileType\":1,\"expireTime\":\"2021-05-19T00:36:02Z\",\"validationStatus\":\"przqlveu\"},\"inputArtifactsZipFileurl\":{\"url\":\"pjmkhfxobbc\",\"fileId\":\"s\",\"filename\":\"jriplrbpbewtghf\",\"fileType\":2,\"expireTime\":\"2021-09-03T22:44:02Z\",\"validationStatus\":\"xzvlvqhjkbegib\"},\"additionalUrls\":[{\"url\":\"iebwwaloayqcgwrt\",\"fileId\":\"uzgwyzmhtx\",\"filename\":\"gmtsavjcbpwxqpsr\",\"fileType\":0,\"expireTime\":\"2021-01-16T18:55:51Z\",\"validationStatus\":\"vriuhprwmdyvx\"},{\"url\":\"ayriwwroyqbexrm\",\"fileId\":\"ibycno\",\"filename\":\"knme\",\"fileType\":1,\"expireTime\":\"2021-05-25T06:46Z\",\"validationStatus\":\"ah\"}]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"zhpvgqzcjrvxd\",\"fileId\":\"lmwlxkvugfhzo\",\"filename\":\"wjvzunluthnn\",\"fileType\":0,\"expireTime\":\"2021-10-10T00:35:03Z\",\"validationStatus\":\"eilpjzuaejxdu\"},\"logsUrl\":{\"url\":\"kzbbtd\",\"fileId\":\"mv\",\"filename\":\"kgpwoz\",\"fileType\":0,\"expireTime\":\"2021-08-14T18:03:09Z\",\"validationStatus\":\"sjyofdx\"}}}") + .toObject(TestArtifacts.class); + Assertions.assertEquals("zhpvgqzcjrvxd", model.getOutputArtifacts().getResultUrl().getUrl()); + Assertions.assertEquals("lmwlxkvugfhzo", model.getOutputArtifacts().getResultUrl().getFileId()); + Assertions.assertEquals("wjvzunluthnn", model.getOutputArtifacts().getResultUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getResultUrl().getFileType()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-10-10T00:35:03Z"), + model.getOutputArtifacts().getResultUrl().getExpireTime()); + Assertions.assertEquals("eilpjzuaejxdu", model.getOutputArtifacts().getResultUrl().getValidationStatus()); + Assertions.assertEquals("kzbbtd", model.getOutputArtifacts().getLogsUrl().getUrl()); + Assertions.assertEquals("mv", model.getOutputArtifacts().getLogsUrl().getFileId()); + Assertions.assertEquals("kgpwoz", model.getOutputArtifacts().getLogsUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getLogsUrl().getFileType()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-08-14T18:03:09Z"), model.getOutputArtifacts().getLogsUrl().getExpireTime()); + Assertions.assertEquals("sjyofdx", model.getOutputArtifacts().getLogsUrl().getValidationStatus()); + } + + @Test + public void testSerialize() { + InputTestArtifacts inputTestArtifacts = new InputTestArtifacts() + .setTestScriptUrl(new FileUrl() + .setUrl("ahcvkozczsvxe")); + TestArtifacts model = + new TestArtifacts(inputTestArtifacts) + .setOutputArtifacts( + new OutputTestArtifacts() + .setResultUrl( + new FileUrl() + .setUrl("zhpvgqzcjrvxd") + .setFileId("lmwlxkvugfhzo") + .setFilename("wjvzunluthnn") + .setFileType(FileType.ZERO) + .setExpireTime(OffsetDateTime.parse("2021-10-10T00:35:03Z")) + .setValidationStatus("eilpjzuaejxdu")) + .setLogsUrl( + new FileUrl() + .setUrl("kzbbtd") + .setFileId("mv") + .setFilename("kgpwoz") + .setFileType(FileType.ZERO) + .setExpireTime(OffsetDateTime.parse("2021-08-14T18:03:09Z")) + .setValidationStatus("sjyofdx"))); + model = BinaryData.fromObject(model).toObject(TestArtifacts.class); + Assertions.assertEquals("zhpvgqzcjrvxd", model.getOutputArtifacts().getResultUrl().getUrl()); + Assertions.assertEquals("lmwlxkvugfhzo", model.getOutputArtifacts().getResultUrl().getFileId()); + Assertions.assertEquals("wjvzunluthnn", model.getOutputArtifacts().getResultUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getResultUrl().getFileType()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-10-10T00:35:03Z"), + model.getOutputArtifacts().getResultUrl().getExpireTime()); + Assertions.assertEquals("eilpjzuaejxdu", model.getOutputArtifacts().getResultUrl().getValidationStatus()); + Assertions.assertEquals("kzbbtd", model.getOutputArtifacts().getLogsUrl().getUrl()); + Assertions.assertEquals("mv", model.getOutputArtifacts().getLogsUrl().getFileId()); + Assertions.assertEquals("kgpwoz", model.getOutputArtifacts().getLogsUrl().getFilename()); + Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getLogsUrl().getFileType()); + Assertions.assertEquals( + OffsetDateTime.parse("2021-08-14T18:03:09Z"), model.getOutputArtifacts().getLogsUrl().getExpireTime()); + Assertions.assertEquals("sjyofdx", model.getOutputArtifacts().getLogsUrl().getValidationStatus()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java new file mode 100644 index 0000000000000..9c87867dd1c37 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; +import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; +import com.azure.developer.loadtesting.implementation.models.TestModel; +import com.azure.developer.loadtesting.implementation.models.TestModelResourceList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class TestModelResourceListTests { + @Test + public void testDeserialize() { + TestModelResourceList model = + BinaryData.fromString( + "{\"value\":[{\"testId\":\"jky\",\"description\":\"j\",\"displayName\":\"ujqgidok\",\"resourceId\":\"ljyoxgvcltb\",\"loadTestConfig\":{\"engineInstances\":142984166,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{}},\"createdDateTime\":\"2021-05-08T06:07:04Z\",\"createdBy\":\"hbijhtxfvgxb\",\"lastModifiedDateTime\":\"2021-01-10T16:47:02Z\",\"lastModifiedBy\":\"nehmpvecx\",\"inputArtifacts\":{\"additionalUrls\":[]},\"secrets\":{},\"environmentVariables\":{\"lzlfbxzpuz\":\"mpukgriw\",\"yydhibnuqqk\":\"cispnqzahmgkbr\",\"drgvtqagn\":\"ik\"},\"subnetId\":\"ynhijggme\",\"keyvaultReferenceIdentityType\":\"siarbutrcvpn\",\"keyvaultReferenceIdentityId\":\"zmhjrunmp\"},{\"testId\":\"tdbhrbnla\",\"description\":\"xmyskp\",\"displayName\":\"enbtkcxywny\",\"resourceId\":\"rsyn\",\"loadTestConfig\":{\"engineInstances\":1149857481,\"splitAllCSVs\":false},\"passFailCriteria\":{\"passFailMetrics\":{}},\"createdDateTime\":\"2021-05-31T03:16:56Z\",\"createdBy\":\"clha\",\"lastModifiedDateTime\":\"2021-03-19T01:34:05Z\",\"lastModifiedBy\":\"abphlw\",\"inputArtifacts\":{\"additionalUrls\":[]},\"secrets\":{},\"environmentVariables\":{\"twwrqp\":\"cocmnyyaztt\"},\"subnetId\":\"dckzywbiexz\",\"keyvaultReferenceIdentityType\":\"yueaxibxujwb\",\"keyvaultReferenceIdentityId\":\"walm\"}],\"nextLink\":\"yoxa\"}") + .toObject(TestModelResourceList.class); + Assertions.assertEquals("j", model.getValue().get(0).getDescription()); + Assertions.assertEquals("ujqgidok", model.getValue().get(0).getDisplayName()); + Assertions.assertEquals(142984166, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals("mpukgriw", model.getValue().get(0).getEnvironmentVariables().get("lzlfbxzpuz")); + Assertions.assertEquals("ynhijggme", model.getValue().get(0).getSubnetId()); + Assertions.assertEquals("siarbutrcvpn", model.getValue().get(0).getKeyvaultReferenceIdentityType()); + Assertions.assertEquals("zmhjrunmp", model.getValue().get(0).getKeyvaultReferenceIdentityId()); + Assertions.assertEquals("yoxa", model.getNextLink()); + } + + @Test + public void testSerialize() { + TestModelResourceList model = + new TestModelResourceList( + Arrays.asList( + new TestModel() + .setDescription("j") + .setDisplayName("ujqgidok") + .setLoadTestConfig( + new LoadTestConfig() + .setEngineInstances(142984166) + .setSplitAllCSVs(true)) + .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) + .setSecrets(mapOf()) + .setEnvironmentVariables( + mapOf( + "lzlfbxzpuz", + "mpukgriw", + "yydhibnuqqk", + "cispnqzahmgkbr", + "drgvtqagn", + "ik")) + .setSubnetId("ynhijggme") + .setKeyvaultReferenceIdentityType("siarbutrcvpn") + .setKeyvaultReferenceIdentityId("zmhjrunmp"), + new TestModel() + .setDescription("xmyskp") + .setDisplayName("enbtkcxywny") + .setLoadTestConfig( + new LoadTestConfig() + .setEngineInstances(1149857481) + .setSplitAllCSVs(false)) + .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) + .setSecrets(mapOf()) + .setEnvironmentVariables(mapOf("twwrqp", "cocmnyyaztt")) + .setSubnetId("dckzywbiexz") + .setKeyvaultReferenceIdentityType("yueaxibxujwb") + .setKeyvaultReferenceIdentityId("walm"))) + .setNextLink("yoxa"); + model = BinaryData.fromObject(model).toObject(TestModelResourceList.class); + Assertions.assertEquals("j", model.getValue().get(0).getDescription()); + Assertions.assertEquals("ujqgidok", model.getValue().get(0).getDisplayName()); + Assertions.assertEquals(142984166, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals("mpukgriw", model.getValue().get(0).getEnvironmentVariables().get("lzlfbxzpuz")); + Assertions.assertEquals("ynhijggme", model.getValue().get(0).getSubnetId()); + Assertions.assertEquals("siarbutrcvpn", model.getValue().get(0).getKeyvaultReferenceIdentityType()); + Assertions.assertEquals("zmhjrunmp", model.getValue().get(0).getKeyvaultReferenceIdentityId()); + Assertions.assertEquals("yoxa", model.getNextLink()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java new file mode 100644 index 0000000000000..9d493e68d79bb --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; +import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; +import com.azure.developer.loadtesting.implementation.models.PassFailMetric; +import com.azure.developer.loadtesting.implementation.models.SecretMetadata; +import com.azure.developer.loadtesting.implementation.models.TestModel; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class TestModelTests { + @Test + public void testDeserialize() { + TestModel model = + BinaryData.fromString( + "{\"testId\":\"rjb\",\"description\":\"orcjxvsnby\",\"displayName\":\"abnmocpcyshu\",\"resourceId\":\"afbljjgpbtoqcjmk\",\"loadTestConfig\":{\"engineInstances\":1217713745,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"a\":{\"clientmetric\":\"ajzyul\",\"aggregate\":\"u\",\"condition\":\"krlkhbzhfepg\",\"requestName\":\"qex\",\"value\":89.07795853703163,\"action\":\"scpai\",\"actualValue\":96.80537182363567,\"result\":\"csglum\"},\"jctbza\":{\"clientmetric\":\"j\",\"aggregate\":\"dxob\",\"condition\":\"dxkqpx\",\"requestName\":\"ajionpimexgstxg\",\"value\":84.68225914560935,\"action\":\"maajrmvdjwzrlo\",\"actualValue\":82.8178687573143,\"result\":\"hijco\"},\"twnpzaoqvuhrhcf\":{\"clientmetric\":\"qsycbkbfkgu\",\"aggregate\":\"kexxppof\",\"condition\":\"axcfjpgddtocjjx\",\"requestName\":\"pmouexhdz\",\"value\":17.190158222585094,\"action\":\"ojnxqbzvdd\",\"actualValue\":65.08808611819813,\"result\":\"eic\"},\"u\":{\"clientmetric\":\"yd\",\"aggregate\":\"lmjthjq\",\"condition\":\"pyeicxm\",\"requestName\":\"iwqvhkh\",\"value\":80.65130941539171,\"action\":\"dtopbob\",\"actualValue\":47.51092361661414,\"result\":\"e\"}}},\"createdDateTime\":\"2021-01-02T08:53:50Z\",\"createdBy\":\"hrzayvvtpgvdf\",\"lastModifiedDateTime\":\"2021-06-28T04:08:22Z\",\"lastModifiedBy\":\"kftutqxlngxlefg\",\"inputArtifacts\":{\"configUrl\":{\"url\":\"krxd\",\"fileId\":\"i\",\"filename\":\"thz\",\"fileType\":1,\"expireTime\":\"2021-06-26T08:11:35Z\",\"validationStatus\":\"bhj\"},\"testScriptUrl\":{\"url\":\"gehoqfbowskany\",\"fileId\":\"zlcuiywgqywgndrv\",\"filename\":\"hzgpphrcgyncocpe\",\"fileType\":2,\"expireTime\":\"2021-01-02T02:31:32Z\",\"validationStatus\":\"oo\"},\"userPropUrl\":{\"url\":\"lzevgbmqjqab\",\"fileId\":\"pmivkwlzu\",\"filename\":\"c\",\"fileType\":0,\"expireTime\":\"2021-12-03T01:38:31Z\",\"validationStatus\":\"acfi\"},\"inputArtifactsZipFileurl\":{\"url\":\"ebxetqgtzxdp\",\"fileId\":\"bqqwxrj\",\"filename\":\"al\",\"fileType\":1,\"expireTime\":\"2021-10-10T11:55:48Z\",\"validationStatus\":\"isnjampmngnz\"},\"additionalUrls\":[{\"url\":\"qwoochcbon\",\"fileId\":\"pkvlrxn\",\"filename\":\"ase\",\"fileType\":1,\"expireTime\":\"2021-04-09T12:47:30Z\",\"validationStatus\":\"lokeyy\"},{\"url\":\"nj\",\"fileId\":\"lwtgrhpdj\",\"filename\":\"umasxazjpq\",\"fileType\":0,\"expireTime\":\"2021-07-21T23:14:20Z\",\"validationStatus\":\"hb\"},{\"url\":\"hejjz\",\"fileId\":\"dudgwdslfhot\",\"filename\":\"cynpwlbjnp\",\"fileType\":1,\"expireTime\":\"2021-04-17T12:51:37Z\",\"validationStatus\":\"dehxnltyfsoppu\"},{\"url\":\"esnzwde\",\"fileId\":\"avo\",\"filename\":\"zdmohctbqvu\",\"fileType\":0,\"expireTime\":\"2021-10-27T15:38:07Z\",\"validationStatus\":\"nvowgujju\"}]},\"secrets\":{\"e\":{\"value\":\"cglhslazjdyggdt\",\"type\":\"xhbkuofq\"},\"tynnaamdectehfi\":{\"value\":\"hmenevfyexfwhybc\",\"type\":\"vyvdcs\"}},\"environmentVariables\":{\"hezrkgq\":\"jeyp\"},\"subnetId\":\"jrefovgmkqsle\",\"keyvaultReferenceIdentityType\":\"vxyqjpkcattpngjc\",\"keyvaultReferenceIdentityId\":\"czsqpjhvm\"}") + .toObject(TestModel.class); + Assertions.assertEquals("orcjxvsnby", model.getDescription()); + Assertions.assertEquals("abnmocpcyshu", model.getDisplayName()); + Assertions.assertEquals(1217713745, model.getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals("ajzyul", model.getPassFailCriteria().getPassFailMetrics().get("a").getClientmetric()); + Assertions.assertEquals("u", model.getPassFailCriteria().getPassFailMetrics().get("a").getAggregate()); + Assertions.assertEquals( + "krlkhbzhfepg", model.getPassFailCriteria().getPassFailMetrics().get("a").getCondition()); + Assertions.assertEquals("qex", model.getPassFailCriteria().getPassFailMetrics().get("a").getRequestName()); + Assertions.assertEquals( + 89.07795853703163D, model.getPassFailCriteria().getPassFailMetrics().get("a").getValue()); + Assertions.assertEquals("scpai", model.getPassFailCriteria().getPassFailMetrics().get("a").getAction()); + Assertions.assertEquals("cglhslazjdyggdt", model.getSecrets().get("e").getValue()); + Assertions.assertEquals("xhbkuofq", model.getSecrets().get("e").getType()); + Assertions.assertEquals("jeyp", model.getEnvironmentVariables().get("hezrkgq")); + Assertions.assertEquals("jrefovgmkqsle", model.getSubnetId()); + Assertions.assertEquals("vxyqjpkcattpngjc", model.getKeyvaultReferenceIdentityType()); + Assertions.assertEquals("czsqpjhvm", model.getKeyvaultReferenceIdentityId()); + } + + @Test + public void testSerialize() { + TestModel model = + new TestModel() + .setDescription("orcjxvsnby") + .setDisplayName("abnmocpcyshu") + .setLoadTestConfig(new LoadTestConfig().setEngineInstances(1217713745).setSplitAllCSVs(true)) + .setPassFailCriteria( + new PassFailCriteria() + .setPassFailMetrics( + mapOf( + "a", + new PassFailMetric() + .setClientmetric("ajzyul") + .setAggregate("u") + .setCondition("krlkhbzhfepg") + .setRequestName("qex") + .setValue(89.07795853703163D) + .setAction("scpai"), + "jctbza", + new PassFailMetric() + .setClientmetric("j") + .setAggregate("dxob") + .setCondition("dxkqpx") + .setRequestName("ajionpimexgstxg") + .setValue(84.68225914560935D) + .setAction("maajrmvdjwzrlo"), + "twnpzaoqvuhrhcf", + new PassFailMetric() + .setClientmetric("qsycbkbfkgu") + .setAggregate("kexxppof") + .setCondition("axcfjpgddtocjjx") + .setRequestName("pmouexhdz") + .setValue(17.190158222585094D) + .setAction("ojnxqbzvdd"), + "u", + new PassFailMetric() + .setClientmetric("yd") + .setAggregate("lmjthjq") + .setCondition("pyeicxm") + .setRequestName("iwqvhkh") + .setValue(80.65130941539171D) + .setAction("dtopbob")))) + .setSecrets( + mapOf( + "e", + new SecretMetadata().setValue("cglhslazjdyggdt").setType("xhbkuofq"), + "tynnaamdectehfi", + new SecretMetadata().setValue("hmenevfyexfwhybc").setType("vyvdcs"))) + .setEnvironmentVariables(mapOf("hezrkgq", "jeyp")) + .setSubnetId("jrefovgmkqsle") + .setKeyvaultReferenceIdentityType("vxyqjpkcattpngjc") + .setKeyvaultReferenceIdentityId("czsqpjhvm"); + model = BinaryData.fromObject(model).toObject(TestModel.class); + Assertions.assertEquals("orcjxvsnby", model.getDescription()); + Assertions.assertEquals("abnmocpcyshu", model.getDisplayName()); + Assertions.assertEquals(1217713745, model.getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals("ajzyul", model.getPassFailCriteria().getPassFailMetrics().get("a").getClientmetric()); + Assertions.assertEquals("u", model.getPassFailCriteria().getPassFailMetrics().get("a").getAggregate()); + Assertions.assertEquals( + "krlkhbzhfepg", model.getPassFailCriteria().getPassFailMetrics().get("a").getCondition()); + Assertions.assertEquals("qex", model.getPassFailCriteria().getPassFailMetrics().get("a").getRequestName()); + Assertions.assertEquals( + 89.07795853703163D, model.getPassFailCriteria().getPassFailMetrics().get("a").getValue()); + Assertions.assertEquals("scpai", model.getPassFailCriteria().getPassFailMetrics().get("a").getAction()); + Assertions.assertEquals("cglhslazjdyggdt", model.getSecrets().get("e").getValue()); + Assertions.assertEquals("xhbkuofq", model.getSecrets().get("e").getType()); + Assertions.assertEquals("jeyp", model.getEnvironmentVariables().get("hezrkgq")); + Assertions.assertEquals("jrefovgmkqsle", model.getSubnetId()); + Assertions.assertEquals("vxyqjpkcattpngjc", model.getKeyvaultReferenceIdentityType()); + Assertions.assertEquals("czsqpjhvm", model.getKeyvaultReferenceIdentityId()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java new file mode 100644 index 0000000000000..8d3495662a00f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; +import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; +import com.azure.developer.loadtesting.implementation.models.TestRunModel; +import com.azure.developer.loadtesting.implementation.models.TestRunModelResourceList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class TestRunModelResourceListTests { + @Test + public void testDeserialize() { + TestRunModelResourceList model = + BinaryData.fromString( + "{\"value\":[{\"testRunId\":\"t\",\"displayName\":\"ellwptfdy\",\"testId\":\"fqbuaceopzf\",\"resourceId\":\"hhuao\",\"description\":\"pcqeqx\",\"status\":\"z\",\"startDateTime\":\"2021-01-30T20:29:46Z\",\"endDateTime\":\"2021-04-25T14:15:21Z\",\"loadTestConfig\":{\"engineInstances\":792773086,\"splitAllCSVs\":true},\"testResult\":\"kdmoi\",\"passFailCriteria\":{\"passFailMetrics\":{}},\"testArtifacts\":{\"inputArtifacts\":{}},\"executedDateTime\":\"2021-02-03T18:27:02Z\",\"vusers\":919813735,\"testRunStatistics\":{},\"createdDateTime\":\"2021-06-18T12:29:32Z\",\"createdBy\":\"mfqjhhkxbp\",\"lastModifiedDateTime\":\"2021-06-05T07:23:31Z\",\"lastModifiedBy\":\"jhxxjyn\",\"portalUrl\":\"divkrt\",\"secrets\":{},\"environmentVariables\":{\"auvjfdxxivet\":\"zvszj\",\"qaqtdoqmcbxvwvxy\":\"t\"},\"duration\":196734015305662676,\"subnetId\":\"sfxobl\"},{\"testRunId\":\"k\",\"displayName\":\"mpew\",\"testId\":\"fbkrvrnsvs\",\"resourceId\":\"johxcrsb\",\"description\":\"vasrruvwb\",\"status\":\"qfsubcgjbirx\",\"startDateTime\":\"2021-09-14T01:07:05Z\",\"endDateTime\":\"2021-06-28T04:15:27Z\",\"loadTestConfig\":{\"engineInstances\":716024879,\"splitAllCSVs\":true},\"testResult\":\"twss\",\"passFailCriteria\":{\"passFailMetrics\":{}},\"executedDateTime\":\"2021-01-31T07:10:37Z\",\"vusers\":1235013026,\"testRunStatistics\":{},\"createdDateTime\":\"2021-06-04T04:06:28Z\",\"createdBy\":\"znfqqnvwpmqtar\",\"lastModifiedDateTime\":\"2021-08-18T10:48:38Z\",\"lastModifiedBy\":\"mkcjhwqytjrybn\",\"portalUrl\":\"ewgdrjervn\",\"secrets\":{},\"environmentVariables\":{\"ndoygmifthnzdnd\":\"eh\",\"nayqi\":\"l\",\"hqlkthumaqo\":\"ynduha\"},\"duration\":5649591766559477880,\"subnetId\":\"duiertgcc\"}],\"nextLink\":\"vaolpsslqlf\"}") + .toObject(TestRunModelResourceList.class); + Assertions.assertEquals("ellwptfdy", model.getValue().get(0).getDisplayName()); + Assertions.assertEquals("fqbuaceopzf", model.getValue().get(0).getTestId()); + Assertions.assertEquals("pcqeqx", model.getValue().get(0).getDescription()); + Assertions.assertEquals(792773086, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals("zvszj", model.getValue().get(0).getEnvironmentVariables().get("auvjfdxxivet")); + Assertions.assertEquals("vaolpsslqlf", model.getNextLink()); + } + + @Test + public void testSerialize() { + TestRunModelResourceList model = + new TestRunModelResourceList( + Arrays.asList( + new TestRunModel() + .setDisplayName("ellwptfdy") + .setTestId("fqbuaceopzf") + .setDescription("pcqeqx") + .setLoadTestConfig( + new LoadTestConfig() + .setEngineInstances(792773086) + .setSplitAllCSVs(true)) + .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) + .setSecrets(mapOf()) + .setEnvironmentVariables( + mapOf("auvjfdxxivet", "zvszj", "qaqtdoqmcbxvwvxy", "t")), + new TestRunModel() + .setDisplayName("mpew") + .setTestId("fbkrvrnsvs") + .setDescription("vasrruvwb") + .setLoadTestConfig( + new LoadTestConfig() + .setEngineInstances(716024879) + .setSplitAllCSVs(true)) + .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) + .setSecrets(mapOf()) + .setEnvironmentVariables( + mapOf( + "ndoygmifthnzdnd", + "eh", + "nayqi", + "l", + "hqlkthumaqo", + "ynduha")))) + .setNextLink("vaolpsslqlf"); + model = BinaryData.fromObject(model).toObject(TestRunModelResourceList.class); + Assertions.assertEquals("ellwptfdy", model.getValue().get(0).getDisplayName()); + Assertions.assertEquals("fqbuaceopzf", model.getValue().get(0).getTestId()); + Assertions.assertEquals("pcqeqx", model.getValue().get(0).getDescription()); + Assertions.assertEquals(792773086, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals("zvszj", model.getValue().get(0).getEnvironmentVariables().get("auvjfdxxivet")); + Assertions.assertEquals("vaolpsslqlf", model.getNextLink()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java new file mode 100644 index 0000000000000..e859d5982eb27 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; +import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; +import com.azure.developer.loadtesting.implementation.models.PassFailMetric; +import com.azure.developer.loadtesting.implementation.models.SecretMetadata; +import com.azure.developer.loadtesting.implementation.models.TestRunModel; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class TestRunModelTests { + @Test + public void testDeserialize() { + TestRunModel model = + BinaryData.fromString( + "{\"testRunId\":\"vlopwiyighx\",\"displayName\":\"dwzbaiue\",\"testId\":\"a\",\"resourceId\":\"nyqupedeojnabck\",\"description\":\"mtxpsiebtfh\",\"status\":\"esap\",\"startDateTime\":\"2021-05-25T03:50:38Z\",\"endDateTime\":\"2021-03-26T13:00:09Z\",\"loadTestConfig\":{\"engineInstances\":1631031599,\"splitAllCSVs\":true},\"testResult\":\"tldwkyzxuutk\",\"passFailCriteria\":{\"passFailMetrics\":{\"rmclfplphoxu\":{\"clientmetric\":\"wsvlxotogtwrupqs\",\"aggregate\":\"nmic\",\"condition\":\"vce\",\"requestName\":\"eil\",\"value\":81.31352089914428,\"action\":\"yfjfcnjbkcn\",\"actualValue\":52.227107002027154,\"result\":\"tkphywpnvjtoqn\"},\"xv\":{\"clientmetric\":\"rpabg\",\"aggregate\":\"psbjta\",\"condition\":\"ugxywpmueef\",\"requestName\":\"wfqkquj\",\"value\":76.74346068047178,\"action\":\"onobglaocqx\",\"actualValue\":36.81238428159163,\"result\":\"yudxytlmoy\"}}},\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[]},\"outputArtifacts\":{}},\"executedDateTime\":\"2021-09-30T16:20:35Z\",\"vusers\":530279974,\"testRunStatistics\":{\"eyvjusrtslhspkde\":{\"transaction\":\"bh\",\"sampleCount\":24.63655374283943,\"errorCount\":35.474444145006714,\"errorPct\":84.46088624890977,\"meanResTime\":75.27719677489182,\"medianResTime\":86.14609996604706,\"maxResTime\":5.129382907574698,\"minResTime\":63.799086243272086,\"pct1ResTime\":79.1315828701544,\"pct2ResTime\":54.01100397264773,\"pct3ResTime\":3.1162134970906474,\"throughput\":35.262769789138474,\"receivedKBytesPerSec\":88.79184990376532,\"sentKBytesPerSec\":39.313377855702626}},\"createdDateTime\":\"2021-01-28T17:00:30Z\",\"createdBy\":\"fm\",\"lastModifiedDateTime\":\"2021-03-28T14:27:10Z\",\"lastModifiedBy\":\"vt\",\"portalUrl\":\"lmqkrhahvlj\",\"secrets\":{\"adm\":{\"value\":\"quhcdhmduala\",\"type\":\"qpv\"},\"fmisg\":{\"value\":\"rcrgvx\",\"type\":\"gomz\"}},\"environmentVariables\":{\"e\":\"b\",\"urqhaka\":\"dawkzbali\"},\"duration\":142732787655569529,\"subnetId\":\"sfwxosowzxc\"}") + .toObject(TestRunModel.class); + Assertions.assertEquals("dwzbaiue", model.getDisplayName()); + Assertions.assertEquals("a", model.getTestId()); + Assertions.assertEquals("mtxpsiebtfh", model.getDescription()); + Assertions.assertEquals(1631031599, model.getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals( + "wsvlxotogtwrupqs", + model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getClientmetric()); + Assertions.assertEquals( + "nmic", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAggregate()); + Assertions.assertEquals( + "vce", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getCondition()); + Assertions.assertEquals( + "eil", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getRequestName()); + Assertions.assertEquals( + 81.31352089914428D, model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getValue()); + Assertions.assertEquals( + "yfjfcnjbkcn", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAction()); + Assertions.assertEquals("quhcdhmduala", model.getSecrets().get("adm").getValue()); + Assertions.assertEquals("qpv", model.getSecrets().get("adm").getType()); + Assertions.assertEquals("b", model.getEnvironmentVariables().get("e")); + } + + @Test + public void testSerialize() { + TestRunModel model = + new TestRunModel() + .setDisplayName("dwzbaiue") + .setTestId("a") + .setDescription("mtxpsiebtfh") + .setLoadTestConfig(new LoadTestConfig().setEngineInstances(1631031599).setSplitAllCSVs(true)) + .setPassFailCriteria( + new PassFailCriteria() + .setPassFailMetrics( + mapOf( + "rmclfplphoxu", + new PassFailMetric() + .setClientmetric("wsvlxotogtwrupqs") + .setAggregate("nmic") + .setCondition("vce") + .setRequestName("eil") + .setValue(81.31352089914428D) + .setAction("yfjfcnjbkcn"), + "xv", + new PassFailMetric() + .setClientmetric("rpabg") + .setAggregate("psbjta") + .setCondition("ugxywpmueef") + .setRequestName("wfqkquj") + .setValue(76.74346068047178D) + .setAction("onobglaocqx")))) + .setSecrets( + mapOf( + "adm", + new SecretMetadata().setValue("quhcdhmduala").setType("qpv"), + "fmisg", + new SecretMetadata().setValue("rcrgvx").setType("gomz"))) + .setEnvironmentVariables(mapOf("e", "b", "urqhaka", "dawkzbali")); + model = BinaryData.fromObject(model).toObject(TestRunModel.class); + Assertions.assertEquals("dwzbaiue", model.getDisplayName()); + Assertions.assertEquals("a", model.getTestId()); + Assertions.assertEquals("mtxpsiebtfh", model.getDescription()); + Assertions.assertEquals(1631031599, model.getLoadTestConfig().getEngineInstances()); + Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); + Assertions.assertEquals( + "wsvlxotogtwrupqs", + model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getClientmetric()); + Assertions.assertEquals( + "nmic", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAggregate()); + Assertions.assertEquals( + "vce", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getCondition()); + Assertions.assertEquals( + "eil", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getRequestName()); + Assertions.assertEquals( + 81.31352089914428D, model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getValue()); + Assertions.assertEquals( + "yfjfcnjbkcn", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAction()); + Assertions.assertEquals("quhcdhmduala", model.getSecrets().get("adm").getValue()); + Assertions.assertEquals("qpv", model.getSecrets().get("adm").getType()); + Assertions.assertEquals("b", model.getEnvironmentVariables().get("e")); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java new file mode 100644 index 0000000000000..d2f8948177c12 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.TestRunStatisticsModel; +import org.junit.jupiter.api.Test; + +public final class TestRunStatisticsModelTests { + @Test + public void testDeserialize() { + TestRunStatisticsModel model = + BinaryData.fromString( + "{\"transaction\":\"hpigv\",\"sampleCount\":96.56638831709824,\"errorCount\":47.73901870768239,\"errorPct\":34.06246241376222,\"meanResTime\":64.27272756849982,\"medianResTime\":0.6725728926900598,\"maxResTime\":71.87981583778927,\"minResTime\":31.709384380932327,\"pct1ResTime\":17.348168143392495,\"pct2ResTime\":56.09490979241981,\"pct3ResTime\":15.560917310063903,\"throughput\":68.83488215598939,\"receivedKBytesPerSec\":51.04859450119774,\"sentKBytesPerSec\":66.88936945530081}") + .toObject(TestRunStatisticsModel.class); + } + + @Test + public void testSerialize() { + TestRunStatisticsModel model = new TestRunStatisticsModel(); + model = BinaryData.fromObject(model).toObject(TestRunStatisticsModel.class); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java new file mode 100644 index 0000000000000..e1e24aa1aa048 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.TimeRange; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class TimeRangeTests { + @Test + public void testDeserialize() { + TimeRange model = + BinaryData.fromString("{\"startTime\":\"2021-04-04T10:24:56Z\",\"endTime\":\"2020-12-21T19:48:14Z\"}") + .toObject(TimeRange.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T10:24:56Z"), model.getStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T19:48:14Z"), model.getEndTime()); + } + + @Test + public void testSerialize() { + TimeRange model = + new TimeRange() + .setStartTime(OffsetDateTime.parse("2021-04-04T10:24:56Z")) + .setEndTime(OffsetDateTime.parse("2020-12-21T19:48:14Z")); + model = BinaryData.fromObject(model).toObject(TimeRange.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T10:24:56Z"), model.getStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T19:48:14Z"), model.getEndTime()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java new file mode 100644 index 0000000000000..57fed852e618a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.models.TimeSeries; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class TimeSeriesTests { + @Test + public void testDeserialize() { + TimeSeries model = + BinaryData.fromString("{\"timestamp\":\"2021-07-29T10:41:12Z\",\"value\":3.5167160326068148}") + .toObject(TimeSeries.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T10:41:12Z"), model.getTimestamp()); + Assertions.assertEquals(3.5167160326068148D, model.getValue()); + } + + @Test + public void testSerialize() { + TimeSeries model = + new TimeSeries() + .setTimestamp(OffsetDateTime.parse("2021-07-29T10:41:12Z")) + .setValue(3.5167160326068148D); + model = BinaryData.fromObject(model).toObject(TimeSeries.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T10:41:12Z"), model.getTimestamp()); + Assertions.assertEquals(3.5167160326068148D, model.getValue()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java new file mode 100644 index 0000000000000..2ea3e03e93e38 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class UploadTestFileTests extends LoadTestClientTestBase { + @Test + @Disabled + public void testUploadTestFileTests() { + BinaryData file = BinaryData.fromString("\"multipart-form-data\""); + RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); + Response response = + testClient.uploadTestFileWithResponse( + "12345678-1234-1234-1234-123456789012", + "92345678-1234-1111-1234-123456789012", + file, + requestOptions); + Assertions.assertEquals(201, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md new file mode 100644 index 0000000000000..699413a5a42ac --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -0,0 +1,20 @@ +## Generate autorest code + +```yaml +require: https://github.com/Azure/azure-rest-api-specs/blob/9401446f22177696d920cf110893a0de7452ee9e/specification/loadtestservice/data-plane/readme.md +output-folder: ../ +java: true +regenerate-pom: false +title: LoadTestClient +security: AADToken +security-scopes: https://loadtest.azure-dev.com/.default +data-plane: true +generate-tests: true +generate-models: true +artifact-id: azure-developer-loadtesting +generate-samples: true +namespace: com.azure.developer.loadtesting +partial-update: true +service-versions: +- 2022-06-01-preview +``` diff --git a/sdk/loadtestservice/ci.yml b/sdk/loadtestservice/ci.yml index f7709c4f9d6ed..ec330d59b6ca6 100644 --- a/sdk/loadtestservice/ci.yml +++ b/sdk/loadtestservice/ci.yml @@ -38,3 +38,6 @@ extends: - name: azure-resourcemanager-loadtestservice groupId: com.azure.resourcemanager safeName: azureresourcemanagerloadtestservice + - name: azure-developer-loadtesting + groupId: com.azure + safeName: azuredeveloperloadtesting diff --git a/sdk/loadtestservice/pom.xml b/sdk/loadtestservice/pom.xml index 01ce9807f5359..a29aa2a98337f 100644 --- a/sdk/loadtestservice/pom.xml +++ b/sdk/loadtestservice/pom.xml @@ -10,6 +10,7 @@ 1.0.0 - azure-resourcemanager-loadtestservice + azure-developer-loadtesting + azure-resourcemanager-loadtestservice From 82f59a4dfe6fca28e2c85940ca3761f8e3ce908e Mon Sep 17 00:00:00 2001 From: Harshan B Date: Thu, 8 Sep 2022 10:13:28 +0530 Subject: [PATCH 02/18] Add examples in README.md, update versions in pom From 3e863df7d6f9714740672830b3f50c8b11395f8f Mon Sep 17 00:00:00 2001 From: Harshan B Date: Wed, 14 Sep 2022 15:06:44 +0530 Subject: [PATCH 03/18] DPG with pageable, and updated README/samples --- .../azure-developer-loadtesting/CHANGELOG.md | 2 +- .../azure-developer-loadtesting/README.md | 104 +++- .../azure-developer-loadtesting/pom.xml | 12 +- .../loadtesting/AppComponentAsyncClient.java | 4 +- .../loadtesting/AppComponentClient.java | 4 +- .../AppComponentClientBuilder.java | 22 +- ...on.java => LoadTestingServiceVersion.java} | 10 +- .../loadtesting/ServerMetricsAsyncClient.java | 4 +- .../loadtesting/ServerMetricsClient.java | 4 +- .../ServerMetricsClientBuilder.java | 22 +- .../loadtesting/TestAsyncClient.java | 23 +- .../developer/loadtesting/TestClient.java | 23 +- .../loadtesting/TestClientBuilder.java | 22 +- .../loadtesting/TestRunAsyncClient.java | 13 +- .../developer/loadtesting/TestRunClient.java | 13 +- .../loadtesting/TestRunClientBuilder.java | 22 +- .../implementation/AppComponentsImpl.java | 8 +- ...ntImpl.java => LoadTestingClientImpl.java} | 24 +- .../implementation/ServerMetricsImpl.java | 8 +- .../implementation/TestRunsImpl.java | 354 +++++++++++++- .../loadtesting/implementation/TestsImpl.java | 451 ++++++++++++++++-- ...estbodyContentMultipartFormDataSchema.java | 41 ++ .../implementation/models/TestArtifacts.java | 15 +- .../implementation/models/package-info.java | 4 +- .../implementation/package-info.java | 2 +- .../developer/loadtesting/package-info.java | 2 +- .../src/main/java/module-info.java | 4 + .../developer/loadtesting/ReadmeSamples.java | 73 ++- .../generated/CreateAndUpdateTestRun.java | 33 -- .../CreateOrUpdateAppComponents.java | 32 -- .../CreateOrUpdateServerMetricsConfig.java | 32 -- .../generated/CreateOrUpdateTest.java | 31 -- .../generated/DeleteAppComponent.java | 28 -- .../loadtesting/generated/DeleteLoadTest.java | 27 -- .../generated/DeleteServerMetrics.java | 28 -- .../loadtesting/generated/DeleteTestFile.java | 28 -- .../loadtesting/generated/DeleteTestRun.java | 27 -- .../generated/GetAllTestFiles.java | 28 -- .../generated/GetAppComponent.java | 28 -- .../generated/GetAppComponentByName.java | 29 -- .../loadtesting/generated/GetLoadTest.java | 28 -- .../generated/GetServerDefaultMetrics.java | 27 -- .../generated/GetServerMetrics.java | 28 -- .../generated/GetServerMetricsByName.java | 29 -- .../loadtesting/generated/GetTestFile.java | 29 -- .../loadtesting/generated/GetTestRun.java | 28 -- .../generated/GetTestRunClientMetrics.java | 32 -- .../GetTestRunClientMetricsFilters.java | 29 -- .../loadtesting/generated/GetTestRunFile.java | 29 -- .../generated/ListLoadTestSearch.java | 34 -- .../generated/ListSupportedResourceType.java | 27 -- .../generated/ListTestRunsSearch.java | 36 -- .../loadtesting/generated/StopTestRun.java | 28 -- .../loadtesting/generated/UploadTestFile.java | 33 -- .../generated/AppComponentTests.java | 39 -- .../generated/AppComponentsMapTests.java | 62 --- .../generated/ClientMetricsFiltersTests.java | 57 --- .../ClientMetricsRequestModelTests.java | 47 -- .../generated/ClientMetricsResultsTests.java | 78 --- .../CreateAndUpdateTestRunTests.java | 28 -- .../CreateOrUpdateAppComponentsTests.java | 27 -- ...reateOrUpdateServerMetricsConfigTests.java | 27 -- .../generated/CreateOrUpdateTestTests.java | 26 - ...aultServerMetricsConfigListModelTests.java | 100 ---- .../DefaultServerMetricsConfigModelTests.java | 45 -- .../generated/DeleteAppComponentTests.java | 23 - .../generated/DeleteLoadTestTests.java | 22 - .../generated/DeleteServerMetricsTests.java | 23 - .../generated/DeleteTestFileTests.java | 23 - .../generated/DeleteTestRunTests.java | 22 - .../generated/ErrorResponseBodyTests.java | 53 -- .../loadtesting/generated/ErrorTests.java | 60 --- .../generated/FileUrlListTests.java | 68 --- .../loadtesting/generated/FileUrlTests.java | 47 -- .../loadtesting/generated/FiltersTests.java | 34 -- .../generated/GetAllTestFilesTests.java | 28 -- .../generated/GetAppComponentByNameTests.java | 29 -- .../generated/GetAppComponentTests.java | 28 -- .../generated/GetLoadTestTests.java | 28 -- .../GetServerDefaultMetricsTests.java | 27 -- .../GetServerMetricsByNameTests.java | 29 -- .../generated/GetServerMetricsTests.java | 28 -- .../generated/GetTestFileTests.java | 29 -- .../GetTestRunClientMetricsFiltersTests.java | 29 -- .../GetTestRunClientMetricsTests.java | 32 -- .../generated/GetTestRunFileTests.java | 29 -- .../generated/GetTestRunTests.java | 28 -- .../generated/InputTestArtifactsTests.java | 112 ----- .../generated/ListLoadTestSearchTests.java | 34 -- .../ListSupportedResourceTypeTests.java | 27 -- .../generated/ListTestRunsSearchTests.java | 36 -- .../generated/LoadTestClientTestBase.java | 109 ----- .../generated/LoadTestConfigTests.java | 29 -- .../generated/LocalizedNameTests.java | 29 -- .../generated/OutputTestArtifactsTests.java | 70 --- .../generated/PassFailCriteriaTests.java | 87 ---- .../generated/PassFailMetricTests.java | 45 -- .../generated/ResourceMetricModelTests.java | 51 -- .../generated/SecretMetadataTests.java | 29 -- .../loadtesting/generated/SeriesTests.java | 150 ------ .../generated/ServerMetricNameTests.java | 29 -- .../generated/ServerMetricsModelTests.java | 102 ---- .../generated/StopTestRunTests.java | 28 -- .../generated/SupportedResourceTypeTests.java | 27 -- .../generated/TestArtifactsTests.java | 83 ---- .../generated/TestModelResourceListTests.java | 97 ---- .../loadtesting/generated/TestModelTests.java | 129 ----- .../TestRunModelResourceListTests.java | 90 ---- .../generated/TestRunModelTests.java | 117 ----- .../TestRunStatisticsModelTests.java | 25 - .../loadtesting/generated/TimeRangeTests.java | 33 -- .../generated/TimeSeriesTests.java | 33 -- .../generated/UploadTestFileTests.java | 28 -- .../swagger/README.md | 10 +- 114 files changed, 1100 insertions(+), 3852 deletions(-) rename sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/{LoadTestServiceVersion.java => LoadTestingServiceVersion.java} (70%) rename sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/{LoadTestClientImpl.java => LoadTestingClientImpl.java} (85%) create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java diff --git a/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md index 49c7e3b3a0043..fdec08a525331 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.0.0-beta.1 (Unreleased) -- Azure LoadTestClient client library for Java. This package contains Microsoft Azure LoadTestClient client library. +- Azure LoadTestingClient client library for Java. This package contains Microsoft Azure LoadTestingClient client library. ### Features Added diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index b240c0007e00f..d9238a83b093d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -8,8 +8,9 @@ This package contains Microsoft Azure Developer LoadTesting client library. Various documentation is available to help you get started -- [API reference documentation][docs] -- [Product documentation][product_documentation] +- [Source code][source_code] +- [API reference documentation][api_reference_doc] +- [Product Documentation][product_documentation] ## Getting started @@ -64,14 +65,102 @@ An important distinction is that Azure Management libraries use `authenticate` m ## Key concepts +The following components make up the Azure Load Testing Service. The Azure Load Test client library for Python allows you to interact with each of these components through the use of a dedicated client object. + +### Load testing resource + +The Load testing resource is the top-level resource for your load-testing activities. This resource provides a centralized place to view and manage load tests, test results, and related artifacts. A load testing resource contains zero or more load tests. + +### Test + +A test specifies the test script, and configuration settings for running a load test. You can create one or more tests in an Azure Load Testing resource. + +### Test Engine + +A test engine is computing infrastructure that runs the Apache JMeter test script. You can scale out your load test by configuring the number of test engines. The test script runs in parallel across the specified number of test engines. + +### Test Run + +A test run represents one execution of a load test. It collects the logs associated with running the Apache JMeter script, the load test YAML configuration, the list of app components to monitor, and the results of the test. + +### App Component + +When you run a load test for an Azure-hosted application, you can monitor resource metrics for the different Azure application components (server-side metrics). While the load test runs, and after completion of the test, you can monitor and analyze the resource metrics in the Azure Load Testing dashboard. + +### Metrics + +During a load test, Azure Load Testing collects metrics about the test execution. There are two types of metrics: + +1. Client-side metrics give you details reported by the test engine. These metrics include the number of virtual users, the request response time, the number of failed requests, or the number of requests per second. + +2. Server-side metrics are available for Azure-hosted applications and provide information about your Azure application components. Metrics can be for the number of database reads, the type of HTTP responses, or container resource consumption. + ## Examples -```java com.azure.developer.loadtesting.readme +### Creating a Load Test + +```java java-readme-sample-createTest +TestClientBuilder testClientBuilder = new TestClientBuilder(); +TestClient testClient = testClientBuilder + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("") + .buildClient(); + +Map testMap = new HashMap(); +testMap.put("displayName", "Sample Display Name"); +testMap.put("description", "Sample Description"); + +Map loadTestConfigMap = new HashMap(); +loadTestConfigMap.put("engineInstances", 1); +testMap.put("loadTestConfig", loadTestConfigMap); + +Map envVarMap = new HashMap(); +envVarMap.put("a", "b"); +envVarMap.put("x", "y"); +testMap.put("environmentVariables", envVarMap); + +BinaryData test = BinaryData.fromObject(testMap); + +BinaryData testOut = testClient.createOrUpdateTestWithResponse("test12345", test, null).getValue(); +System.out.println(testOut.toString()); +``` + +### Uploading .jmx file to a Load Test + +```java java-readme-sample-uploadTestFile +TestClientBuilder testClientBuilder = new TestClientBuilder(); +TestClient testClient = testClientBuilder + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("") + .buildClient(); + +BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); +BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", fileData, null).getValue(); +System.out.println(fileUrlOut.toString()); ``` -## Troubleshooting +### Running a Load Test + +```java java-readme-sample-runTest +TestRunClientBuilder testRunClientBuilder = new TestRunClientBuilder(); +TestRunClient testRunClient = testRunClientBuilder + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("") + .buildClient(); -## Next steps +Map testRunMap = new HashMap(); +testRunMap.put("testId", "test12345"); +testRunMap.put("displayName", "SDK-Created-TestRun"); + +Map loadTestConfigMap = new HashMap(); +loadTestConfigMap.put("engineInstances", 2); +testRunMap.put("loadTestConfig", loadTestConfigMap); + +BinaryData testRun = BinaryData.fromObject(testRunMap); + +BinaryData testRunOut = testRunClient.createAndUpdateTestWithResponse("testrun12345", testRun, null).getValue(); +System.out.println(testRunOut.toString()); +``` ## Contributing @@ -84,8 +173,9 @@ For details on contributing to this repository, see the [contributing guide](htt 1. Create new Pull Request -[product_documentation]: https://azure.microsoft.com/services/ -[docs]: https://azure.github.io/azure-sdk-for-java/ +[source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src +[api_reference_doc]: https://docs.microsoft.com/rest/api/loadtesting/ +[product_documentation]: https://azure.microsoft.com/services/load-testing/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml index b61229c4ed183..a7c21e6dbfa22 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml +++ b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml @@ -12,8 +12,8 @@ 1.0.0-beta.1 jar - Microsoft Azure SDK for LoadTestClient Management - This package contains Microsoft Azure LoadTestClient client library. + Microsoft Azure SDK for LoadTestingClient Management + This package contains Microsoft Azure LoadTestingClient client library. https://github.com/Azure/azure-sdk-for-java @@ -44,12 +44,12 @@ com.azure azure-core - 1.31.0 + 1.32.0 com.azure azure-core-http-netty - 1.12.4 + 1.12.5 org.junit.jupiter @@ -66,13 +66,13 @@ com.azure azure-core-test - 1.11.0 + 1.12.0 test com.azure azure-identity - 1.5.4 + 1.5.5 test diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java index f01364466f81c..9ae35056c496e 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -17,10 +18,9 @@ import com.azure.developer.loadtesting.implementation.AppComponentsImpl; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous LoadTestClient type. */ +/** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = AppComponentClientBuilder.class, isAsync = true) public final class AppComponentAsyncClient { - @Generated private final AppComponentsImpl serviceClient; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java index 5947d73771f25..63f117ef057d3 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -15,10 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -/** Initializes a new instance of the synchronous LoadTestClient type. */ +/** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = AppComponentClientBuilder.class) public final class AppComponentClient { - @Generated private final AppComponentAsyncClient client; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java index 135d5c6e11db7..9651ec85956b5 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -33,7 +34,7 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,7 +47,6 @@ public final class AppComponentClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; @@ -179,7 +179,7 @@ public AppComponentClientBuilder endpoint(String endpoint) { /* * Service version */ - @Generated private LoadTestServiceVersion serviceVersion; + @Generated private LoadTestingServiceVersion serviceVersion; /** * Sets Service version. @@ -188,7 +188,7 @@ public AppComponentClientBuilder endpoint(String endpoint) { * @return the AppComponentClientBuilder. */ @Generated - public AppComponentClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + public AppComponentClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { this.serviceVersion = serviceVersion; return this; } @@ -211,17 +211,17 @@ public AppComponentClientBuilder retryPolicy(RetryPolicy retryPolicy) { } /** - * Builds an instance of LoadTestClientImpl with the provided parameters. + * Builds an instance of LoadTestingClientImpl with the provided parameters. * - * @return an instance of LoadTestClientImpl. + * @return an instance of LoadTestingClientImpl. */ @Generated - private LoadTestClientImpl buildInnerClient() { + private LoadTestingClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); - LoadTestClientImpl client = - new LoadTestClientImpl( + LoadTestingServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestingClientImpl client = + new LoadTestingClientImpl( localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); return client; } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestServiceVersion.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java similarity index 70% rename from sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestServiceVersion.java rename to sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java index 480d1bfb8374c..41a9dbc0eeb72 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestServiceVersion.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java @@ -6,14 +6,14 @@ import com.azure.core.util.ServiceVersion; -/** Service version of LoadTestClient. */ -public enum LoadTestServiceVersion implements ServiceVersion { +/** Service version of LoadTestingClient. */ +public enum LoadTestingServiceVersion implements ServiceVersion { /** Enum value 2022-06-01-preview. */ V2022_06_01_PREVIEW("2022-06-01-preview"); private final String version; - LoadTestServiceVersion(String version) { + LoadTestingServiceVersion(String version) { this.version = version; } @@ -26,9 +26,9 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. * - * @return The latest {@link LoadTestServiceVersion}. + * @return The latest {@link LoadTestingServiceVersion}. */ - public static LoadTestServiceVersion getLatest() { + public static LoadTestingServiceVersion getLatest() { return V2022_06_01_PREVIEW; } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java index d302d952ad53c..2fc37f5dee5bf 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -17,10 +18,9 @@ import com.azure.developer.loadtesting.implementation.ServerMetricsImpl; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous LoadTestClient type. */ +/** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = ServerMetricsClientBuilder.class, isAsync = true) public final class ServerMetricsAsyncClient { - @Generated private final ServerMetricsImpl serviceClient; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java index 3d5385b9aee77..96acb35ea14c5 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -15,10 +16,9 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -/** Initializes a new instance of the synchronous LoadTestClient type. */ +/** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = ServerMetricsClientBuilder.class) public final class ServerMetricsClient { - @Generated private final ServerMetricsAsyncClient client; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java index ee57eacff7e79..040a3504ca649 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -33,7 +34,7 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,7 +47,6 @@ public final class ServerMetricsClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; @@ -179,7 +179,7 @@ public ServerMetricsClientBuilder endpoint(String endpoint) { /* * Service version */ - @Generated private LoadTestServiceVersion serviceVersion; + @Generated private LoadTestingServiceVersion serviceVersion; /** * Sets Service version. @@ -188,7 +188,7 @@ public ServerMetricsClientBuilder endpoint(String endpoint) { * @return the ServerMetricsClientBuilder. */ @Generated - public ServerMetricsClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + public ServerMetricsClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { this.serviceVersion = serviceVersion; return this; } @@ -211,17 +211,17 @@ public ServerMetricsClientBuilder retryPolicy(RetryPolicy retryPolicy) { } /** - * Builds an instance of LoadTestClientImpl with the provided parameters. + * Builds an instance of LoadTestingClientImpl with the provided parameters. * - * @return an instance of LoadTestClientImpl. + * @return an instance of LoadTestingClientImpl. */ @Generated - private LoadTestClientImpl buildInnerClient() { + private LoadTestingClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); - LoadTestClientImpl client = - new LoadTestClientImpl( + LoadTestingServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestingClientImpl client = + new LoadTestingClientImpl( localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); return client; } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java index d38b63a5615f5..57c76c8e47cd4 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -11,16 +12,16 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.developer.loadtesting.implementation.TestsImpl; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous LoadTestClient type. */ +/** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = TestClientBuilder.class, isAsync = true) public final class TestAsyncClient { - @Generated private final TestsImpl serviceClient; /** @@ -360,13 +361,13 @@ public Mono> getLoadTestWithResponse(String testId, Request * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with - * {@link Response} on successful completion of {@link Mono}. + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listLoadTestSearchWithResponse(RequestOptions requestOptions) { - return this.serviceClient.listLoadTestSearchWithResponseAsync(requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLoadTestSearch(RequestOptions requestOptions) { + return this.serviceClient.listLoadTestSearchAsync(requestOptions); } /** @@ -507,11 +508,11 @@ public Mono> deleteTestFileWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files along with {@link Response} on successful completion of {@link Mono}. + * @return all test files as paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAllTestFilesWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getAllTestFilesWithResponseAsync(testId, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getAllTestFiles(String testId, RequestOptions requestOptions) { + return this.serviceClient.getAllTestFilesAsync(testId, requestOptions); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java index e4084be132198..1c22d4bdf0322 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -11,14 +12,14 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -/** Initializes a new instance of the synchronous LoadTestClient type. */ +/** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = TestClientBuilder.class) public final class TestClient { - @Generated private final TestAsyncClient client; /** @@ -358,13 +359,13 @@ public Response getLoadTestWithResponse(String testId, RequestOption * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with - * {@link Response}. + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listLoadTestSearchWithResponse(RequestOptions requestOptions) { - return this.client.listLoadTestSearchWithResponse(requestOptions).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLoadTestSearch(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listLoadTestSearch(requestOptions)); } /** @@ -503,11 +504,11 @@ public Response deleteTestFileWithResponse(String testId, String fileId, R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files along with {@link Response}. + * @return all test files as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAllTestFilesWithResponse(String testId, RequestOptions requestOptions) { - return this.client.getAllTestFilesWithResponse(testId, requestOptions).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getAllTestFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.getAllTestFiles(testId, requestOptions)); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java index fb46d28c075ea..e0490abd23d28 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -33,7 +34,7 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,7 +47,6 @@ public final class TestClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; @@ -179,7 +179,7 @@ public TestClientBuilder endpoint(String endpoint) { /* * Service version */ - @Generated private LoadTestServiceVersion serviceVersion; + @Generated private LoadTestingServiceVersion serviceVersion; /** * Sets Service version. @@ -188,7 +188,7 @@ public TestClientBuilder endpoint(String endpoint) { * @return the TestClientBuilder. */ @Generated - public TestClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + public TestClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { this.serviceVersion = serviceVersion; return this; } @@ -211,17 +211,17 @@ public TestClientBuilder retryPolicy(RetryPolicy retryPolicy) { } /** - * Builds an instance of LoadTestClientImpl with the provided parameters. + * Builds an instance of LoadTestingClientImpl with the provided parameters. * - * @return an instance of LoadTestClientImpl. + * @return an instance of LoadTestingClientImpl. */ @Generated - private LoadTestClientImpl buildInnerClient() { + private LoadTestingClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); - LoadTestClientImpl client = - new LoadTestClientImpl( + LoadTestingServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestingClientImpl client = + new LoadTestingClientImpl( localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); return client; } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java index cd54d159c20d4..aa5c4bde99ff4 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -11,16 +12,16 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.developer.loadtesting.implementation.TestRunsImpl; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous LoadTestClient type. */ +/** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = TestRunClientBuilder.class, isAsync = true) public final class TestRunAsyncClient { - @Generated private final TestRunsImpl serviceClient; /** @@ -527,12 +528,12 @@ public Mono> getTestRunFileWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters along with {@link Response} on successful completion of {@link Mono}. + * @return all test runs with given filters as paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listTestRunsSearchWithResponse(RequestOptions requestOptions) { - return this.serviceClient.listTestRunsSearchWithResponseAsync(requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRunsSearch(RequestOptions requestOptions) { + return this.serviceClient.listTestRunsSearchAsync(requestOptions); } /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java index 9f720891009df..c4e84ebed2efc 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -11,14 +12,14 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -/** Initializes a new instance of the synchronous LoadTestClient type. */ +/** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = TestRunClientBuilder.class) public final class TestRunClient { - @Generated private final TestRunAsyncClient client; /** @@ -525,12 +526,12 @@ public Response getTestRunFileWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters along with {@link Response}. + * @return all test runs with given filters as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listTestRunsSearchWithResponse(RequestOptions requestOptions) { - return this.client.listTestRunsSearchWithResponse(requestOptions).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestRunsSearch(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTestRunsSearch(requestOptions)); } /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java index 0ad1d247b647b..374962b3db98d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -33,7 +34,7 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestClientImpl; +import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,7 +47,6 @@ public final class TestRunClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; @@ -179,7 +179,7 @@ public TestRunClientBuilder endpoint(String endpoint) { /* * Service version */ - @Generated private LoadTestServiceVersion serviceVersion; + @Generated private LoadTestingServiceVersion serviceVersion; /** * Sets Service version. @@ -188,7 +188,7 @@ public TestRunClientBuilder endpoint(String endpoint) { * @return the TestRunClientBuilder. */ @Generated - public TestRunClientBuilder serviceVersion(LoadTestServiceVersion serviceVersion) { + public TestRunClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { this.serviceVersion = serviceVersion; return this; } @@ -211,17 +211,17 @@ public TestRunClientBuilder retryPolicy(RetryPolicy retryPolicy) { } /** - * Builds an instance of LoadTestClientImpl with the provided parameters. + * Builds an instance of LoadTestingClientImpl with the provided parameters. * - * @return an instance of LoadTestClientImpl. + * @return an instance of LoadTestingClientImpl. */ @Generated - private LoadTestClientImpl buildInnerClient() { + private LoadTestingClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : LoadTestServiceVersion.getLatest(); - LoadTestClientImpl client = - new LoadTestClientImpl( + LoadTestingServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestingClientImpl client = + new LoadTestingClientImpl( localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); return client; } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java index 36a21de83575d..edfc613e95a45 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java @@ -36,25 +36,25 @@ public final class AppComponentsImpl { private final AppComponentsService service; /** The service client containing this operation class. */ - private final LoadTestClientImpl client; + private final LoadTestingClientImpl client; /** * Initializes an instance of AppComponentsImpl. * * @param client the instance of the service client containing this operation class. */ - AppComponentsImpl(LoadTestClientImpl client) { + AppComponentsImpl(LoadTestingClientImpl client) { this.service = RestProxy.create(AppComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for LoadTestClientAppComponents to be used by the proxy service to + * The interface defining all the services for LoadTestingClientAppComponents to be used by the proxy service to * perform REST calls. */ @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestClientAppCom") + @ServiceInterface(name = "LoadTestingClientApp") private interface AppComponentsService { @Patch("/appcomponents/{name}") @ExpectedResponses({200, 201}) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestClientImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java similarity index 85% rename from sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestClientImpl.java rename to sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java index 5c11c8bb4ff65..5182cc1cbd8f3 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestClientImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java @@ -11,10 +11,10 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.developer.loadtesting.LoadTestServiceVersion; +import com.azure.developer.loadtesting.LoadTestingServiceVersion; -/** Initializes a new instance of the LoadTestClient type. */ -public final class LoadTestClientImpl { +/** Initializes a new instance of the LoadTestingClient type. */ +public final class LoadTestingClientImpl { /** URL to perform data plane API operations on the resource. */ private final String endpoint; @@ -28,14 +28,14 @@ public String getEndpoint() { } /** Service version. */ - private final LoadTestServiceVersion serviceVersion; + private final LoadTestingServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public LoadTestServiceVersion getServiceVersion() { + public LoadTestingServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -112,12 +112,12 @@ public TestRunsImpl getTestRuns() { } /** - * Initializes an instance of LoadTestClient client. + * Initializes an instance of LoadTestingClient client. * * @param endpoint URL to perform data plane API operations on the resource. * @param serviceVersion Service version. */ - public LoadTestClientImpl(String endpoint, LoadTestServiceVersion serviceVersion) { + public LoadTestingClientImpl(String endpoint, LoadTestingServiceVersion serviceVersion) { this( new HttpPipelineBuilder() .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) @@ -128,29 +128,29 @@ public LoadTestClientImpl(String endpoint, LoadTestServiceVersion serviceVersion } /** - * Initializes an instance of LoadTestClient client. + * Initializes an instance of LoadTestingClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint URL to perform data plane API operations on the resource. * @param serviceVersion Service version. */ - public LoadTestClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestServiceVersion serviceVersion) { + public LoadTestingClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestingServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** - * Initializes an instance of LoadTestClient client. + * Initializes an instance of LoadTestingClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint URL to perform data plane API operations on the resource. * @param serviceVersion Service version. */ - public LoadTestClientImpl( + public LoadTestingClientImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - LoadTestServiceVersion serviceVersion) { + LoadTestingServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java index 711a8fb0faaae..8c7e1c1fde984 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java @@ -36,25 +36,25 @@ public final class ServerMetricsImpl { private final ServerMetricsService service; /** The service client containing this operation class. */ - private final LoadTestClientImpl client; + private final LoadTestingClientImpl client; /** * Initializes an instance of ServerMetricsImpl. * * @param client the instance of the service client containing this operation class. */ - ServerMetricsImpl(LoadTestClientImpl client) { + ServerMetricsImpl(LoadTestingClientImpl client) { this.service = RestProxy.create(ServerMetricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for LoadTestClientServerMetrics to be used by the proxy service to + * The interface defining all the services for LoadTestingClientServerMetrics to be used by the proxy service to * perform REST calls. */ @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestClientServer") + @ServiceInterface(name = "LoadTestingClientSer") private interface ServerMetricsService { @Patch("/serverMetricsConfig/{name}") @ExpectedResponses({200, 201}) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java index 9389023756201..f0ea687d02189 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java @@ -23,12 +23,19 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in TestRuns. */ @@ -37,24 +44,24 @@ public final class TestRunsImpl { private final TestRunsService service; /** The service client containing this operation class. */ - private final LoadTestClientImpl client; + private final LoadTestingClientImpl client; /** * Initializes an instance of TestRunsImpl. * * @param client the instance of the service client containing this operation class. */ - TestRunsImpl(LoadTestClientImpl client) { + TestRunsImpl(LoadTestingClientImpl client) { this.service = RestProxy.create(TestRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for LoadTestClientTestRuns to be used by the proxy service to perform + * The interface defining all the services for LoadTestingClientTestRuns to be used by the proxy service to perform * REST calls. */ @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestClientTestRu") + @ServiceInterface(name = "LoadTestingClientTes") private interface TestRunsService { @Delete("/testruns/{testRunId}") @ExpectedResponses({204}) @@ -217,6 +224,25 @@ Mono> getTestRunClientMetricsFilters( @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTestRunsSearchNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); } /** @@ -1114,19 +1140,29 @@ public Response getTestRunFileWithResponse( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters along with {@link Response} on successful completion of {@link Mono}. + * @return all test runs with given filters along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listTestRunsSearchWithResponseAsync(RequestOptions requestOptions) { + public Mono> listTestRunsSearchSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( - context -> - service.listTestRunsSearch( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); + context -> + service.listTestRunsSearch( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); } /** @@ -1252,11 +1288,148 @@ public Mono> listTestRunsSearchWithResponseAsync(RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters along with {@link Response}. + * @return all test runs with given filters as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listTestRunsSearchWithResponse(RequestOptions requestOptions) { - return listTestRunsSearchWithResponseAsync(requestOptions).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRunsSearchAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listTestRunsSearchSinglePageAsync(requestOptions), + nextLink -> listTestRunsSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs with given filters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestRunsSearch(RequestOptions requestOptions) { + return new PagedIterable<>(listTestRunsSearchAsync(requestOptions)); } /** @@ -1718,4 +1891,151 @@ public Response getTestRunClientMetricsFiltersWithResponse( String testRunId, RequestOptions requestOptions) { return getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions).block(); } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestRunsSearchNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listTestRunsSearchNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java index 8c585824f17b2..d2ee5585c7389 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java @@ -23,12 +23,19 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in Tests. */ @@ -37,24 +44,24 @@ public final class TestsImpl { private final TestsService service; /** The service client containing this operation class. */ - private final LoadTestClientImpl client; + private final LoadTestingClientImpl client; /** * Initializes an instance of TestsImpl. * * @param client the instance of the service client containing this operation class. */ - TestsImpl(LoadTestClientImpl client) { + TestsImpl(LoadTestingClientImpl client) { this.service = RestProxy.create(TestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for LoadTestClientTests to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for LoadTestingClientTests to be used by the proxy service to perform + * REST calls. */ @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestClientTests") + @ServiceInterface(name = "LoadTestingClientTes") private interface TestsService { @Patch("/loadtests/{testId}") @ExpectedResponses({200, 201}) @@ -220,6 +227,44 @@ Mono> getAllTestFiles( @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listLoadTestSearchNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAllTestFilesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); } /** @@ -808,19 +853,28 @@ public Response getLoadTestWithResponse(String testId, RequestOption * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return all load tests by the fully qualified resource Id e.g * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with - * {@link Response} on successful completion of {@link Mono}. + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listLoadTestSearchWithResponseAsync(RequestOptions requestOptions) { + public Mono> listLoadTestSearchSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( - context -> - service.listLoadTestSearch( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); + context -> + service.listLoadTestSearch( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); } /** @@ -914,12 +968,118 @@ public Mono> listLoadTestSearchWithResponseAsync(RequestOpt * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with - * {@link Response}. + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listLoadTestSearchWithResponse(RequestOptions requestOptions) { - return listLoadTestSearchWithResponseAsync(requestOptions).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLoadTestSearchAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listLoadTestSearchSinglePageAsync(requestOptions), + nextLink -> listLoadTestSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLoadTestSearch(RequestOptions requestOptions) { + return new PagedIterable<>(listLoadTestSearchAsync(requestOptions)); } /** @@ -969,7 +1129,6 @@ public Response listLoadTestSearchWithResponse(RequestOptions reques public Mono> uploadTestFileWithResponseAsync( String testId, String fileId, BinaryData file, RequestOptions requestOptions) { final String accept = "application/json"; - // Replace file with a request body containing file and multipart boundary return FluxUtil.withContext( context -> service.uploadTestFile( @@ -1185,20 +1344,81 @@ public Response deleteTestFileWithResponse(String testId, String fileId, R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files along with {@link Response} on successful completion of {@link Mono}. + * @return all test files along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAllTestFilesWithResponseAsync(String testId, RequestOptions requestOptions) { + public Mono> getAllTestFilesSinglePageAsync( + String testId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( - context -> - service.getAllTestFiles( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - testId, - accept, - requestOptions, - context)); + context -> + service.getAllTestFiles( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getAllTestFilesAsync(String testId, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> getAllTestFilesSinglePageAsync(testId, requestOptions), + nextLink -> getAllTestFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** @@ -1238,10 +1458,175 @@ public Mono> getAllTestFilesWithResponseAsync(String testId * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files along with {@link Response}. + * @return all test files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getAllTestFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(getAllTestFilesAsync(testId, requestOptions)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAllTestFilesWithResponse(String testId, RequestOptions requestOptions) { - return getAllTestFilesWithResponseAsync(testId, requestOptions).block(); + public Mono> listLoadTestSearchNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listLoadTestSearchNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAllTestFilesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAllTestFilesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java new file mode 100644 index 0000000000000..bf4dacd406060 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; + +/** The Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema model. */ +@Fluent +public final class Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema { + /* + * The file to be uploaded. + */ + @JsonProperty(value = "file", required = true) + private Flux file; + + /** + * Creates an instance of Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema class. + * + * @param file the file value to set. + */ + @JsonCreator + public Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema( + @JsonProperty(value = "file", required = true) Flux file) { + this.file = file; + } + + /** + * Get the file property: The file to be uploaded. + * + * @return the file value. + */ + public Flux getFile() { + return this.file; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java index 1abc3b20383f5..e232f5e199a56 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java @@ -14,7 +14,7 @@ public final class TestArtifacts { /* * The input artifacts for the test. */ - @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.READ_WRITE) + @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.WRITE_ONLY) private InputTestArtifacts inputArtifacts; /* @@ -30,7 +30,7 @@ public final class TestArtifacts { */ @JsonCreator public TestArtifacts( - @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.READ_WRITE) + @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.WRITE_ONLY) InputTestArtifacts inputArtifacts) { this.inputArtifacts = inputArtifacts; } @@ -53,17 +53,6 @@ public OutputTestArtifacts getOutputArtifacts() { return this.outputArtifacts; } - /** - * Set the outputArtifacts property: The output artifacts for the test run. - * - * @param outputArtifacts the outputArtifacts value to set. - * @return the TestArtifacts object itself. - */ - public TestArtifacts setInputArtifacts(InputTestArtifacts inputArtifacts) { - this.inputArtifacts = inputArtifacts; - return this; - } - /** * Set the outputArtifacts property: The output artifacts for the test run. * diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java index ebc21eb2f320d..b62f7aa3946c1 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for LoadTestClient. These APIs allow end users to create, view and run load tests - * using Azure Load Test Service. + * Package containing the data models for LoadTestingClient. These APIs allow end users to create, view and run load + * tests using Azure Load Test Service. */ package com.azure.developer.loadtesting.implementation.models; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java index 8e1b31e6eedc1..3e90e2fad3f8c 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for LoadTestClient. These APIs allow end users to create, view and run load + * Package containing the implementations for LoadTestingClient. These APIs allow end users to create, view and run load * tests using Azure Load Test Service. */ package com.azure.developer.loadtesting.implementation; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java index 7cb0913984705..a56b00226ee54 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for LoadTestClient. These APIs allow end users to create, view and run load tests + * Package containing the classes for LoadTestingClient. These APIs allow end users to create, view and run load tests * using Azure Load Test Service. */ package com.azure.developer.loadtesting; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java index cf894ad61a922..960b20797e517 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java @@ -1,3 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + module com.azure.developer.loadtesting { requires transitive com.azure.core; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java index 75e13b453d91d..fb55a1d6ede24 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -4,9 +4,76 @@ package com.azure.developer.loadtesting; +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; + public final class ReadmeSamples { - public void readmeSamples() { - // BEGIN: com.azure.developer.loadtesting.readme - // END: com.azure.developer.loadtesting.readme + public void createTest() { + // BEGIN: java-readme-sample-createTest + TestClientBuilder testClientBuilder = new TestClientBuilder(); + TestClient testClient = testClientBuilder + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("") + .buildClient(); + + Map testMap = new HashMap(); + testMap.put("displayName", "Sample Display Name"); + testMap.put("description", "Sample Description"); + + Map loadTestConfigMap = new HashMap(); + loadTestConfigMap.put("engineInstances", 1); + testMap.put("loadTestConfig", loadTestConfigMap); + + Map envVarMap = new HashMap(); + envVarMap.put("a", "b"); + envVarMap.put("x", "y"); + testMap.put("environmentVariables", envVarMap); + + BinaryData test = BinaryData.fromObject(testMap); + + BinaryData testOut = testClient.createOrUpdateTestWithResponse("test12345", test, null).getValue(); + System.out.println(testOut.toString()); + // END: java-readme-sample-createTest + } + + public void uploadTestFile() { + // BEGIN: java-readme-sample-uploadTestFile + TestClientBuilder testClientBuilder = new TestClientBuilder(); + TestClient testClient = testClientBuilder + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("") + .buildClient(); + + BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); + BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", fileData, null).getValue(); + System.out.println(fileUrlOut.toString()); + // END: java-readme-sample-uploadTestFile + } + + public void runTest() { + // BEGIN: java-readme-sample-runTest + TestRunClientBuilder testRunClientBuilder = new TestRunClientBuilder(); + TestRunClient testRunClient = testRunClientBuilder + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("") + .buildClient(); + + Map testRunMap = new HashMap(); + testRunMap.put("testId", "test12345"); + testRunMap.put("displayName", "SDK-Created-TestRun"); + + Map loadTestConfigMap = new HashMap(); + loadTestConfigMap.put("engineInstances", 2); + testRunMap.put("loadTestConfig", loadTestConfigMap); + + BinaryData testRun = BinaryData.fromObject(testRunMap); + + BinaryData testRunOut = testRunClient.createAndUpdateTestWithResponse("testrun12345", testRun, null).getValue(); + System.out.println(testRunOut.toString()); + // END: java-readme-sample-runTest } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java deleted file mode 100644 index d2a9f0cb4ed83..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRun.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class CreateAndUpdateTestRun { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testruncreateandupdatetest.createandupdatetestrun - BinaryData body = - BinaryData.fromString( - "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest_Run1\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"testId\":\"12345678-1234-1234-1234-123456789012\"}"); - RequestOptions requestOptions = - new RequestOptions().addQueryParam("oldTestRunId", "12345678-1234-1234-1234-123456789012"); - Response response = - testRunClient.createAndUpdateTestWithResponse( - "12316678-1234-1234-1234-122451189012", body, requestOptions); - // END:com.azure.developer.loadtesting.generated.testruncreateandupdatetest.createandupdatetestrun - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java deleted file mode 100644 index 5fcd6b6df0df6..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponents.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.AppComponentClient; -import com.azure.developer.loadtesting.AppComponentClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class CreateOrUpdateAppComponents { - public static void main(String[] args) { - AppComponentClient appComponentClient = - new AppComponentClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.appcomponentcreateorupdateappcomponents.createorupdateappcomponents - BinaryData body = - BinaryData.fromString( - "{\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\"}}}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - appComponentClient.createOrUpdateAppComponentsWithResponse( - "ee843bd9-a6d4-4364-a45c-427a03c39fa7", body, requestOptions); - // END:com.azure.developer.loadtesting.generated.appcomponentcreateorupdateappcomponents.createorupdateappcomponents - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java deleted file mode 100644 index 91b96583f53b8..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfig.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.ServerMetricsClient; -import com.azure.developer.loadtesting.ServerMetricsClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class CreateOrUpdateServerMetricsConfig { - public static void main(String[] args) { - ServerMetricsClient serverMetricsClient = - new ServerMetricsClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.servermetricscreateorupdateservermetricsconfig.createorupdateservermetricsconfig - BinaryData body = - BinaryData.fromString( - "{\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - serverMetricsClient.createOrUpdateServerMetricsConfigWithResponse( - "edc6e529-d009-4b99-b763-ca492e3a2823", body, requestOptions); - // END:com.azure.developer.loadtesting.generated.servermetricscreateorupdateservermetricsconfig.createorupdateservermetricsconfig - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java deleted file mode 100644 index a0604bd611f43..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTest.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class CreateOrUpdateTest { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testcreateorupdatetest.createorupdatetest - BinaryData body = - BinaryData.fromString( - "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/sampleprovider/sampleresourcetype/sampleresourcename\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.createOrUpdateTestWithResponse("12345678-1234-1234-1234-123456789012", body, requestOptions); - // END:com.azure.developer.loadtesting.generated.testcreateorupdatetest.createorupdatetest - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java deleted file mode 100644 index 256cb1e887dfd..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAppComponent.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.AppComponentClient; -import com.azure.developer.loadtesting.AppComponentClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class DeleteAppComponent { - public static void main(String[] args) { - AppComponentClient appComponentClient = - new AppComponentClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.appcomponentdeleteappcomponent.deleteappcomponent - RequestOptions requestOptions = new RequestOptions(); - Response response = - appComponentClient.deleteAppComponentWithResponse( - "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); - // END:com.azure.developer.loadtesting.generated.appcomponentdeleteappcomponent.deleteappcomponent - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java deleted file mode 100644 index c63cfc3f45db2..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteLoadTest.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class DeleteLoadTest { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testdeleteloadtest.deleteloadtest - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.deleteLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testdeleteloadtest.deleteloadtest - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java deleted file mode 100644 index 13fd16b9d3575..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteServerMetrics.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.ServerMetricsClient; -import com.azure.developer.loadtesting.ServerMetricsClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class DeleteServerMetrics { - public static void main(String[] args) { - ServerMetricsClient serverMetricsClient = - new ServerMetricsClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.servermetricsdeleteservermetrics.deleteservermetrics - RequestOptions requestOptions = new RequestOptions(); - Response response = - serverMetricsClient.deleteServerMetricsWithResponse( - "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); - // END:com.azure.developer.loadtesting.generated.servermetricsdeleteservermetrics.deleteservermetrics - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java deleted file mode 100644 index 6261d5040b597..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestFile.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class DeleteTestFile { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testdeletetestfile.deletetestfile - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.deleteTestFileWithResponse( - "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testdeletetestfile.deletetestfile - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java deleted file mode 100644 index db284de2f58cb..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteTestRun.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class DeleteTestRun { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testrundeletetestrun.deletetestrun - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.deleteTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testrundeletetestrun.deletetestrun - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java deleted file mode 100644 index 9e227b3e82a49..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllTestFiles.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetAllTestFiles { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testgetalltestfiles.getalltestfiles - RequestOptions requestOptions = new RequestOptions().addQueryParam("continuationToken", "continuation token"); - Response response = - testClient.getAllTestFilesWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testgetalltestfiles.getalltestfiles - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java deleted file mode 100644 index f3eeedf58bd78..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponent.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.AppComponentClient; -import com.azure.developer.loadtesting.AppComponentClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetAppComponent { - public static void main(String[] args) { - AppComponentClient appComponentClient = - new AppComponentClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.appcomponentgetappcomponent.getappcomponent - RequestOptions requestOptions = - new RequestOptions().addQueryParam("testRunId", "12316678-1234-1234-1234-122451189012"); - Response response = appComponentClient.getAppComponentWithResponse(requestOptions); - // END:com.azure.developer.loadtesting.generated.appcomponentgetappcomponent.getappcomponent - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java deleted file mode 100644 index 7151d7a2c16ad..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAppComponentByName.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.AppComponentClient; -import com.azure.developer.loadtesting.AppComponentClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetAppComponentByName { - public static void main(String[] args) { - AppComponentClient appComponentClient = - new AppComponentClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.appcomponentgetappcomponentbyname.getappcomponentbyname - RequestOptions requestOptions = new RequestOptions(); - Response response = - appComponentClient.getAppComponentByNameWithResponse( - "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); - // END:com.azure.developer.loadtesting.generated.appcomponentgetappcomponentbyname.getappcomponentbyname - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java deleted file mode 100644 index 45f957f4f8eed..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetLoadTest.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetLoadTest { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testgetloadtest.getloadtest - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.getLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testgetloadtest.getloadtest - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java deleted file mode 100644 index ef80d1f1d2879..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetrics.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.ServerMetricsClient; -import com.azure.developer.loadtesting.ServerMetricsClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetServerDefaultMetrics { - public static void main(String[] args) { - ServerMetricsClient serverMetricsClient = - new ServerMetricsClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetserverdefaultmetrics.getserverdefaultmetrics - RequestOptions requestOptions = new RequestOptions(); - Response response = serverMetricsClient.getServerDefaultMetricsWithResponse(requestOptions); - // END:com.azure.developer.loadtesting.generated.servermetricsgetserverdefaultmetrics.getserverdefaultmetrics - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java deleted file mode 100644 index 09aaba337f575..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetrics.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.ServerMetricsClient; -import com.azure.developer.loadtesting.ServerMetricsClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetServerMetrics { - public static void main(String[] args) { - ServerMetricsClient serverMetricsClient = - new ServerMetricsClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetservermetrics.getservermetrics - RequestOptions requestOptions = - new RequestOptions().addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); - Response response = serverMetricsClient.getServerMetricsWithResponse(requestOptions); - // END:com.azure.developer.loadtesting.generated.servermetricsgetservermetrics.getservermetrics - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java deleted file mode 100644 index 04a250e98ef42..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByName.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.ServerMetricsClient; -import com.azure.developer.loadtesting.ServerMetricsClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetServerMetricsByName { - public static void main(String[] args) { - ServerMetricsClient serverMetricsClient = - new ServerMetricsClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetservermetricsbyname.getservermetricsbyname - RequestOptions requestOptions = new RequestOptions(); - Response response = - serverMetricsClient.getServerMetricsByNameWithResponse( - "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); - // END:com.azure.developer.loadtesting.generated.servermetricsgetservermetricsbyname.getservermetricsbyname - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java deleted file mode 100644 index dada186b5ffa3..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestFile.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetTestFile { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testgettestfile.gettestfile - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.getTestFileWithResponse( - "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testgettestfile.gettestfile - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java deleted file mode 100644 index 1fb64ce89bf9c..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRun.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetTestRun { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrun.gettestrun - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testrungettestrun.gettestrun - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java deleted file mode 100644 index 5a3ac940f43fa..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetrics.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetTestRunClientMetrics { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrunclientmetrics.gettestrunclientmetrics - BinaryData body = - BinaryData.fromString( - "{\"endTime\":\"2021-12-05T16:43:49.590Z\",\"errors\":[\"500\"],\"groupByInterval\":\"10s\",\"percentiles\":[\"95\"],\"requestSamplers\":[\"Homepage\"],\"startTime\":\"2021-12-05T16:43:49.590Z\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunClientMetricsWithResponse( - "12316678-1234-1234-1234-122451189012", body, requestOptions); - // END:com.azure.developer.loadtesting.generated.testrungettestrunclientmetrics.gettestrunclientmetrics - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java deleted file mode 100644 index 46513497e696a..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFilters.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetTestRunClientMetricsFilters { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrunclientmetricsfilters.gettestrunclientmetricsfilters - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunClientMetricsFiltersWithResponse( - "12316678-1234-1234-1234-122451189012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testrungettestrunclientmetricsfilters.gettestrunclientmetricsfilters - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java deleted file mode 100644 index b68c1c827462a..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetTestRunFile.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class GetTestRunFile { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testrungettestrunfile.gettestrunfile - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunFileWithResponse( - "12316678-1234-1234-1234-122451189012", "92345678-1234-1111-1234-123456789012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testrungettestrunfile.gettestrunfile - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java deleted file mode 100644 index f339249bed0a5..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListLoadTestSearch.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class ListLoadTestSearch { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testlistloadtestsearch.listloadtestsearch - RequestOptions requestOptions = - new RequestOptions() - .addQueryParam("continuationToken", "continuation token") - .addQueryParam("lastUpdatedEndTime", "2021-12-05T16:43:46.797Z") - .addQueryParam("lastUpdatedStartTime", "2021-12-05T16:43:46.797Z") - .addQueryParam("maxPageSize", "30") - .addQueryParam("orderBy", "executedDateTime") - .addQueryParam("search", "Performance_LoadTest"); - Response response = testClient.listLoadTestSearchWithResponse(requestOptions); - // END:com.azure.developer.loadtesting.generated.testlistloadtestsearch.listloadtestsearch - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java deleted file mode 100644 index 2804475d49297..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListSupportedResourceType.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.ServerMetricsClient; -import com.azure.developer.loadtesting.ServerMetricsClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class ListSupportedResourceType { - public static void main(String[] args) { - ServerMetricsClient serverMetricsClient = - new ServerMetricsClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.servermetricslistsupportedresourcetype.listsupportedresourcetype - RequestOptions requestOptions = new RequestOptions(); - Response response = serverMetricsClient.listSupportedResourceTypeWithResponse(requestOptions); - // END:com.azure.developer.loadtesting.generated.servermetricslistsupportedresourcetype.listsupportedresourcetype - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java deleted file mode 100644 index b444011132551..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListTestRunsSearch.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class ListTestRunsSearch { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testrunlisttestrunssearch.listtestrunssearch - RequestOptions requestOptions = - new RequestOptions() - .addQueryParam("continuationToken", "continuation token") - .addQueryParam("executionFrom", "2021-12-05T16:43:48.805Z") - .addQueryParam("executionTo", "2021-12-05T16:43:48.805Z") - .addQueryParam("maxPageSize", "30") - .addQueryParam("orderBy", "executedDateTime") - .addQueryParam("search", "Performance_LoadTest_Run1") - .addQueryParam("status", "DONE,EXECUTING") - .addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); - Response response = testRunClient.listTestRunsSearchWithResponse(requestOptions); - // END:com.azure.developer.loadtesting.generated.testrunlisttestrunssearch.listtestrunssearch - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java deleted file mode 100644 index e5562e170845b..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopTestRun.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class StopTestRun { - public static void main(String[] args) { - TestRunClient testRunClient = - new TestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testrunstoptestrun.stoptestrun - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.stopTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); - // END:com.azure.developer.loadtesting.generated.testrunstoptestrun.stoptestrun - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java deleted file mode 100644 index 979af920d0236..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadTestFile.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; - -public class UploadTestFile { - public static void main(String[] args) { - TestClient testClient = - new TestClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) - .buildClient(); - // BEGIN:com.azure.developer.loadtesting.generated.testuploadtestfile.uploadtestfile - BinaryData file = BinaryData.fromString("\"multipart-form-data\""); - RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); - Response response = - testClient.uploadTestFileWithResponse( - "12345678-1234-1234-1234-123456789012", - "92345678-1234-1111-1234-123456789012", - file, - requestOptions); - // END:com.azure.developer.loadtesting.generated.testuploadtestfile.uploadtestfile - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java deleted file mode 100644 index 349622ede3e9f..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.AppComponent; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AppComponentTests { - @Test - public void testDeserialize() { - AppComponent model = - BinaryData.fromString( - "{\"resourceId\":\"znrb\",\"resourceName\":\"cqqjnqglhqgn\",\"resourceType\":\"foooj\",\"displayName\":\"ifsqesaagdfmg\",\"resourceGroup\":\"lhjxr\",\"subscriptionId\":\"kwm\",\"kind\":\"ktsizntocipaou\"}") - .toObject(AppComponent.class); - Assertions.assertEquals("znrb", model.getResourceId()); - Assertions.assertEquals("cqqjnqglhqgn", model.getResourceName()); - Assertions.assertEquals("foooj", model.getResourceType()); - Assertions.assertEquals("ifsqesaagdfmg", model.getDisplayName()); - Assertions.assertEquals("ktsizntocipaou", model.getKind()); - } - - @Test - public void testSerialize() { - AppComponent model = - new AppComponent("znrb", "cqqjnqglhqgn", "foooj") - .setDisplayName("ifsqesaagdfmg") - .setKind("ktsizntocipaou"); - model = BinaryData.fromObject(model).toObject(AppComponent.class); - Assertions.assertEquals("znrb", model.getResourceId()); - Assertions.assertEquals("cqqjnqglhqgn", model.getResourceName()); - Assertions.assertEquals("foooj", model.getResourceType()); - Assertions.assertEquals("ifsqesaagdfmg", model.getDisplayName()); - Assertions.assertEquals("ktsizntocipaou", model.getKind()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java deleted file mode 100644 index ba80ea9270851..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/AppComponentsMapTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.AppComponent; -import com.azure.developer.loadtesting.implementation.models.AppComponentsMap; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AppComponentsMapTests { - @Test - public void testDeserialize() { - AppComponentsMap model = - BinaryData.fromString( - "{\"resourceId\":\"mhquvgjxp\",\"testId\":\"czmehmtzopbsp\",\"testRunId\":\"upi\",\"name\":\"sybbejhph\",\"value\":{\"fp\":{\"resourceId\":\"cmsxaobhdxbm\",\"resourceName\":\"qioqjzehtbmu\",\"resourceType\":\"p\",\"displayName\":\"noi\",\"resourceGroup\":\"wlrxyb\",\"subscriptionId\":\"oqijgkdmbpaz\",\"kind\":\"bc\"}}}") - .toObject(AppComponentsMap.class); - Assertions.assertEquals("czmehmtzopbsp", model.getTestId()); - Assertions.assertEquals("upi", model.getTestRunId()); - Assertions.assertEquals("cmsxaobhdxbm", model.getValue().get("fp").getResourceId()); - Assertions.assertEquals("qioqjzehtbmu", model.getValue().get("fp").getResourceName()); - Assertions.assertEquals("p", model.getValue().get("fp").getResourceType()); - Assertions.assertEquals("noi", model.getValue().get("fp").getDisplayName()); - Assertions.assertEquals("bc", model.getValue().get("fp").getKind()); - } - - @Test - public void testSerialize() { - AppComponentsMap model = - new AppComponentsMap( - mapOf( - "fp", - new AppComponent("cmsxaobhdxbm", "qioqjzehtbmu", "p") - .setDisplayName("noi") - .setKind("bc"))) - .setTestId("czmehmtzopbsp") - .setTestRunId("upi"); - model = BinaryData.fromObject(model).toObject(AppComponentsMap.class); - Assertions.assertEquals("czmehmtzopbsp", model.getTestId()); - Assertions.assertEquals("upi", model.getTestRunId()); - Assertions.assertEquals("cmsxaobhdxbm", model.getValue().get("fp").getResourceId()); - Assertions.assertEquals("qioqjzehtbmu", model.getValue().get("fp").getResourceName()); - Assertions.assertEquals("p", model.getValue().get("fp").getResourceType()); - Assertions.assertEquals("noi", model.getValue().get("fp").getDisplayName()); - Assertions.assertEquals("bc", model.getValue().get("fp").getKind()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java deleted file mode 100644 index 1175956831df2..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsFiltersTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.ClientMetricsFilters; -import com.azure.developer.loadtesting.implementation.models.Filters; -import com.azure.developer.loadtesting.implementation.models.TimeRange; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ClientMetricsFiltersTests { - @Test - public void testDeserialize() { - ClientMetricsFilters model = - BinaryData.fromString( - "{\"testRunId\":\"keqdcvdrhvoods\",\"filters\":{\"requestSamplerValues\":[\"bzdopcj\",\"vnhdldwmgxcxr\",\"lpmutwuoegrpkhj\",\"niyqslui\"],\"errorFiltersValues\":[\"ggkzzlvmbmpa\",\"modfvuefywsbpfvm\",\"yhrfouyftaakcpw\",\"yzvqt\"]},\"timeRange\":{\"startTime\":\"2021-09-22T09:26:58Z\",\"endTime\":\"2021-09-15T15:14:36Z\"}}") - .toObject(ClientMetricsFilters.class); - Assertions.assertEquals("keqdcvdrhvoods", model.getTestRunId()); - Assertions.assertEquals("bzdopcj", model.getFilters().getRequestSamplerValues().get(0)); - Assertions.assertEquals("ggkzzlvmbmpa", model.getFilters().getErrorFiltersValues().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T09:26:58Z"), model.getTimeRange().getStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T15:14:36Z"), model.getTimeRange().getEndTime()); - } - - @Test - public void testSerialize() { - ClientMetricsFilters model = - new ClientMetricsFilters() - .setTestRunId("keqdcvdrhvoods") - .setFilters( - new Filters() - .setRequestSamplerValues( - Arrays.asList( - "bzdopcj", "vnhdldwmgxcxr", "lpmutwuoegrpkhj", "niyqslui")) - .setErrorFiltersValues( - Arrays.asList( - "ggkzzlvmbmpa", - "modfvuefywsbpfvm", - "yhrfouyftaakcpw", - "yzvqt"))) - .setTimeRange( - new TimeRange() - .setStartTime(OffsetDateTime.parse("2021-09-22T09:26:58Z")) - .setEndTime(OffsetDateTime.parse("2021-09-15T15:14:36Z"))); - model = BinaryData.fromObject(model).toObject(ClientMetricsFilters.class); - Assertions.assertEquals("keqdcvdrhvoods", model.getTestRunId()); - Assertions.assertEquals("bzdopcj", model.getFilters().getRequestSamplerValues().get(0)); - Assertions.assertEquals("ggkzzlvmbmpa", model.getFilters().getErrorFiltersValues().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T09:26:58Z"), model.getTimeRange().getStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T15:14:36Z"), model.getTimeRange().getEndTime()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java deleted file mode 100644 index 5fc220c38ecbb..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsRequestModelTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.ClientMetricsRequestModel; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ClientMetricsRequestModelTests { - @Test - public void testDeserialize() { - ClientMetricsRequestModel model = - BinaryData.fromString( - "{\"requestSamplers\":[\"n\",\"bglzpswi\",\"d\"],\"errors\":[\"yhz\",\"xssadbzmnvdf\"],\"percentiles\":[\"daodvxzbncblyl\"],\"groupByInterval\":\"tdbhhxsrzdzu\",\"startTime\":\"2021-10-15T02:58:18Z\",\"endTime\":\"2021-03-02T12:53:08Z\"}") - .toObject(ClientMetricsRequestModel.class); - Assertions.assertEquals("n", model.getRequestSamplers().get(0)); - Assertions.assertEquals("yhz", model.getErrors().get(0)); - Assertions.assertEquals("daodvxzbncblyl", model.getPercentiles().get(0)); - Assertions.assertEquals("tdbhhxsrzdzu", model.getGroupByInterval()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T02:58:18Z"), model.getStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T12:53:08Z"), model.getEndTime()); - } - - @Test - public void testSerialize() { - ClientMetricsRequestModel model = - new ClientMetricsRequestModel( - OffsetDateTime.parse("2021-10-15T02:58:18Z"), - OffsetDateTime.parse("2021-03-02T12:53:08Z")) - .setRequestSamplers(Arrays.asList("n", "bglzpswi", "d")) - .setErrors(Arrays.asList("yhz", "xssadbzmnvdf")) - .setPercentiles(Arrays.asList("daodvxzbncblyl")) - .setGroupByInterval("tdbhhxsrzdzu"); - model = BinaryData.fromObject(model).toObject(ClientMetricsRequestModel.class); - Assertions.assertEquals("n", model.getRequestSamplers().get(0)); - Assertions.assertEquals("yhz", model.getErrors().get(0)); - Assertions.assertEquals("daodvxzbncblyl", model.getPercentiles().get(0)); - Assertions.assertEquals("tdbhhxsrzdzu", model.getGroupByInterval()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T02:58:18Z"), model.getStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T12:53:08Z"), model.getEndTime()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java deleted file mode 100644 index d2de54524602a..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ClientMetricsResultsTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.ClientMetricsResults; -import com.azure.developer.loadtesting.implementation.models.Series; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ClientMetricsResultsTests { - @Test - public void testDeserialize() { - ClientMetricsResults model = - BinaryData.fromString( - "{\"testRunId\":\"cdntnevfiwjmy\",\"timeSeries\":{\"activeUsers\":{\"lswtmweriofzpyqs\":[],\"wab\":[],\"tshhszhedp\":[],\"wiwubm\":[]},\"responseTime\":{\"sldnkwwtppjflcxo\":[],\"okonzmnsikvmkqz\":[],\"qkdltfz\":[],\"hhvh\":[]},\"throughput\":{\"odkwobd\":[]},\"errors\":{\"ibqdxbxwakbogqx\":[],\"lkzgxhuriplbp\":[],\"xunkbebxmubyynt\":[],\"rbqtkoie\":[]}}}") - .toObject(ClientMetricsResults.class); - Assertions.assertEquals("cdntnevfiwjmy", model.getTestRunId()); - } - - @Test - public void testSerialize() { - ClientMetricsResults model = - new ClientMetricsResults() - .setTestRunId("cdntnevfiwjmy") - .setTimeSeries( - new Series() - .setActiveUsers( - mapOf( - "lswtmweriofzpyqs", - Arrays.asList(), - "wab", - Arrays.asList(), - "tshhszhedp", - Arrays.asList(), - "wiwubm", - Arrays.asList())) - .setResponseTime( - mapOf( - "sldnkwwtppjflcxo", - Arrays.asList(), - "okonzmnsikvmkqz", - Arrays.asList(), - "qkdltfz", - Arrays.asList(), - "hhvh", - Arrays.asList())) - .setThroughput(mapOf("odkwobd", Arrays.asList())) - .setErrors( - mapOf( - "ibqdxbxwakbogqx", - Arrays.asList(), - "lkzgxhuriplbp", - Arrays.asList(), - "xunkbebxmubyynt", - Arrays.asList(), - "rbqtkoie", - Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(ClientMetricsResults.class); - Assertions.assertEquals("cdntnevfiwjmy", model.getTestRunId()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java deleted file mode 100644 index 9adde3608faab..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateAndUpdateTestRunTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class CreateAndUpdateTestRunTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testCreateAndUpdateTestRunTests() { - BinaryData body = - BinaryData.fromString( - "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest_Run1\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"testId\":\"12345678-1234-1234-1234-123456789012\"}"); - RequestOptions requestOptions = - new RequestOptions().addQueryParam("oldTestRunId", "12345678-1234-1234-1234-123456789012"); - Response response = - testRunClient.createAndUpdateTestWithResponse( - "12316678-1234-1234-1234-122451189012", body, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java deleted file mode 100644 index ab6f7ab823b54..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAppComponentsTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class CreateOrUpdateAppComponentsTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testCreateOrUpdateAppComponentsTests() { - BinaryData body = - BinaryData.fromString( - "{\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\"}}}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - appComponentClient.createOrUpdateAppComponentsWithResponse( - "ee843bd9-a6d4-4364-a45c-427a03c39fa7", body, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java deleted file mode 100644 index b02a2dfe1913f..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class CreateOrUpdateServerMetricsConfigTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testCreateOrUpdateServerMetricsConfigTests() { - BinaryData body = - BinaryData.fromString( - "{\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - serverMetricsClient.createOrUpdateServerMetricsConfigWithResponse( - "edc6e529-d009-4b99-b763-ca492e3a2823", body, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java deleted file mode 100644 index 13bf5d713cf3d..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateTestTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class CreateOrUpdateTestTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testCreateOrUpdateTestTests() { - BinaryData body = - BinaryData.fromString( - "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/sampleprovider/sampleresourcetype/sampleresourcename\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.createOrUpdateTestWithResponse("12345678-1234-1234-1234-123456789012", body, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java deleted file mode 100644 index 25299875f3467..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigListModelTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.DefaultServerMetricsConfigListModel; -import com.azure.developer.loadtesting.implementation.models.DefaultServerMetricsConfigModel; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DefaultServerMetricsConfigListModelTests { - @Test - public void testDeserialize() { - DefaultServerMetricsConfigListModel model = - BinaryData.fromString( - "{\"defaultMetrics\":{\"kzsmodm\":[{\"metricnamespace\":\"ftyhxhurokf\",\"aggregation\":\"xolniwpwcukjfk\",\"unit\":\"w\",\"displayDescription\":\"lryplwckbasyy\"},{\"metricnamespace\":\"ddhsgcbacphe\",\"aggregation\":\"ot\",\"unit\":\"gou\",\"displayDescription\":\"ndlik\"},{\"metricnamespace\":\"qkgfgibma\",\"aggregation\":\"akeqs\",\"unit\":\"bzqqedqytbciq\",\"displayDescription\":\"uflmm\"}],\"lnerkujysvleju\":[{\"metricnamespace\":\"ugpbkw\",\"aggregation\":\"utduqktapspwgcu\",\"unit\":\"umkdosvqwhbmd\",\"displayDescription\":\"bjf\"},{\"metricnamespace\":\"gmbmbexppbh\",\"aggregation\":\"qrolfpf\",\"unit\":\"lgbquxig\",\"displayDescription\":\"jgzjaoyfhrtx\"}],\"jcmmxdcufufsrp\":[{\"metricnamespace\":\"awrlyx\",\"aggregation\":\"kcprbnw\",\"unit\":\"jvtbvpyss\",\"displayDescription\":\"nruj\"},{\"metricnamespace\":\"uhmuouqfprwzwbn\",\"aggregation\":\"itnwuizgazxufi\",\"unit\":\"kyfi\",\"displayDescription\":\"fidfvzw\"},{\"metricnamespace\":\"uht\",\"aggregation\":\"wisdkft\",\"unit\":\"mnteiwao\",\"displayDescription\":\"km\"}]}}") - .toObject(DefaultServerMetricsConfigListModel.class); - Assertions.assertEquals("ftyhxhurokf", model.getDefaultMetrics().get("kzsmodm").get(0).getMetricnamespace()); - Assertions.assertEquals("xolniwpwcukjfk", model.getDefaultMetrics().get("kzsmodm").get(0).getAggregation()); - Assertions.assertEquals("w", model.getDefaultMetrics().get("kzsmodm").get(0).getUnit()); - Assertions.assertEquals( - "lryplwckbasyy", model.getDefaultMetrics().get("kzsmodm").get(0).getDisplayDescription()); - } - - @Test - public void testSerialize() { - DefaultServerMetricsConfigListModel model = - new DefaultServerMetricsConfigListModel() - .setDefaultMetrics( - mapOf( - "kzsmodm", - Arrays.asList( - new DefaultServerMetricsConfigModel() - .setMetricnamespace("ftyhxhurokf") - .setAggregation("xolniwpwcukjfk") - .setUnit("w") - .setDisplayDescription("lryplwckbasyy"), - new DefaultServerMetricsConfigModel() - .setMetricnamespace("ddhsgcbacphe") - .setAggregation("ot") - .setUnit("gou") - .setDisplayDescription("ndlik"), - new DefaultServerMetricsConfigModel() - .setMetricnamespace("qkgfgibma") - .setAggregation("akeqs") - .setUnit("bzqqedqytbciq") - .setDisplayDescription("uflmm")), - "lnerkujysvleju", - Arrays.asList( - new DefaultServerMetricsConfigModel() - .setMetricnamespace("ugpbkw") - .setAggregation("utduqktapspwgcu") - .setUnit("umkdosvqwhbmd") - .setDisplayDescription("bjf"), - new DefaultServerMetricsConfigModel() - .setMetricnamespace("gmbmbexppbh") - .setAggregation("qrolfpf") - .setUnit("lgbquxig") - .setDisplayDescription("jgzjaoyfhrtx")), - "jcmmxdcufufsrp", - Arrays.asList( - new DefaultServerMetricsConfigModel() - .setMetricnamespace("awrlyx") - .setAggregation("kcprbnw") - .setUnit("jvtbvpyss") - .setDisplayDescription("nruj"), - new DefaultServerMetricsConfigModel() - .setMetricnamespace("uhmuouqfprwzwbn") - .setAggregation("itnwuizgazxufi") - .setUnit("kyfi") - .setDisplayDescription("fidfvzw"), - new DefaultServerMetricsConfigModel() - .setMetricnamespace("uht") - .setAggregation("wisdkft") - .setUnit("mnteiwao") - .setDisplayDescription("km")))); - model = BinaryData.fromObject(model).toObject(DefaultServerMetricsConfigListModel.class); - Assertions.assertEquals("ftyhxhurokf", model.getDefaultMetrics().get("kzsmodm").get(0).getMetricnamespace()); - Assertions.assertEquals("xolniwpwcukjfk", model.getDefaultMetrics().get("kzsmodm").get(0).getAggregation()); - Assertions.assertEquals("w", model.getDefaultMetrics().get("kzsmodm").get(0).getUnit()); - Assertions.assertEquals( - "lryplwckbasyy", model.getDefaultMetrics().get("kzsmodm").get(0).getDisplayDescription()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java deleted file mode 100644 index 48e1523460f96..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DefaultServerMetricsConfigModelTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.DefaultServerMetricsConfigModel; -import com.azure.developer.loadtesting.implementation.models.LocalizedName; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DefaultServerMetricsConfigModelTests { - @Test - public void testDeserialize() { - DefaultServerMetricsConfigModel model = - BinaryData.fromString( - "{\"metricnamespace\":\"zidnsezcxtbzsgfy\",\"aggregation\":\"sne\",\"name\":{\"value\":\"wzjeiach\",\"localizedValue\":\"osfln\"},\"unit\":\"sfqpteehz\",\"displayDescription\":\"ypyqrimzinp\"}") - .toObject(DefaultServerMetricsConfigModel.class); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.getMetricnamespace()); - Assertions.assertEquals("sne", model.getAggregation()); - Assertions.assertEquals("wzjeiach", model.getName().getValue()); - Assertions.assertEquals("osfln", model.getName().getLocalizedValue()); - Assertions.assertEquals("sfqpteehz", model.getUnit()); - Assertions.assertEquals("ypyqrimzinp", model.getDisplayDescription()); - } - - @Test - public void testSerialize() { - DefaultServerMetricsConfigModel model = - new DefaultServerMetricsConfigModel() - .setMetricnamespace("zidnsezcxtbzsgfy") - .setAggregation("sne") - .setName(new LocalizedName().setValue("wzjeiach").setLocalizedValue("osfln")) - .setUnit("sfqpteehz") - .setDisplayDescription("ypyqrimzinp"); - model = BinaryData.fromObject(model).toObject(DefaultServerMetricsConfigModel.class); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.getMetricnamespace()); - Assertions.assertEquals("sne", model.getAggregation()); - Assertions.assertEquals("wzjeiach", model.getName().getValue()); - Assertions.assertEquals("osfln", model.getName().getLocalizedValue()); - Assertions.assertEquals("sfqpteehz", model.getUnit()); - Assertions.assertEquals("ypyqrimzinp", model.getDisplayDescription()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java deleted file mode 100644 index 929e92ed5d360..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAppComponentTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeleteAppComponentTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testDeleteAppComponentTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - appComponentClient.deleteAppComponentWithResponse( - "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java deleted file mode 100644 index f389678e84cd2..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteLoadTestTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeleteLoadTestTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testDeleteLoadTestTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.deleteLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java deleted file mode 100644 index f2da5a20e9092..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteServerMetricsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeleteServerMetricsTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testDeleteServerMetricsTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - serverMetricsClient.deleteServerMetricsWithResponse( - "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java deleted file mode 100644 index 966566bca782c..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestFileTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeleteTestFileTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testDeleteTestFileTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.deleteTestFileWithResponse( - "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java deleted file mode 100644 index 0970bd7356296..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteTestRunTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeleteTestRunTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testDeleteTestRunTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.deleteTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java deleted file mode 100644 index 2570bae6e2069..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorResponseBodyTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.Error; -import com.azure.developer.loadtesting.implementation.models.ErrorResponseBody; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ErrorResponseBodyTests { - @Test - public void testDeserialize() { - ErrorResponseBody model = - BinaryData.fromString( - "{\"error\":{\"code\":\"s\",\"message\":\"cmpoyfdkfogkny\",\"target\":\"ofjdde\",\"details\":[{\"code\":\"eupewnwreitjz\",\"message\":\"lusarh\",\"target\":\"fcqhsmyurkd\",\"details\":[]}]}}") - .toObject(ErrorResponseBody.class); - Assertions.assertEquals("s", model.getError().getCode()); - Assertions.assertEquals("cmpoyfdkfogkny", model.getError().getMessage()); - Assertions.assertEquals("ofjdde", model.getError().getTarget()); - Assertions.assertEquals("eupewnwreitjz", model.getError().getDetails().get(0).getCode()); - Assertions.assertEquals("lusarh", model.getError().getDetails().get(0).getMessage()); - Assertions.assertEquals("fcqhsmyurkd", model.getError().getDetails().get(0).getTarget()); - } - - @Test - public void testSerialize() { - ErrorResponseBody model = - new ErrorResponseBody() - .setError( - new Error() - .setCode("s") - .setMessage("cmpoyfdkfogkny") - .setTarget("ofjdde") - .setDetails( - Arrays.asList( - new Error() - .setCode("eupewnwreitjz") - .setMessage("lusarh") - .setTarget("fcqhsmyurkd") - .setDetails(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(ErrorResponseBody.class); - Assertions.assertEquals("s", model.getError().getCode()); - Assertions.assertEquals("cmpoyfdkfogkny", model.getError().getMessage()); - Assertions.assertEquals("ofjdde", model.getError().getTarget()); - Assertions.assertEquals("eupewnwreitjz", model.getError().getDetails().get(0).getCode()); - Assertions.assertEquals("lusarh", model.getError().getDetails().get(0).getMessage()); - Assertions.assertEquals("fcqhsmyurkd", model.getError().getDetails().get(0).getTarget()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java deleted file mode 100644 index e8194b1bf9328..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ErrorTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.Error; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ErrorTests { - @Test - public void testDeserialize() { - Error model = - BinaryData.fromString( - "{\"code\":\"xhekuksjtxukcdm\",\"message\":\"rcryuanzwuxzdxta\",\"target\":\"lhmwhfpmrqobm\",\"details\":[{\"code\":\"nryrtihf\",\"message\":\"ijbpzvgnwzsymgl\",\"target\":\"fcyzkohdbihanufh\",\"details\":[]},{\"code\":\"y\",\"message\":\"git\",\"target\":\"qhabifpikxwcz\",\"details\":[]},{\"code\":\"npqxuh\",\"message\":\"y\",\"target\":\"iwbybrkxvdumjg\",\"details\":[]}]}") - .toObject(Error.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.getCode()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.getMessage()); - Assertions.assertEquals("lhmwhfpmrqobm", model.getTarget()); - Assertions.assertEquals("nryrtihf", model.getDetails().get(0).getCode()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.getDetails().get(0).getMessage()); - Assertions.assertEquals("fcyzkohdbihanufh", model.getDetails().get(0).getTarget()); - } - - @Test - public void testSerialize() { - Error model = - new Error() - .setCode("xhekuksjtxukcdm") - .setMessage("rcryuanzwuxzdxta") - .setTarget("lhmwhfpmrqobm") - .setDetails( - Arrays.asList( - new Error() - .setCode("nryrtihf") - .setMessage("ijbpzvgnwzsymgl") - .setTarget("fcyzkohdbihanufh") - .setDetails(Arrays.asList()), - new Error() - .setCode("y") - .setMessage("git") - .setTarget("qhabifpikxwcz") - .setDetails(Arrays.asList()), - new Error() - .setCode("npqxuh") - .setMessage("y") - .setTarget("iwbybrkxvdumjg") - .setDetails(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(Error.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.getCode()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.getMessage()); - Assertions.assertEquals("lhmwhfpmrqobm", model.getTarget()); - Assertions.assertEquals("nryrtihf", model.getDetails().get(0).getCode()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.getDetails().get(0).getMessage()); - Assertions.assertEquals("fcyzkohdbihanufh", model.getDetails().get(0).getTarget()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java deleted file mode 100644 index 5237ba094d3e3..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlListTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.FileType; -import com.azure.developer.loadtesting.implementation.models.FileUrl; -import com.azure.developer.loadtesting.implementation.models.FileUrlList; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FileUrlListTests { - @Test - public void testDeserialize() { - FileUrlList model = - BinaryData.fromString( - "{\"value\":[{\"url\":\"kzjancuxrhdwbav\",\"fileId\":\"niwdjsw\",\"filename\":\"s\",\"fileType\":2,\"expireTime\":\"2021-10-19T12:26:50Z\",\"validationStatus\":\"ytxhp\"},{\"url\":\"bzpfzab\",\"fileId\":\"cuh\",\"filename\":\"tcty\",\"fileType\":0,\"expireTime\":\"2021-06-27T19:00:45Z\",\"validationStatus\":\"ovplw\"},{\"url\":\"hvgyuguosvmk\",\"fileId\":\"sxqu\",\"filename\":\"fpl\",\"fileType\":2,\"expireTime\":\"2021-10-07T01:44:34Z\",\"validationStatus\":\"kjz\"}],\"nextLink\":\"es\"}") - .toObject(FileUrlList.class); - Assertions.assertEquals("kzjancuxrhdwbav", model.getValue().get(0).getUrl()); - Assertions.assertEquals("niwdjsw", model.getValue().get(0).getFileId()); - Assertions.assertEquals("s", model.getValue().get(0).getFilename()); - Assertions.assertEquals(FileType.TWO, model.getValue().get(0).getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T12:26:50Z"), model.getValue().get(0).getExpireTime()); - Assertions.assertEquals("ytxhp", model.getValue().get(0).getValidationStatus()); - Assertions.assertEquals("es", model.getNextLink()); - } - - @Test - public void testSerialize() { - FileUrlList model = - new FileUrlList( - Arrays.asList( - new FileUrl() - .setUrl("kzjancuxrhdwbav") - .setFileId("niwdjsw") - .setFilename("s") - .setFileType(FileType.TWO) - .setExpireTime(OffsetDateTime.parse("2021-10-19T12:26:50Z")) - .setValidationStatus("ytxhp"), - new FileUrl() - .setUrl("bzpfzab") - .setFileId("cuh") - .setFilename("tcty") - .setFileType(FileType.ZERO) - .setExpireTime(OffsetDateTime.parse("2021-06-27T19:00:45Z")) - .setValidationStatus("ovplw"), - new FileUrl() - .setUrl("hvgyuguosvmk") - .setFileId("sxqu") - .setFilename("fpl") - .setFileType(FileType.TWO) - .setExpireTime(OffsetDateTime.parse("2021-10-07T01:44:34Z")) - .setValidationStatus("kjz"))) - .setNextLink("es"); - model = BinaryData.fromObject(model).toObject(FileUrlList.class); - Assertions.assertEquals("kzjancuxrhdwbav", model.getValue().get(0).getUrl()); - Assertions.assertEquals("niwdjsw", model.getValue().get(0).getFileId()); - Assertions.assertEquals("s", model.getValue().get(0).getFilename()); - Assertions.assertEquals(FileType.TWO, model.getValue().get(0).getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T12:26:50Z"), model.getValue().get(0).getExpireTime()); - Assertions.assertEquals("ytxhp", model.getValue().get(0).getValidationStatus()); - Assertions.assertEquals("es", model.getNextLink()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java deleted file mode 100644 index 6e5d5e2a3ac45..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FileUrlTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.FileType; -import com.azure.developer.loadtesting.implementation.models.FileUrl; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FileUrlTests { - @Test - public void testDeserialize() { - FileUrl model = - BinaryData.fromString( - "{\"url\":\"senhwlrs\",\"fileId\":\"rzpwvlqdqgbiq\",\"filename\":\"ihkaetcktvfc\",\"fileType\":1,\"expireTime\":\"2021-09-20T06:05:50Z\",\"validationStatus\":\"ymuctqhjfbebrj\"}") - .toObject(FileUrl.class); - Assertions.assertEquals("senhwlrs", model.getUrl()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.getFileId()); - Assertions.assertEquals("ihkaetcktvfc", model.getFilename()); - Assertions.assertEquals(FileType.ONE, model.getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T06:05:50Z"), model.getExpireTime()); - Assertions.assertEquals("ymuctqhjfbebrj", model.getValidationStatus()); - } - - @Test - public void testSerialize() { - FileUrl model = - new FileUrl() - .setUrl("senhwlrs") - .setFileId("rzpwvlqdqgbiq") - .setFilename("ihkaetcktvfc") - .setFileType(FileType.ONE) - .setExpireTime(OffsetDateTime.parse("2021-09-20T06:05:50Z")) - .setValidationStatus("ymuctqhjfbebrj"); - model = BinaryData.fromObject(model).toObject(FileUrl.class); - Assertions.assertEquals("senhwlrs", model.getUrl()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.getFileId()); - Assertions.assertEquals("ihkaetcktvfc", model.getFilename()); - Assertions.assertEquals(FileType.ONE, model.getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T06:05:50Z"), model.getExpireTime()); - Assertions.assertEquals("ymuctqhjfbebrj", model.getValidationStatus()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java deleted file mode 100644 index b9959560cf89c..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/FiltersTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.Filters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FiltersTests { - @Test - public void testDeserialize() { - Filters model = - BinaryData.fromString( - "{\"requestSamplerValues\":[\"zksmondj\"],\"errorFiltersValues\":[\"xvy\",\"omgkopkwho\",\"v\",\"ajqgxy\"]}") - .toObject(Filters.class); - Assertions.assertEquals("zksmondj", model.getRequestSamplerValues().get(0)); - Assertions.assertEquals("xvy", model.getErrorFiltersValues().get(0)); - } - - @Test - public void testSerialize() { - Filters model = - new Filters() - .setRequestSamplerValues(Arrays.asList("zksmondj")) - .setErrorFiltersValues(Arrays.asList("xvy", "omgkopkwho", "v", "ajqgxy")); - model = BinaryData.fromObject(model).toObject(Filters.class); - Assertions.assertEquals("zksmondj", model.getRequestSamplerValues().get(0)); - Assertions.assertEquals("xvy", model.getErrorFiltersValues().get(0)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java deleted file mode 100644 index af46110b469a5..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllTestFilesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetAllTestFilesTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetAllTestFilesTests() { - RequestOptions requestOptions = new RequestOptions().addQueryParam("continuationToken", "continuation token"); - Response response = - testClient.getAllTestFilesWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"nextLink\":null,\"value\":[{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}]}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java deleted file mode 100644 index 2d561eada0a2a..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentByNameTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetAppComponentByNameTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetAppComponentByNameTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - appComponentClient.getAppComponentByNameWithResponse( - "ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"name\":\"ee843bd9-a6d4-4364-a45c-427a03c39fa7\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceGroup\":\"samplerg\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\"}}}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java deleted file mode 100644 index 053ab5b9b7b07..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAppComponentTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetAppComponentTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetAppComponentTests() { - RequestOptions requestOptions = - new RequestOptions().addQueryParam("testRunId", "12316678-1234-1234-1234-122451189012"); - Response response = appComponentClient.getAppComponentWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"name\":\"ee843bd9-a6d4-4364-a45c-427a03c39fa7\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceGroup\":\"samplerg\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\"}}}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java deleted file mode 100644 index ea4a36b6ac878..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetLoadTestTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetLoadTestTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetLoadTestTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.getLoadTestWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":0,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":null,\"value\":20}}},\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testId\":\"12345678-1234-1234-1234-123456789012\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java deleted file mode 100644 index 8c0633ddbda24..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerDefaultMetricsTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetServerDefaultMetricsTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetServerDefaultMetricsTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = serverMetricsClient.getServerDefaultMetricsWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"defaultMetrics\":{\"microsoft.cache/redis\":[{\"name\":{\"localizedValue\":\"Server Load\",\"value\":\"serverLoad\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Cache Latency\",\"value\":\"cacheLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Cache Hits\",\"value\":\"cachehits\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Connected Clients\",\"value\":\"connectedclients\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null}],\"microsoft.classiccompute/virtualmachines\":[{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success E2E Latency\",\"value\":\"SuccessE2ELatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success Server Latency\",\"value\":\"SuccessServerLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Used Capacity\",\"value\":\"UsedCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/blobservices\":[{\"name\":{\"localizedValue\":\"Blob Count\",\"value\":\"BlobCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Index Capacity\",\"value\":\"ContainerCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Capacity\",\"value\":\"BlobCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/fileservices\":[{\"name\":{\"localizedValue\":\"File Capacity\",\"value\":\"FileCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"File Count\",\"value\":\"FileCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/queueservices\":[{\"name\":{\"localizedValue\":\"Queue Count\",\"value\":\"QueueCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Queue Capacity\",\"value\":\"QueueCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/tableservices\":[{\"name\":{\"localizedValue\":\"Table Count\",\"value\":\"TableCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Capacity\",\"value\":\"TableCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null}],\"microsoft.compute/virtualmachines\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null}],\"microsoft.compute/virtualmachinescalesets\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null}],\"microsoft.containerinstance/containergroups\":[{\"name\":{\"localizedValue\":\"CPU Usage\",\"value\":\"CpuUsage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerinstance/containergroups\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory Usage\",\"value\":\"MemoryUsage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerinstance/containergroups\",\"unit\":null}],\"microsoft.containerservice/managedclusters\":[{\"name\":{\"localizedValue\":\"Total number of available cpu cores in a managed cluster\",\"value\":\"kube_node_status_allocatable_cpu_cores\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Total amount of available memory in a managed cluster\",\"value\":\"kube_node_status_allocatable_memory_bytes\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Number of pods in Ready state\",\"value\":\"kube_pod_status_ready\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null}],\"microsoft.dbformariadb/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null}],\"microsoft.dbformysql/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null}],\"microsoft.dbforpostgresql/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null}],\"microsoft.dbforpostgresql/serversv2\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/serversv2\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/serversv2\",\"unit\":null}],\"microsoft.dbforpostgresql/singleservers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/singleservers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/singleservers\",\"unit\":null}],\"microsoft.documentdb/databaseaccounts\":[{\"name\":{\"localizedValue\":\"Total Requests\",\"value\":\"TotalRequests\"},\"aggregation\":\"Count\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Provisioned Throughput\",\"value\":\"ProvisionedThroughput\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Normalized RU Consumption\",\"value\":\"NormalizedRUConsumption\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null}],\"microsoft.eventhub/clusters\":[{\"name\":{\"localizedValue\":\"CPU\",\"value\":\"CPU\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Available Memory\",\"value\":\"AvailableMemory\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Errors\",\"value\":\"ServerErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Successful Requests\",\"value\":\"SuccessfulRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Quota Exceeded Errors\",\"value\":\"QuotaExceededErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null}],\"microsoft.eventhub/namespaces\":[{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Successful Requests\",\"value\":\"SuccessfulRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Quota Exceeded Errors\",\"value\":\"QuotaExceededErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Errors\",\"value\":\"ServerErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null}],\"microsoft.insights/components\":[{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null},{\"name\":{\"localizedValue\":\"Failed Request\",\"value\":\"requests/failed\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Requests\",\"value\":\"requests/count\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null}],\"microsoft.keyvault/vaults\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null},{\"name\":{\"localizedValue\":\"Total Service Api Hits\",\"value\":\"ServiceApiHit\"},\"aggregation\":\"Count\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null},{\"name\":{\"localizedValue\":\"Overall Service Api Latency\",\"value\":\"ServiceApiLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null}],\"microsoft.servicebus/namespaces\":[{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of active messages in a Queue/Topic\",\"value\":\"ActiveMessages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"CPU\",\"value\":\"NamespaceCpuUsage\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Incoming Messages\",\"value\":\"IncomingMessages\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Incoming Requests\",\"value\":\"IncomingRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of messages in a Queue/Topic\",\"value\":\"Messages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of dead-lettered message\",\"value\":\"DeadletteredMessages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null}],\"microsoft.servicefabricmesh/applications\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null}],\"microsoft.sql/managedinstances\":[{\"name\":{\"localizedValue\":\"Storage space reserved\",\"value\":\"reserved_storage_mb\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO bytes written\",\"value\":\"io_bytes_written\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"Average CPU percentage\",\"value\":\"avg_cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"Storage space used\",\"value\":\"storage_space_used_mb\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO bytes read\",\"value\":\"io_bytes_read\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null}],\"microsoft.sql/servers/databases\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null},{\"name\":{\"localizedValue\":\"Connection Failed\",\"value\":\"connection_failed\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null},{\"name\":{\"localizedValue\":\"Deadlocks\",\"value\":\"deadlock\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null}],\"microsoft.sql/servers/elasticpools\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/elasticpools\",\"unit\":null},{\"name\":{\"localizedValue\":\"Data space used percent\",\"value\":\"storage_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/elasticpools\",\"unit\":null}],\"microsoft.storage/storageaccounts\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success E2E Latency\",\"value\":\"SuccessE2ELatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Used Capacity\",\"value\":\"UsedCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success Server Latency\",\"value\":\"SuccessServerLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null}],\"microsoft.storage/storageaccounts/blobservices\":[{\"name\":{\"localizedValue\":\"Blob Container Count\",\"value\":\"ContainerCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Count\",\"value\":\"BlobCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Capacity\",\"value\":\"BlobCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/fileservices\":[{\"name\":{\"localizedValue\":\"File Count\",\"value\":\"FileCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"File Capacity\",\"value\":\"FileCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/queueservices\":[{\"name\":{\"localizedValue\":\"Queue Count\",\"value\":\"QueueCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Queue Capacity\",\"value\":\"QueueCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/tableservices\":[{\"name\":{\"localizedValue\":\"Table Count\",\"value\":\"TableCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Capacity\",\"value\":\"TableCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Entity Count\",\"value\":\"TableEntityCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null}],\"microsoft.web/serverfarms\":[{\"name\":{\"localizedValue\":\"CPU Percentage\",\"value\":\"CpuPercentage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/serverfarms\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory Percentage\",\"value\":\"MemoryPercentage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/serverfarms\",\"unit\":null}],\"microsoft.web/sites\":[{\"name\":{\"localizedValue\":\"Http5xx Error\",\"value\":\"Http5xx\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null},{\"name\":{\"localizedValue\":\"Requests\",\"value\":\"Requests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null},{\"name\":{\"localizedValue\":\"Response Time\",\"value\":\"HttpResponseTime\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null}]}}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java deleted file mode 100644 index fefe2a773e075..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByNameTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetServerMetricsByNameTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetServerMetricsByNameTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - serverMetricsClient.getServerMetricsByNameWithResponse( - "edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"name\":\"edc6e529-d009-4b99-b763-ca492e3a2823\",\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java deleted file mode 100644 index 9cf67a2d91ebf..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetServerMetricsTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetServerMetricsTests() { - RequestOptions requestOptions = - new RequestOptions().addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); - Response response = serverMetricsClient.getServerMetricsWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"name\":\"edc6e529-d009-4b99-b763-ca492e3a2823\",\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java deleted file mode 100644 index 1415f9087987b..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestFileTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetTestFileTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetTestFileTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testClient.getTestFileWithResponse( - "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java deleted file mode 100644 index 08f2b09e684d8..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsFiltersTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetTestRunClientMetricsFiltersTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetTestRunClientMetricsFiltersTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunClientMetricsFiltersWithResponse( - "12316678-1234-1234-1234-122451189012", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"filters\":{\"errorFiltersValues\":[\"500\"],\"requestSamplerValues\":[\"Homepage\"]},\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"timeRange\":{\"endTime\":\"2021-12-05T16:43:49.590Z\",\"startTime\":\"2021-12-05T16:43:49.590Z\"}}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java deleted file mode 100644 index b40e4fd092ab1..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunClientMetricsTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetTestRunClientMetricsTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetTestRunClientMetricsTests() { - BinaryData body = - BinaryData.fromString( - "{\"endTime\":\"2021-12-05T16:43:49.590Z\",\"errors\":[\"500\"],\"groupByInterval\":\"10s\",\"percentiles\":[\"95\"],\"requestSamplers\":[\"Homepage\"],\"startTime\":\"2021-12-05T16:43:49.590Z\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunClientMetricsWithResponse( - "12316678-1234-1234-1234-122451189012", body, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"timeSeries\":{\"activeUsers\":{\"Homepage\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":1}]},\"errors\":{\"500\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":1}]},\"responseTime\":{\"Homepage Pct 95\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":1}]},\"throughput\":{\"Homepage\":[{\"timestamp\":\"2021-12-05T16:43:49.320Z\",\"value\":2}]}}}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java deleted file mode 100644 index 061023934e351..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunFileTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetTestRunFileTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetTestRunFileTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunFileWithResponse( - "12316678-1234-1234-1234-122451189012", "92345678-1234-1111-1234-123456789012", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java deleted file mode 100644 index a49c64c3793d6..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetTestRunTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetTestRunTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testGetTestRunTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.getTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":18,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":20}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"DONE\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":{\"expireTime\":\"2022-05-16T09:14:46.0411793+00:00\",\"fileId\":\"abb846a7-63af-4d63-bb3d-a7aa4caff55c\",\"fileType\":2,\"filename\":\"worker.log\",\"url\":\"https://dummyurl.com/logresource\",\"validationStatus\":\"\"},\"resultUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/dummyresourceresult\",\"validationStatus\":\"VALIDATION_SUCCESS\"}}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"Passed\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":{\"Total\":{\"errorCount\":19,\"errorPct\":17,\"maxResTime\":16,\"meanResTime\":13,\"medianResTime\":10,\"minResTime\":18,\"pct1ResTime\":27,\"pct2ResTime\":20,\"pct3ResTime\":3,\"receivedKBytesPerSec\":13,\"sampleCount\":18,\"sentKBytesPerSec\":4,\"throughput\":5,\"transaction\":\"Total\"}},\"vusers\":4}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java deleted file mode 100644 index 880959b0f413b..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/InputTestArtifactsTests.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.FileType; -import com.azure.developer.loadtesting.implementation.models.FileUrl; -import com.azure.developer.loadtesting.implementation.models.InputTestArtifacts; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class InputTestArtifactsTests { - @Test - public void testDeserialize() { - InputTestArtifacts model = - BinaryData.fromString( - "{\"configUrl\":{\"url\":\"ocipazyxoeg\",\"fileId\":\"g\",\"filename\":\"piu\",\"fileType\":2,\"expireTime\":\"2021-08-14T19:48:52Z\",\"validationStatus\":\"qzntypm\"},\"testScriptUrl\":{\"url\":\"izcdrqjsd\",\"fileId\":\"dnfyhxdeoejzicwi\",\"filename\":\"jttgzf\",\"fileType\":0,\"expireTime\":\"2021-09-13T12:21:33Z\",\"validationStatus\":\"khaj\"},\"userPropUrl\":{\"url\":\"eamdp\",\"fileId\":\"g\",\"filename\":\"pbuxwgipwhon\",\"fileType\":0,\"expireTime\":\"2021-05-13T18:46:16Z\",\"validationStatus\":\"wankixzbi\"},\"inputArtifactsZipFileurl\":{\"url\":\"pu\",\"fileId\":\"mryw\",\"filename\":\"zoqftiyqzrnkcqvy\",\"fileType\":2,\"expireTime\":\"2021-04-08T10:43:47Z\",\"validationStatus\":\"sicohoqqnwvlry\"},\"additionalUrls\":[{\"url\":\"heun\",\"fileId\":\"qhgyxzkonocukok\",\"filename\":\"axuconuq\",\"fileType\":1,\"expireTime\":\"2021-05-20T10:54:42Z\",\"validationStatus\":\"ypewrmjmwvvjekt\"}]}") - .toObject(InputTestArtifacts.class); - Assertions.assertEquals("ocipazyxoeg", model.getConfigUrl().getUrl()); - Assertions.assertEquals("g", model.getConfigUrl().getFileId()); - Assertions.assertEquals("piu", model.getConfigUrl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getConfigUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T19:48:52Z"), model.getConfigUrl().getExpireTime()); - Assertions.assertEquals("qzntypm", model.getConfigUrl().getValidationStatus()); - Assertions.assertEquals("izcdrqjsd", model.getTestScriptUrl().getUrl()); - Assertions.assertEquals("dnfyhxdeoejzicwi", model.getTestScriptUrl().getFileId()); - Assertions.assertEquals("jttgzf", model.getTestScriptUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getTestScriptUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T12:21:33Z"), model.getTestScriptUrl().getExpireTime()); - Assertions.assertEquals("khaj", model.getTestScriptUrl().getValidationStatus()); - Assertions.assertEquals("eamdp", model.getUserPropUrl().getUrl()); - Assertions.assertEquals("g", model.getUserPropUrl().getFileId()); - Assertions.assertEquals("pbuxwgipwhon", model.getUserPropUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getUserPropUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T18:46:16Z"), model.getUserPropUrl().getExpireTime()); - Assertions.assertEquals("wankixzbi", model.getUserPropUrl().getValidationStatus()); - Assertions.assertEquals("pu", model.getInputArtifactsZipFileurl().getUrl()); - Assertions.assertEquals("mryw", model.getInputArtifactsZipFileurl().getFileId()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.getInputArtifactsZipFileurl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getInputArtifactsZipFileurl().getFileType()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-04-08T10:43:47Z"), model.getInputArtifactsZipFileurl().getExpireTime()); - Assertions.assertEquals("sicohoqqnwvlry", model.getInputArtifactsZipFileurl().getValidationStatus()); - } - - @Test - public void testSerialize() { - InputTestArtifacts model = - new InputTestArtifacts() - .setConfigUrl( - new FileUrl() - .setUrl("ocipazyxoeg") - .setFileId("g") - .setFilename("piu") - .setFileType(FileType.TWO) - .setExpireTime(OffsetDateTime.parse("2021-08-14T19:48:52Z")) - .setValidationStatus("qzntypm")) - .setTestScriptUrl( - new FileUrl() - .setUrl("izcdrqjsd") - .setFileId("dnfyhxdeoejzicwi") - .setFilename("jttgzf") - .setFileType(FileType.ZERO) - .setExpireTime(OffsetDateTime.parse("2021-09-13T12:21:33Z")) - .setValidationStatus("khaj")) - .setUserPropUrl( - new FileUrl() - .setUrl("eamdp") - .setFileId("g") - .setFilename("pbuxwgipwhon") - .setFileType(FileType.ZERO) - .setExpireTime(OffsetDateTime.parse("2021-05-13T18:46:16Z")) - .setValidationStatus("wankixzbi")) - .setInputArtifactsZipFileurl( - new FileUrl() - .setUrl("pu") - .setFileId("mryw") - .setFilename("zoqftiyqzrnkcqvy") - .setFileType(FileType.TWO) - .setExpireTime(OffsetDateTime.parse("2021-04-08T10:43:47Z")) - .setValidationStatus("sicohoqqnwvlry")); - model = BinaryData.fromObject(model).toObject(InputTestArtifacts.class); - Assertions.assertEquals("ocipazyxoeg", model.getConfigUrl().getUrl()); - Assertions.assertEquals("g", model.getConfigUrl().getFileId()); - Assertions.assertEquals("piu", model.getConfigUrl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getConfigUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T19:48:52Z"), model.getConfigUrl().getExpireTime()); - Assertions.assertEquals("qzntypm", model.getConfigUrl().getValidationStatus()); - Assertions.assertEquals("izcdrqjsd", model.getTestScriptUrl().getUrl()); - Assertions.assertEquals("dnfyhxdeoejzicwi", model.getTestScriptUrl().getFileId()); - Assertions.assertEquals("jttgzf", model.getTestScriptUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getTestScriptUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T12:21:33Z"), model.getTestScriptUrl().getExpireTime()); - Assertions.assertEquals("khaj", model.getTestScriptUrl().getValidationStatus()); - Assertions.assertEquals("eamdp", model.getUserPropUrl().getUrl()); - Assertions.assertEquals("g", model.getUserPropUrl().getFileId()); - Assertions.assertEquals("pbuxwgipwhon", model.getUserPropUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getUserPropUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T18:46:16Z"), model.getUserPropUrl().getExpireTime()); - Assertions.assertEquals("wankixzbi", model.getUserPropUrl().getValidationStatus()); - Assertions.assertEquals("pu", model.getInputArtifactsZipFileurl().getUrl()); - Assertions.assertEquals("mryw", model.getInputArtifactsZipFileurl().getFileId()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.getInputArtifactsZipFileurl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getInputArtifactsZipFileurl().getFileType()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-04-08T10:43:47Z"), model.getInputArtifactsZipFileurl().getExpireTime()); - Assertions.assertEquals("sicohoqqnwvlry", model.getInputArtifactsZipFileurl().getValidationStatus()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java deleted file mode 100644 index e72cf0e9a1ab9..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListLoadTestSearchTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class ListLoadTestSearchTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testListLoadTestSearchTests() { - RequestOptions requestOptions = - new RequestOptions() - .addQueryParam("continuationToken", "continuation token") - .addQueryParam("lastUpdatedEndTime", "2021-12-05T16:43:46.797Z") - .addQueryParam("lastUpdatedStartTime", "2021-12-05T16:43:46.797Z") - .addQueryParam("maxPageSize", "30") - .addQueryParam("orderBy", "executedDateTime") - .addQueryParam("search", "Performance_LoadTest"); - Response response = testClient.listLoadTestSearchWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"nextLink\":\"next link\",\"value\":[{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"pfmetric1\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":20}}},\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testId\":\"12345678-1234-1234-1234-123456789012\"}]}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java deleted file mode 100644 index 77b76b300c420..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListSupportedResourceTypeTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class ListSupportedResourceTypeTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testListSupportedResourceTypeTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = serverMetricsClient.listSupportedResourceTypeWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"value\":[\"microsoft.cache/redis\",\"microsoft.compute/virtualmachines\",\"microsoft.compute/virtualmachinescalesets\",\"microsoft.containerservice/managedclusters\",\"microsoft.web/sites\",\"microsoft.web/serverfarms\",\"microsoft.insights/components\",\"microsoft.servicefabricmesh/applications\",\"microsoft.web/staticsites\",\"microsoft.network/trafficmanagerprofiles\",\"microsoft.apimanagement/service\",\"microsoft.classicstorage/storageaccounts\",\"microsoft.storage/storageaccounts\",\"microsoft.storage/storageaccounts/fileservices\",\"microsoft.classicstorage/storageaccounts/fileservices\",\"microsoft.storage/storageaccounts/blobservices\",\"microsoft.classicstorage/storageaccounts/blobservices\",\"microsoft.storage/storageaccounts/tableservices\",\"microsoft.classicstorage/storageaccounts/tableservices\",\"microsoft.documentdb/databaseaccounts\",\"microsoft.sql/managedinstances\",\"microsoft.dbformariadb/servers\",\"microsoft.dbforpostgresql/servers\",\"microsoft.dbforpostgresql/serversv2\",\"microsoft.dbformysql/servers\",\"microsoft.sql/servers/databases\",\"microsoft.sql/servers/elasticpools\",\"microsoft.servicebus/namespaces\",\"microsoft.eventhub/namespaces\",\"microsoft.storage/storageaccounts/queueservices\",\"microsoft.classicstorage/storageaccounts/queueservices\",\"microsoft.eventhub/clusters\",\"microsoft.keyvault/vaults\"]}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java deleted file mode 100644 index 79c5d0e44e3a0..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListTestRunsSearchTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class ListTestRunsSearchTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testListTestRunsSearchTests() { - RequestOptions requestOptions = - new RequestOptions() - .addQueryParam("continuationToken", "continuation token") - .addQueryParam("executionFrom", "2021-12-05T16:43:48.805Z") - .addQueryParam("executionTo", "2021-12-05T16:43:48.805Z") - .addQueryParam("maxPageSize", "30") - .addQueryParam("orderBy", "executedDateTime") - .addQueryParam("search", "Performance_LoadTest_Run1") - .addQueryParam("status", "DONE,EXECUTING") - .addQueryParam("testId", "12345678-1234-1234-1234-123456789012"); - Response response = testRunClient.listTestRunsSearchWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"nextLink\":\"next link\",\"value\":[{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":18,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":10}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"DONE\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":{\"expireTime\":\"2022-05-16T09:14:46.0411793+00:00\",\"fileId\":\"abb846a7-63af-4d63-bb3d-a7aa4caff55c\",\"fileType\":2,\"filename\":\"worker.log\",\"url\":\"https://dummyurl.com/logresource\",\"validationStatus\":\"\"},\"resultUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/dummyresourceresult\",\"validationStatus\":\"VALIDATION_SUCCESS\"}}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"Passed\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":{\"Total\":{\"errorCount\":19,\"errorPct\":17,\"maxResTime\":16,\"meanResTime\":13,\"medianResTime\":10,\"minResTime\":18,\"pct1ResTime\":27,\"pct2ResTime\":20,\"pct3ResTime\":3,\"receivedKBytesPerSec\":13,\"sampleCount\":18,\"sentKBytesPerSec\":4,\"throughput\":5,\"transaction\":\"Total\"}},\"vusers\":4}]}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java deleted file mode 100644 index 4656e6803682f..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestClientTestBase.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.test.TestBase; -import com.azure.core.test.TestMode; -import com.azure.core.util.Configuration; -import com.azure.developer.loadtesting.AppComponentClient; -import com.azure.developer.loadtesting.AppComponentClientBuilder; -import com.azure.developer.loadtesting.ServerMetricsClient; -import com.azure.developer.loadtesting.ServerMetricsClientBuilder; -import com.azure.developer.loadtesting.TestClient; -import com.azure.developer.loadtesting.TestClientBuilder; -import com.azure.developer.loadtesting.TestRunClient; -import com.azure.developer.loadtesting.TestRunClientBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; -import java.time.OffsetDateTime; -import reactor.core.publisher.Mono; - -class LoadTestClientTestBase extends TestBase { - protected AppComponentClient appComponentClient; - - protected ServerMetricsClient serverMetricsClient; - - protected TestClient testClient; - - protected TestRunClient testRunClient; - - @Override - protected void beforeTest() { - AppComponentClientBuilder appComponentClientbuilder = - new AppComponentClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - appComponentClientbuilder - .httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - appComponentClientbuilder - .addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - appComponentClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - appComponentClient = appComponentClientbuilder.buildClient(); - - ServerMetricsClientBuilder serverMetricsClientbuilder = - new ServerMetricsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - serverMetricsClientbuilder - .httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - serverMetricsClientbuilder - .addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - serverMetricsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - serverMetricsClient = serverMetricsClientbuilder.buildClient(); - - TestClientBuilder testClientbuilder = - new TestClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - testClientbuilder - .httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - testClientbuilder - .addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - testClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - testClient = testClientbuilder.buildClient(); - - TestRunClientBuilder testRunClientbuilder = - new TestRunClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - testRunClientbuilder - .httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - testRunClientbuilder - .addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - testRunClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - testRunClient = testRunClientbuilder.buildClient(); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java deleted file mode 100644 index 556338c1abf27..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestConfigTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class LoadTestConfigTests { - @Test - public void testDeserialize() { - LoadTestConfig model = - BinaryData.fromString("{\"engineInstances\":330627677,\"splitAllCSVs\":false}") - .toObject(LoadTestConfig.class); - Assertions.assertEquals(330627677, model.getEngineInstances()); - Assertions.assertEquals(false, model.isSplitAllCSVs()); - } - - @Test - public void testSerialize() { - LoadTestConfig model = new LoadTestConfig().setEngineInstances(330627677).setSplitAllCSVs(false); - model = BinaryData.fromObject(model).toObject(LoadTestConfig.class); - Assertions.assertEquals(330627677, model.getEngineInstances()); - Assertions.assertEquals(false, model.isSplitAllCSVs()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java deleted file mode 100644 index fc774c4856a80..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LocalizedNameTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.LocalizedName; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class LocalizedNameTests { - @Test - public void testDeserialize() { - LocalizedName model = - BinaryData.fromString("{\"value\":\"wjdk\",\"localizedValue\":\"soodqxhcrmnoh\"}") - .toObject(LocalizedName.class); - Assertions.assertEquals("wjdk", model.getValue()); - Assertions.assertEquals("soodqxhcrmnoh", model.getLocalizedValue()); - } - - @Test - public void testSerialize() { - LocalizedName model = new LocalizedName().setValue("wjdk").setLocalizedValue("soodqxhcrmnoh"); - model = BinaryData.fromObject(model).toObject(LocalizedName.class); - Assertions.assertEquals("wjdk", model.getValue()); - Assertions.assertEquals("soodqxhcrmnoh", model.getLocalizedValue()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java deleted file mode 100644 index 105acaab0a291..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/OutputTestArtifactsTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.FileType; -import com.azure.developer.loadtesting.implementation.models.FileUrl; -import com.azure.developer.loadtesting.implementation.models.OutputTestArtifacts; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OutputTestArtifactsTests { - @Test - public void testDeserialize() { - OutputTestArtifacts model = - BinaryData.fromString( - "{\"resultUrl\":{\"url\":\"sd\",\"fileId\":\"ouwaboekqvkeln\",\"filename\":\"vbxwyjsflhh\",\"fileType\":2,\"expireTime\":\"2021-02-06T03:40:59Z\",\"validationStatus\":\"ixisxyawjoy\"},\"logsUrl\":{\"url\":\"slyjpkiid\",\"fileId\":\"exznelixhnr\",\"filename\":\"folhbnxknal\",\"fileType\":2,\"expireTime\":\"2021-05-05T13:18:41Z\",\"validationStatus\":\"gdtpnapnyiro\"}}") - .toObject(OutputTestArtifacts.class); - Assertions.assertEquals("sd", model.getResultUrl().getUrl()); - Assertions.assertEquals("ouwaboekqvkeln", model.getResultUrl().getFileId()); - Assertions.assertEquals("vbxwyjsflhh", model.getResultUrl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getResultUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T03:40:59Z"), model.getResultUrl().getExpireTime()); - Assertions.assertEquals("ixisxyawjoy", model.getResultUrl().getValidationStatus()); - Assertions.assertEquals("slyjpkiid", model.getLogsUrl().getUrl()); - Assertions.assertEquals("exznelixhnr", model.getLogsUrl().getFileId()); - Assertions.assertEquals("folhbnxknal", model.getLogsUrl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getLogsUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T13:18:41Z"), model.getLogsUrl().getExpireTime()); - Assertions.assertEquals("gdtpnapnyiro", model.getLogsUrl().getValidationStatus()); - } - - @Test - public void testSerialize() { - OutputTestArtifacts model = - new OutputTestArtifacts() - .setResultUrl( - new FileUrl() - .setUrl("sd") - .setFileId("ouwaboekqvkeln") - .setFilename("vbxwyjsflhh") - .setFileType(FileType.TWO) - .setExpireTime(OffsetDateTime.parse("2021-02-06T03:40:59Z")) - .setValidationStatus("ixisxyawjoy")) - .setLogsUrl( - new FileUrl() - .setUrl("slyjpkiid") - .setFileId("exznelixhnr") - .setFilename("folhbnxknal") - .setFileType(FileType.TWO) - .setExpireTime(OffsetDateTime.parse("2021-05-05T13:18:41Z")) - .setValidationStatus("gdtpnapnyiro")); - model = BinaryData.fromObject(model).toObject(OutputTestArtifacts.class); - Assertions.assertEquals("sd", model.getResultUrl().getUrl()); - Assertions.assertEquals("ouwaboekqvkeln", model.getResultUrl().getFileId()); - Assertions.assertEquals("vbxwyjsflhh", model.getResultUrl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getResultUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T03:40:59Z"), model.getResultUrl().getExpireTime()); - Assertions.assertEquals("ixisxyawjoy", model.getResultUrl().getValidationStatus()); - Assertions.assertEquals("slyjpkiid", model.getLogsUrl().getUrl()); - Assertions.assertEquals("exznelixhnr", model.getLogsUrl().getFileId()); - Assertions.assertEquals("folhbnxknal", model.getLogsUrl().getFilename()); - Assertions.assertEquals(FileType.TWO, model.getLogsUrl().getFileType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T13:18:41Z"), model.getLogsUrl().getExpireTime()); - Assertions.assertEquals("gdtpnapnyiro", model.getLogsUrl().getValidationStatus()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java deleted file mode 100644 index f4f8f978a04f5..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailCriteriaTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; -import com.azure.developer.loadtesting.implementation.models.PassFailMetric; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PassFailCriteriaTests { - @Test - public void testDeserialize() { - PassFailCriteria model = - BinaryData.fromString( - "{\"passFailMetrics\":{\"yiuokktwh\":{\"clientmetric\":\"unqecanoae\",\"aggregate\":\"fhyhltrpmopjmcma\",\"condition\":\"okth\",\"requestName\":\"iuaod\",\"value\":49.02669503174233,\"action\":\"vxodpu\",\"actualValue\":83.70553981890328,\"result\":\"ydagfuaxbe\"},\"d\":{\"clientmetric\":\"xw\",\"aggregate\":\"wqsmbsur\",\"condition\":\"imoryocfsfksym\",\"requestName\":\"ys\",\"value\":0.7116403106567359,\"action\":\"xhqyudxorrqnb\",\"actualValue\":40.67764391393379,\"result\":\"yifqrvkdvjsllrmv\"},\"rsa\":{\"clientmetric\":\"atkpnp\",\"aggregate\":\"exxbczwtr\",\"condition\":\"iqzbq\",\"requestName\":\"sovmyokacspkwl\",\"value\":77.86307144365512,\"action\":\"pxjmflbvvnchr\",\"actualValue\":65.8967024807498,\"result\":\"wzjuqk\"},\"eggzfb\":{\"clientmetric\":\"wkuofoskghsauu\",\"aggregate\":\"jmvxie\",\"condition\":\"ugidyjrr\",\"requestName\":\"y\",\"value\":93.63707158222255,\"action\":\"xc\",\"actualValue\":14.791695296295293,\"result\":\"lhocohslkev\"}}}") - .toObject(PassFailCriteria.class); - Assertions.assertEquals("unqecanoae", model.getPassFailMetrics().get("yiuokktwh").getClientmetric()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.getPassFailMetrics().get("yiuokktwh").getAggregate()); - Assertions.assertEquals("okth", model.getPassFailMetrics().get("yiuokktwh").getCondition()); - Assertions.assertEquals("iuaod", model.getPassFailMetrics().get("yiuokktwh").getRequestName()); - Assertions.assertEquals(49.02669503174233D, model.getPassFailMetrics().get("yiuokktwh").getValue()); - Assertions.assertEquals("vxodpu", model.getPassFailMetrics().get("yiuokktwh").getAction()); - } - - @Test - public void testSerialize() { - PassFailCriteria model = - new PassFailCriteria() - .setPassFailMetrics( - mapOf( - "yiuokktwh", - new PassFailMetric() - .setClientmetric("unqecanoae") - .setAggregate("fhyhltrpmopjmcma") - .setCondition("okth") - .setRequestName("iuaod") - .setValue(49.02669503174233D) - .setAction("vxodpu"), - "d", - new PassFailMetric() - .setClientmetric("xw") - .setAggregate("wqsmbsur") - .setCondition("imoryocfsfksym") - .setRequestName("ys") - .setValue(0.7116403106567359D) - .setAction("xhqyudxorrqnb"), - "rsa", - new PassFailMetric() - .setClientmetric("atkpnp") - .setAggregate("exxbczwtr") - .setCondition("iqzbq") - .setRequestName("sovmyokacspkwl") - .setValue(77.86307144365512D) - .setAction("pxjmflbvvnchr"), - "eggzfb", - new PassFailMetric() - .setClientmetric("wkuofoskghsauu") - .setAggregate("jmvxie") - .setCondition("ugidyjrr") - .setRequestName("y") - .setValue(93.63707158222255D) - .setAction("xc"))); - model = BinaryData.fromObject(model).toObject(PassFailCriteria.class); - Assertions.assertEquals("unqecanoae", model.getPassFailMetrics().get("yiuokktwh").getClientmetric()); - Assertions.assertEquals("fhyhltrpmopjmcma", model.getPassFailMetrics().get("yiuokktwh").getAggregate()); - Assertions.assertEquals("okth", model.getPassFailMetrics().get("yiuokktwh").getCondition()); - Assertions.assertEquals("iuaod", model.getPassFailMetrics().get("yiuokktwh").getRequestName()); - Assertions.assertEquals(49.02669503174233D, model.getPassFailMetrics().get("yiuokktwh").getValue()); - Assertions.assertEquals("vxodpu", model.getPassFailMetrics().get("yiuokktwh").getAction()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java deleted file mode 100644 index 350e7b5e95e8e..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/PassFailMetricTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.PassFailMetric; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PassFailMetricTests { - @Test - public void testDeserialize() { - PassFailMetric model = - BinaryData.fromString( - "{\"clientmetric\":\"fmvfaxkffeiit\",\"aggregate\":\"vmezy\",\"condition\":\"hxmzsbbzoggig\",\"requestName\":\"wburvjxxjnspydpt\",\"value\":65.57248882227046,\"action\":\"ou\",\"actualValue\":75.86161422302953,\"result\":\"wtiukbldn\"}") - .toObject(PassFailMetric.class); - Assertions.assertEquals("fmvfaxkffeiit", model.getClientmetric()); - Assertions.assertEquals("vmezy", model.getAggregate()); - Assertions.assertEquals("hxmzsbbzoggig", model.getCondition()); - Assertions.assertEquals("wburvjxxjnspydpt", model.getRequestName()); - Assertions.assertEquals(65.57248882227046D, model.getValue()); - Assertions.assertEquals("ou", model.getAction()); - } - - @Test - public void testSerialize() { - PassFailMetric model = - new PassFailMetric() - .setClientmetric("fmvfaxkffeiit") - .setAggregate("vmezy") - .setCondition("hxmzsbbzoggig") - .setRequestName("wburvjxxjnspydpt") - .setValue(65.57248882227046D) - .setAction("ou"); - model = BinaryData.fromObject(model).toObject(PassFailMetric.class); - Assertions.assertEquals("fmvfaxkffeiit", model.getClientmetric()); - Assertions.assertEquals("vmezy", model.getAggregate()); - Assertions.assertEquals("hxmzsbbzoggig", model.getCondition()); - Assertions.assertEquals("wburvjxxjnspydpt", model.getRequestName()); - Assertions.assertEquals(65.57248882227046D, model.getValue()); - Assertions.assertEquals("ou", model.getAction()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java deleted file mode 100644 index 9b6e8ff8335f7..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ResourceMetricModelTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.ResourceMetricModel; -import com.azure.developer.loadtesting.implementation.models.ServerMetricName; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ResourceMetricModelTests { - @Test - public void testDeserialize() { - ResourceMetricModel model = - BinaryData.fromString( - "{\"id\":\"qrglssainqpjwn\",\"resourceId\":\"lljfmppeeb\",\"metricnamespace\":\"mgxsab\",\"displayDescription\":\"qduujitcjczdz\",\"name\":{\"value\":\"vndhkrwpdapp\",\"localizedValue\":\"sbdkvwr\"},\"aggregation\":\"jfeusnh\",\"unit\":\"je\",\"resourceType\":\"tmrldhugjzzdatq\"}") - .toObject(ResourceMetricModel.class); - Assertions.assertEquals("lljfmppeeb", model.getResourceId()); - Assertions.assertEquals("mgxsab", model.getMetricnamespace()); - Assertions.assertEquals("qduujitcjczdz", model.getDisplayDescription()); - Assertions.assertEquals("vndhkrwpdapp", model.getName().getValue()); - Assertions.assertEquals("sbdkvwr", model.getName().getLocalizedValue()); - Assertions.assertEquals("jfeusnh", model.getAggregation()); - Assertions.assertEquals("je", model.getUnit()); - Assertions.assertEquals("tmrldhugjzzdatq", model.getResourceType()); - } - - @Test - public void testSerialize() { - ResourceMetricModel model = - new ResourceMetricModel( - "lljfmppeeb", - "mgxsab", - new ServerMetricName("vndhkrwpdapp", "sbdkvwr"), - "jfeusnh", - "tmrldhugjzzdatq") - .setDisplayDescription("qduujitcjczdz") - .setUnit("je"); - model = BinaryData.fromObject(model).toObject(ResourceMetricModel.class); - Assertions.assertEquals("lljfmppeeb", model.getResourceId()); - Assertions.assertEquals("mgxsab", model.getMetricnamespace()); - Assertions.assertEquals("qduujitcjczdz", model.getDisplayDescription()); - Assertions.assertEquals("vndhkrwpdapp", model.getName().getValue()); - Assertions.assertEquals("sbdkvwr", model.getName().getLocalizedValue()); - Assertions.assertEquals("jfeusnh", model.getAggregation()); - Assertions.assertEquals("je", model.getUnit()); - Assertions.assertEquals("tmrldhugjzzdatq", model.getResourceType()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java deleted file mode 100644 index 9cb32bdd178f3..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SecretMetadataTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.SecretMetadata; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SecretMetadataTests { - @Test - public void testDeserialize() { - SecretMetadata model = - BinaryData.fromString("{\"value\":\"erfuwuttt\",\"type\":\"vjrbirphxepcyvah\"}") - .toObject(SecretMetadata.class); - Assertions.assertEquals("erfuwuttt", model.getValue()); - Assertions.assertEquals("vjrbirphxepcyvah", model.getType()); - } - - @Test - public void testSerialize() { - SecretMetadata model = new SecretMetadata().setValue("erfuwuttt").setType("vjrbirphxepcyvah"); - model = BinaryData.fromObject(model).toObject(SecretMetadata.class); - Assertions.assertEquals("erfuwuttt", model.getValue()); - Assertions.assertEquals("vjrbirphxepcyvah", model.getType()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java deleted file mode 100644 index ed36fcb3da97b..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SeriesTests.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.Series; -import com.azure.developer.loadtesting.implementation.models.TimeSeries; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SeriesTests { - @Test - public void testDeserialize() { - Series model = - BinaryData.fromString( - "{\"activeUsers\":{\"izxbmpgcjef\":[{\"timestamp\":\"2021-10-04T07:28:11Z\",\"value\":92.22079373726689},{\"timestamp\":\"2021-06-26T20:58:29Z\",\"value\":2.299894041657846},{\"timestamp\":\"2021-03-25T05:26:25Z\",\"value\":94.56387544596132}]},\"responseTime\":{\"d\":[{\"timestamp\":\"2021-05-22T02:28:39Z\",\"value\":98.18414033464762}]},\"throughput\":{\"mnzb\":[{\"timestamp\":\"2021-02-09T00:05:07Z\",\"value\":86.09688986688754}],\"dyhtozfikdowwquu\":[{\"timestamp\":\"2021-09-06T03:21:41Z\",\"value\":25.369948465939373},{\"timestamp\":\"2021-07-30T09:20:18Z\",\"value\":49.83795369512855},{\"timestamp\":\"2021-08-25T15:11:39Z\",\"value\":17.40379051397306},{\"timestamp\":\"2021-03-26T18:18:01Z\",\"value\":13.315355649235116}],\"zonosgg\":[{\"timestamp\":\"2021-05-15T23:08:57Z\",\"value\":83.69136348663503},{\"timestamp\":\"2021-10-23T21:40:50Z\",\"value\":87.05152697933156}],\"iiswacffgdkzze\":[{\"timestamp\":\"2021-04-17T15:34:56Z\",\"value\":26.79557146459449},{\"timestamp\":\"2021-01-27T23:27:37Z\",\"value\":4.689437310526101},{\"timestamp\":\"2021-06-19T07:56:54Z\",\"value\":55.007020519994455}]},\"errors\":{\"ppfufl\":[{\"timestamp\":\"2021-08-19T00:26:37Z\",\"value\":70.37932285828938},{\"timestamp\":\"2021-01-14T03:31:38Z\",\"value\":40.827588761382884}],\"cnihgwqapnedgfbc\":[{\"timestamp\":\"2021-05-23T16:48:47Z\",\"value\":46.16105003491787},{\"timestamp\":\"2021-07-11T09:21:13Z\",\"value\":92.56029614054873},{\"timestamp\":\"2021-07-13T08:45:58Z\",\"value\":37.0611510862625}]}}") - .toObject(Series.class); - Assertions.assertEquals( - OffsetDateTime.parse("2021-10-04T07:28:11Z"), - model.getActiveUsers().get("izxbmpgcjef").get(0).getTimestamp()); - Assertions.assertEquals(92.22079373726689D, model.getActiveUsers().get("izxbmpgcjef").get(0).getValue()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-05-22T02:28:39Z"), model.getResponseTime().get("d").get(0).getTimestamp()); - Assertions.assertEquals(98.18414033464762D, model.getResponseTime().get("d").get(0).getValue()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-02-09T00:05:07Z"), model.getThroughput().get("mnzb").get(0).getTimestamp()); - Assertions.assertEquals(86.09688986688754D, model.getThroughput().get("mnzb").get(0).getValue()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-08-19T00:26:37Z"), model.getErrors().get("ppfufl").get(0).getTimestamp()); - Assertions.assertEquals(70.37932285828938D, model.getErrors().get("ppfufl").get(0).getValue()); - } - - @Test - public void testSerialize() { - Series model = - new Series() - .setActiveUsers( - mapOf( - "izxbmpgcjef", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-10-04T07:28:11Z")) - .setValue(92.22079373726689D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-06-26T20:58:29Z")) - .setValue(2.299894041657846D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-03-25T05:26:25Z")) - .setValue(94.56387544596132D)))) - .setResponseTime( - mapOf( - "d", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-05-22T02:28:39Z")) - .setValue(98.18414033464762D)))) - .setThroughput( - mapOf( - "mnzb", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-02-09T00:05:07Z")) - .setValue(86.09688986688754D)), - "dyhtozfikdowwquu", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-09-06T03:21:41Z")) - .setValue(25.369948465939373D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-07-30T09:20:18Z")) - .setValue(49.83795369512855D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-08-25T15:11:39Z")) - .setValue(17.40379051397306D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-03-26T18:18:01Z")) - .setValue(13.315355649235116D)), - "zonosgg", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-05-15T23:08:57Z")) - .setValue(83.69136348663503D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-10-23T21:40:50Z")) - .setValue(87.05152697933156D)), - "iiswacffgdkzze", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-04-17T15:34:56Z")) - .setValue(26.79557146459449D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-01-27T23:27:37Z")) - .setValue(4.689437310526101D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-06-19T07:56:54Z")) - .setValue(55.007020519994455D)))) - .setErrors( - mapOf( - "ppfufl", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-08-19T00:26:37Z")) - .setValue(70.37932285828938D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-01-14T03:31:38Z")) - .setValue(40.827588761382884D)), - "cnihgwqapnedgfbc", - Arrays.asList( - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-05-23T16:48:47Z")) - .setValue(46.16105003491787D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-07-11T09:21:13Z")) - .setValue(92.56029614054873D), - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-07-13T08:45:58Z")) - .setValue(37.0611510862625D)))); - model = BinaryData.fromObject(model).toObject(Series.class); - Assertions.assertEquals( - OffsetDateTime.parse("2021-10-04T07:28:11Z"), - model.getActiveUsers().get("izxbmpgcjef").get(0).getTimestamp()); - Assertions.assertEquals(92.22079373726689D, model.getActiveUsers().get("izxbmpgcjef").get(0).getValue()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-05-22T02:28:39Z"), model.getResponseTime().get("d").get(0).getTimestamp()); - Assertions.assertEquals(98.18414033464762D, model.getResponseTime().get("d").get(0).getValue()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-02-09T00:05:07Z"), model.getThroughput().get("mnzb").get(0).getTimestamp()); - Assertions.assertEquals(86.09688986688754D, model.getThroughput().get("mnzb").get(0).getValue()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-08-19T00:26:37Z"), model.getErrors().get("ppfufl").get(0).getTimestamp()); - Assertions.assertEquals(70.37932285828938D, model.getErrors().get("ppfufl").get(0).getValue()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java deleted file mode 100644 index f454e8b3b461a..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricNameTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.ServerMetricName; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ServerMetricNameTests { - @Test - public void testDeserialize() { - ServerMetricName model = - BinaryData.fromString("{\"value\":\"hocdgeab\",\"localizedValue\":\"gphuticndvka\"}") - .toObject(ServerMetricName.class); - Assertions.assertEquals("hocdgeab", model.getValue()); - Assertions.assertEquals("gphuticndvka", model.getLocalizedValue()); - } - - @Test - public void testSerialize() { - ServerMetricName model = new ServerMetricName("hocdgeab", "gphuticndvka"); - model = BinaryData.fromObject(model).toObject(ServerMetricName.class); - Assertions.assertEquals("hocdgeab", model.getValue()); - Assertions.assertEquals("gphuticndvka", model.getLocalizedValue()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java deleted file mode 100644 index 239dbb187bea1..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ServerMetricsModelTests.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.ResourceMetricModel; -import com.azure.developer.loadtesting.implementation.models.ServerMetricName; -import com.azure.developer.loadtesting.implementation.models.ServerMetricsModel; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ServerMetricsModelTests { - @Test - public void testDeserialize() { - ServerMetricsModel model = - BinaryData.fromString( - "{\"name\":\"vukxgau\",\"testId\":\"cs\",\"testRunId\":\"s\",\"metrics\":{\"vmkjozkrwfndiodj\":{\"id\":\"ejhkry\",\"resourceId\":\"tnapczwlokjyemkk\",\"metricnamespace\":\"ni\",\"displayDescription\":\"oxzjnchgejspod\",\"name\":{\"value\":\"ailzydehojwyahu\",\"localizedValue\":\"inpm\"},\"aggregation\":\"njaqwixjspro\",\"unit\":\"cputegjvwmfdats\",\"resourceType\":\"mdvpjhulsu\"},\"zfsinzgvf\":{\"id\":\"lwejdpv\",\"resourceId\":\"ryo\",\"metricnamespace\":\"psoacctazakljl\",\"displayDescription\":\"bcryffdfd\",\"name\":{\"value\":\"sy\",\"localizedValue\":\"expa\"},\"aggregation\":\"jakhmsbzjh\",\"unit\":\"zevdphlx\",\"resourceType\":\"olthqtrgqjbp\"},\"usivye\":{\"id\":\"rwzoxxjtfelluwf\",\"resourceId\":\"it\",\"metricnamespace\":\"np\",\"displayDescription\":\"fpjkjlxofp\",\"name\":{\"value\":\"vhpfxxypininmay\",\"localizedValue\":\"uybbkpodep\"},\"aggregation\":\"oginuvamiheognar\",\"unit\":\"xth\",\"resourceType\":\"o\"},\"cjdkwtnhxbnjbi\":{\"id\":\"ciqihnhung\",\"resourceId\":\"wjzrnfygxgisp\",\"metricnamespace\":\"mvtzfkufub\",\"displayDescription\":\"ofx\",\"name\":{\"value\":\"eofjaeqjh\",\"localizedValue\":\"jbasvmsmjqulngs\"},\"aggregation\":\"tnb\",\"unit\":\"kzgcwrwcl\",\"resourceType\":\"xwrljdouskcqvkoc\"}}}") - .toObject(ServerMetricsModel.class); - Assertions.assertEquals("cs", model.getTestId()); - Assertions.assertEquals("s", model.getTestRunId()); - Assertions.assertEquals("tnapczwlokjyemkk", model.getMetrics().get("vmkjozkrwfndiodj").getResourceId()); - Assertions.assertEquals("ni", model.getMetrics().get("vmkjozkrwfndiodj").getMetricnamespace()); - Assertions.assertEquals("oxzjnchgejspod", model.getMetrics().get("vmkjozkrwfndiodj").getDisplayDescription()); - Assertions.assertEquals("ailzydehojwyahu", model.getMetrics().get("vmkjozkrwfndiodj").getName().getValue()); - Assertions.assertEquals("inpm", model.getMetrics().get("vmkjozkrwfndiodj").getName().getLocalizedValue()); - Assertions.assertEquals("njaqwixjspro", model.getMetrics().get("vmkjozkrwfndiodj").getAggregation()); - Assertions.assertEquals("cputegjvwmfdats", model.getMetrics().get("vmkjozkrwfndiodj").getUnit()); - Assertions.assertEquals("mdvpjhulsu", model.getMetrics().get("vmkjozkrwfndiodj").getResourceType()); - } - - @Test - public void testSerialize() { - ServerMetricsModel model = - new ServerMetricsModel() - .setTestId("cs") - .setTestRunId("s") - .setMetrics( - mapOf( - "vmkjozkrwfndiodj", - new ResourceMetricModel( - "tnapczwlokjyemkk", - "ni", - new ServerMetricName("ailzydehojwyahu", "inpm"), - "njaqwixjspro", - "mdvpjhulsu") - .setDisplayDescription("oxzjnchgejspod") - .setUnit("cputegjvwmfdats"), - "zfsinzgvf", - new ResourceMetricModel( - "ryo", - "psoacctazakljl", - new ServerMetricName("sy", "expa"), - "jakhmsbzjh", - "olthqtrgqjbp") - .setDisplayDescription("bcryffdfd") - .setUnit("zevdphlx"), - "usivye", - new ResourceMetricModel( - "it", - "np", - new ServerMetricName("vhpfxxypininmay", "uybbkpodep"), - "oginuvamiheognar", - "o") - .setDisplayDescription("fpjkjlxofp") - .setUnit("xth"), - "cjdkwtnhxbnjbi", - new ResourceMetricModel( - "wjzrnfygxgisp", - "mvtzfkufub", - new ServerMetricName("eofjaeqjh", "jbasvmsmjqulngs"), - "tnb", - "xwrljdouskcqvkoc") - .setDisplayDescription("ofx") - .setUnit("kzgcwrwcl"))); - model = BinaryData.fromObject(model).toObject(ServerMetricsModel.class); - Assertions.assertEquals("cs", model.getTestId()); - Assertions.assertEquals("s", model.getTestRunId()); - Assertions.assertEquals("tnapczwlokjyemkk", model.getMetrics().get("vmkjozkrwfndiodj").getResourceId()); - Assertions.assertEquals("ni", model.getMetrics().get("vmkjozkrwfndiodj").getMetricnamespace()); - Assertions.assertEquals("oxzjnchgejspod", model.getMetrics().get("vmkjozkrwfndiodj").getDisplayDescription()); - Assertions.assertEquals("ailzydehojwyahu", model.getMetrics().get("vmkjozkrwfndiodj").getName().getValue()); - Assertions.assertEquals("inpm", model.getMetrics().get("vmkjozkrwfndiodj").getName().getLocalizedValue()); - Assertions.assertEquals("njaqwixjspro", model.getMetrics().get("vmkjozkrwfndiodj").getAggregation()); - Assertions.assertEquals("cputegjvwmfdats", model.getMetrics().get("vmkjozkrwfndiodj").getUnit()); - Assertions.assertEquals("mdvpjhulsu", model.getMetrics().get("vmkjozkrwfndiodj").getResourceType()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java deleted file mode 100644 index 47a246cd4a5a9..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopTestRunTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class StopTestRunTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testStopTestRunTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = - testRunClient.stopTestRunWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString( - "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":null,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"pfmetric1\":{\"action\":\"continue\",\"actualValue\":0,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":null,\"value\":20}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"CANCELLING\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":2,\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":0,\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":1,\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":null,\"resultUrl\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"NOT_APPLICABLE\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":null,\"vusers\":null}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java deleted file mode 100644 index 6f32295d7fa36..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SupportedResourceTypeTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.SupportedResourceType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SupportedResourceTypeTests { - @Test - public void testDeserialize() { - SupportedResourceType model = - BinaryData.fromString("{\"value\":[\"kwh\",\"soifiyipjxsqw\"]}").toObject(SupportedResourceType.class); - Assertions.assertEquals("kwh", model.getValue().get(0)); - } - - @Test - public void testSerialize() { - SupportedResourceType model = new SupportedResourceType().setValue(Arrays.asList("kwh", "soifiyipjxsqw")); - model = BinaryData.fromObject(model).toObject(SupportedResourceType.class); - Assertions.assertEquals("kwh", model.getValue().get(0)); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java deleted file mode 100644 index fc24f3fecc6d8..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestArtifactsTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.FileType; -import com.azure.developer.loadtesting.implementation.models.FileUrl; -import com.azure.developer.loadtesting.implementation.models.InputTestArtifacts; -import com.azure.developer.loadtesting.implementation.models.OutputTestArtifacts; -import com.azure.developer.loadtesting.implementation.models.TestArtifacts; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TestArtifactsTests { - @Test - public void testDeserialize() { - TestArtifacts model = - BinaryData.fromString( - "{\"inputArtifacts\":{\"configUrl\":{\"url\":\"cjooxdjebwpucwwf\",\"fileId\":\"vbvmeu\",\"filename\":\"ivyhzceuojgjrwju\",\"fileType\":0,\"expireTime\":\"2021-05-06T21:21:59Z\",\"validationStatus\":\"cdytdxw\"},\"testScriptUrl\":{\"url\":\"nrjawgqwg\",\"fileId\":\"ni\",\"filename\":\"x\",\"fileType\":1,\"expireTime\":\"2021-04-10T12:35:25Z\",\"validationStatus\":\"gklwn\"},\"userPropUrl\":{\"url\":\"jdauwhvy\",\"fileId\":\"zbtd\",\"filename\":\"ujznb\",\"fileType\":1,\"expireTime\":\"2021-05-19T00:36:02Z\",\"validationStatus\":\"przqlveu\"},\"inputArtifactsZipFileurl\":{\"url\":\"pjmkhfxobbc\",\"fileId\":\"s\",\"filename\":\"jriplrbpbewtghf\",\"fileType\":2,\"expireTime\":\"2021-09-03T22:44:02Z\",\"validationStatus\":\"xzvlvqhjkbegib\"},\"additionalUrls\":[{\"url\":\"iebwwaloayqcgwrt\",\"fileId\":\"uzgwyzmhtx\",\"filename\":\"gmtsavjcbpwxqpsr\",\"fileType\":0,\"expireTime\":\"2021-01-16T18:55:51Z\",\"validationStatus\":\"vriuhprwmdyvx\"},{\"url\":\"ayriwwroyqbexrm\",\"fileId\":\"ibycno\",\"filename\":\"knme\",\"fileType\":1,\"expireTime\":\"2021-05-25T06:46Z\",\"validationStatus\":\"ah\"}]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"zhpvgqzcjrvxd\",\"fileId\":\"lmwlxkvugfhzo\",\"filename\":\"wjvzunluthnn\",\"fileType\":0,\"expireTime\":\"2021-10-10T00:35:03Z\",\"validationStatus\":\"eilpjzuaejxdu\"},\"logsUrl\":{\"url\":\"kzbbtd\",\"fileId\":\"mv\",\"filename\":\"kgpwoz\",\"fileType\":0,\"expireTime\":\"2021-08-14T18:03:09Z\",\"validationStatus\":\"sjyofdx\"}}}") - .toObject(TestArtifacts.class); - Assertions.assertEquals("zhpvgqzcjrvxd", model.getOutputArtifacts().getResultUrl().getUrl()); - Assertions.assertEquals("lmwlxkvugfhzo", model.getOutputArtifacts().getResultUrl().getFileId()); - Assertions.assertEquals("wjvzunluthnn", model.getOutputArtifacts().getResultUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getResultUrl().getFileType()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-10-10T00:35:03Z"), - model.getOutputArtifacts().getResultUrl().getExpireTime()); - Assertions.assertEquals("eilpjzuaejxdu", model.getOutputArtifacts().getResultUrl().getValidationStatus()); - Assertions.assertEquals("kzbbtd", model.getOutputArtifacts().getLogsUrl().getUrl()); - Assertions.assertEquals("mv", model.getOutputArtifacts().getLogsUrl().getFileId()); - Assertions.assertEquals("kgpwoz", model.getOutputArtifacts().getLogsUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getLogsUrl().getFileType()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-08-14T18:03:09Z"), model.getOutputArtifacts().getLogsUrl().getExpireTime()); - Assertions.assertEquals("sjyofdx", model.getOutputArtifacts().getLogsUrl().getValidationStatus()); - } - - @Test - public void testSerialize() { - InputTestArtifacts inputTestArtifacts = new InputTestArtifacts() - .setTestScriptUrl(new FileUrl() - .setUrl("ahcvkozczsvxe")); - TestArtifacts model = - new TestArtifacts(inputTestArtifacts) - .setOutputArtifacts( - new OutputTestArtifacts() - .setResultUrl( - new FileUrl() - .setUrl("zhpvgqzcjrvxd") - .setFileId("lmwlxkvugfhzo") - .setFilename("wjvzunluthnn") - .setFileType(FileType.ZERO) - .setExpireTime(OffsetDateTime.parse("2021-10-10T00:35:03Z")) - .setValidationStatus("eilpjzuaejxdu")) - .setLogsUrl( - new FileUrl() - .setUrl("kzbbtd") - .setFileId("mv") - .setFilename("kgpwoz") - .setFileType(FileType.ZERO) - .setExpireTime(OffsetDateTime.parse("2021-08-14T18:03:09Z")) - .setValidationStatus("sjyofdx"))); - model = BinaryData.fromObject(model).toObject(TestArtifacts.class); - Assertions.assertEquals("zhpvgqzcjrvxd", model.getOutputArtifacts().getResultUrl().getUrl()); - Assertions.assertEquals("lmwlxkvugfhzo", model.getOutputArtifacts().getResultUrl().getFileId()); - Assertions.assertEquals("wjvzunluthnn", model.getOutputArtifacts().getResultUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getResultUrl().getFileType()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-10-10T00:35:03Z"), - model.getOutputArtifacts().getResultUrl().getExpireTime()); - Assertions.assertEquals("eilpjzuaejxdu", model.getOutputArtifacts().getResultUrl().getValidationStatus()); - Assertions.assertEquals("kzbbtd", model.getOutputArtifacts().getLogsUrl().getUrl()); - Assertions.assertEquals("mv", model.getOutputArtifacts().getLogsUrl().getFileId()); - Assertions.assertEquals("kgpwoz", model.getOutputArtifacts().getLogsUrl().getFilename()); - Assertions.assertEquals(FileType.ZERO, model.getOutputArtifacts().getLogsUrl().getFileType()); - Assertions.assertEquals( - OffsetDateTime.parse("2021-08-14T18:03:09Z"), model.getOutputArtifacts().getLogsUrl().getExpireTime()); - Assertions.assertEquals("sjyofdx", model.getOutputArtifacts().getLogsUrl().getValidationStatus()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java deleted file mode 100644 index 9c87867dd1c37..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelResourceListTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; -import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; -import com.azure.developer.loadtesting.implementation.models.TestModel; -import com.azure.developer.loadtesting.implementation.models.TestModelResourceList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TestModelResourceListTests { - @Test - public void testDeserialize() { - TestModelResourceList model = - BinaryData.fromString( - "{\"value\":[{\"testId\":\"jky\",\"description\":\"j\",\"displayName\":\"ujqgidok\",\"resourceId\":\"ljyoxgvcltb\",\"loadTestConfig\":{\"engineInstances\":142984166,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{}},\"createdDateTime\":\"2021-05-08T06:07:04Z\",\"createdBy\":\"hbijhtxfvgxb\",\"lastModifiedDateTime\":\"2021-01-10T16:47:02Z\",\"lastModifiedBy\":\"nehmpvecx\",\"inputArtifacts\":{\"additionalUrls\":[]},\"secrets\":{},\"environmentVariables\":{\"lzlfbxzpuz\":\"mpukgriw\",\"yydhibnuqqk\":\"cispnqzahmgkbr\",\"drgvtqagn\":\"ik\"},\"subnetId\":\"ynhijggme\",\"keyvaultReferenceIdentityType\":\"siarbutrcvpn\",\"keyvaultReferenceIdentityId\":\"zmhjrunmp\"},{\"testId\":\"tdbhrbnla\",\"description\":\"xmyskp\",\"displayName\":\"enbtkcxywny\",\"resourceId\":\"rsyn\",\"loadTestConfig\":{\"engineInstances\":1149857481,\"splitAllCSVs\":false},\"passFailCriteria\":{\"passFailMetrics\":{}},\"createdDateTime\":\"2021-05-31T03:16:56Z\",\"createdBy\":\"clha\",\"lastModifiedDateTime\":\"2021-03-19T01:34:05Z\",\"lastModifiedBy\":\"abphlw\",\"inputArtifacts\":{\"additionalUrls\":[]},\"secrets\":{},\"environmentVariables\":{\"twwrqp\":\"cocmnyyaztt\"},\"subnetId\":\"dckzywbiexz\",\"keyvaultReferenceIdentityType\":\"yueaxibxujwb\",\"keyvaultReferenceIdentityId\":\"walm\"}],\"nextLink\":\"yoxa\"}") - .toObject(TestModelResourceList.class); - Assertions.assertEquals("j", model.getValue().get(0).getDescription()); - Assertions.assertEquals("ujqgidok", model.getValue().get(0).getDisplayName()); - Assertions.assertEquals(142984166, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals("mpukgriw", model.getValue().get(0).getEnvironmentVariables().get("lzlfbxzpuz")); - Assertions.assertEquals("ynhijggme", model.getValue().get(0).getSubnetId()); - Assertions.assertEquals("siarbutrcvpn", model.getValue().get(0).getKeyvaultReferenceIdentityType()); - Assertions.assertEquals("zmhjrunmp", model.getValue().get(0).getKeyvaultReferenceIdentityId()); - Assertions.assertEquals("yoxa", model.getNextLink()); - } - - @Test - public void testSerialize() { - TestModelResourceList model = - new TestModelResourceList( - Arrays.asList( - new TestModel() - .setDescription("j") - .setDisplayName("ujqgidok") - .setLoadTestConfig( - new LoadTestConfig() - .setEngineInstances(142984166) - .setSplitAllCSVs(true)) - .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) - .setSecrets(mapOf()) - .setEnvironmentVariables( - mapOf( - "lzlfbxzpuz", - "mpukgriw", - "yydhibnuqqk", - "cispnqzahmgkbr", - "drgvtqagn", - "ik")) - .setSubnetId("ynhijggme") - .setKeyvaultReferenceIdentityType("siarbutrcvpn") - .setKeyvaultReferenceIdentityId("zmhjrunmp"), - new TestModel() - .setDescription("xmyskp") - .setDisplayName("enbtkcxywny") - .setLoadTestConfig( - new LoadTestConfig() - .setEngineInstances(1149857481) - .setSplitAllCSVs(false)) - .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) - .setSecrets(mapOf()) - .setEnvironmentVariables(mapOf("twwrqp", "cocmnyyaztt")) - .setSubnetId("dckzywbiexz") - .setKeyvaultReferenceIdentityType("yueaxibxujwb") - .setKeyvaultReferenceIdentityId("walm"))) - .setNextLink("yoxa"); - model = BinaryData.fromObject(model).toObject(TestModelResourceList.class); - Assertions.assertEquals("j", model.getValue().get(0).getDescription()); - Assertions.assertEquals("ujqgidok", model.getValue().get(0).getDisplayName()); - Assertions.assertEquals(142984166, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals("mpukgriw", model.getValue().get(0).getEnvironmentVariables().get("lzlfbxzpuz")); - Assertions.assertEquals("ynhijggme", model.getValue().get(0).getSubnetId()); - Assertions.assertEquals("siarbutrcvpn", model.getValue().get(0).getKeyvaultReferenceIdentityType()); - Assertions.assertEquals("zmhjrunmp", model.getValue().get(0).getKeyvaultReferenceIdentityId()); - Assertions.assertEquals("yoxa", model.getNextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java deleted file mode 100644 index 9d493e68d79bb..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestModelTests.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; -import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; -import com.azure.developer.loadtesting.implementation.models.PassFailMetric; -import com.azure.developer.loadtesting.implementation.models.SecretMetadata; -import com.azure.developer.loadtesting.implementation.models.TestModel; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TestModelTests { - @Test - public void testDeserialize() { - TestModel model = - BinaryData.fromString( - "{\"testId\":\"rjb\",\"description\":\"orcjxvsnby\",\"displayName\":\"abnmocpcyshu\",\"resourceId\":\"afbljjgpbtoqcjmk\",\"loadTestConfig\":{\"engineInstances\":1217713745,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"a\":{\"clientmetric\":\"ajzyul\",\"aggregate\":\"u\",\"condition\":\"krlkhbzhfepg\",\"requestName\":\"qex\",\"value\":89.07795853703163,\"action\":\"scpai\",\"actualValue\":96.80537182363567,\"result\":\"csglum\"},\"jctbza\":{\"clientmetric\":\"j\",\"aggregate\":\"dxob\",\"condition\":\"dxkqpx\",\"requestName\":\"ajionpimexgstxg\",\"value\":84.68225914560935,\"action\":\"maajrmvdjwzrlo\",\"actualValue\":82.8178687573143,\"result\":\"hijco\"},\"twnpzaoqvuhrhcf\":{\"clientmetric\":\"qsycbkbfkgu\",\"aggregate\":\"kexxppof\",\"condition\":\"axcfjpgddtocjjx\",\"requestName\":\"pmouexhdz\",\"value\":17.190158222585094,\"action\":\"ojnxqbzvdd\",\"actualValue\":65.08808611819813,\"result\":\"eic\"},\"u\":{\"clientmetric\":\"yd\",\"aggregate\":\"lmjthjq\",\"condition\":\"pyeicxm\",\"requestName\":\"iwqvhkh\",\"value\":80.65130941539171,\"action\":\"dtopbob\",\"actualValue\":47.51092361661414,\"result\":\"e\"}}},\"createdDateTime\":\"2021-01-02T08:53:50Z\",\"createdBy\":\"hrzayvvtpgvdf\",\"lastModifiedDateTime\":\"2021-06-28T04:08:22Z\",\"lastModifiedBy\":\"kftutqxlngxlefg\",\"inputArtifacts\":{\"configUrl\":{\"url\":\"krxd\",\"fileId\":\"i\",\"filename\":\"thz\",\"fileType\":1,\"expireTime\":\"2021-06-26T08:11:35Z\",\"validationStatus\":\"bhj\"},\"testScriptUrl\":{\"url\":\"gehoqfbowskany\",\"fileId\":\"zlcuiywgqywgndrv\",\"filename\":\"hzgpphrcgyncocpe\",\"fileType\":2,\"expireTime\":\"2021-01-02T02:31:32Z\",\"validationStatus\":\"oo\"},\"userPropUrl\":{\"url\":\"lzevgbmqjqab\",\"fileId\":\"pmivkwlzu\",\"filename\":\"c\",\"fileType\":0,\"expireTime\":\"2021-12-03T01:38:31Z\",\"validationStatus\":\"acfi\"},\"inputArtifactsZipFileurl\":{\"url\":\"ebxetqgtzxdp\",\"fileId\":\"bqqwxrj\",\"filename\":\"al\",\"fileType\":1,\"expireTime\":\"2021-10-10T11:55:48Z\",\"validationStatus\":\"isnjampmngnz\"},\"additionalUrls\":[{\"url\":\"qwoochcbon\",\"fileId\":\"pkvlrxn\",\"filename\":\"ase\",\"fileType\":1,\"expireTime\":\"2021-04-09T12:47:30Z\",\"validationStatus\":\"lokeyy\"},{\"url\":\"nj\",\"fileId\":\"lwtgrhpdj\",\"filename\":\"umasxazjpq\",\"fileType\":0,\"expireTime\":\"2021-07-21T23:14:20Z\",\"validationStatus\":\"hb\"},{\"url\":\"hejjz\",\"fileId\":\"dudgwdslfhot\",\"filename\":\"cynpwlbjnp\",\"fileType\":1,\"expireTime\":\"2021-04-17T12:51:37Z\",\"validationStatus\":\"dehxnltyfsoppu\"},{\"url\":\"esnzwde\",\"fileId\":\"avo\",\"filename\":\"zdmohctbqvu\",\"fileType\":0,\"expireTime\":\"2021-10-27T15:38:07Z\",\"validationStatus\":\"nvowgujju\"}]},\"secrets\":{\"e\":{\"value\":\"cglhslazjdyggdt\",\"type\":\"xhbkuofq\"},\"tynnaamdectehfi\":{\"value\":\"hmenevfyexfwhybc\",\"type\":\"vyvdcs\"}},\"environmentVariables\":{\"hezrkgq\":\"jeyp\"},\"subnetId\":\"jrefovgmkqsle\",\"keyvaultReferenceIdentityType\":\"vxyqjpkcattpngjc\",\"keyvaultReferenceIdentityId\":\"czsqpjhvm\"}") - .toObject(TestModel.class); - Assertions.assertEquals("orcjxvsnby", model.getDescription()); - Assertions.assertEquals("abnmocpcyshu", model.getDisplayName()); - Assertions.assertEquals(1217713745, model.getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals("ajzyul", model.getPassFailCriteria().getPassFailMetrics().get("a").getClientmetric()); - Assertions.assertEquals("u", model.getPassFailCriteria().getPassFailMetrics().get("a").getAggregate()); - Assertions.assertEquals( - "krlkhbzhfepg", model.getPassFailCriteria().getPassFailMetrics().get("a").getCondition()); - Assertions.assertEquals("qex", model.getPassFailCriteria().getPassFailMetrics().get("a").getRequestName()); - Assertions.assertEquals( - 89.07795853703163D, model.getPassFailCriteria().getPassFailMetrics().get("a").getValue()); - Assertions.assertEquals("scpai", model.getPassFailCriteria().getPassFailMetrics().get("a").getAction()); - Assertions.assertEquals("cglhslazjdyggdt", model.getSecrets().get("e").getValue()); - Assertions.assertEquals("xhbkuofq", model.getSecrets().get("e").getType()); - Assertions.assertEquals("jeyp", model.getEnvironmentVariables().get("hezrkgq")); - Assertions.assertEquals("jrefovgmkqsle", model.getSubnetId()); - Assertions.assertEquals("vxyqjpkcattpngjc", model.getKeyvaultReferenceIdentityType()); - Assertions.assertEquals("czsqpjhvm", model.getKeyvaultReferenceIdentityId()); - } - - @Test - public void testSerialize() { - TestModel model = - new TestModel() - .setDescription("orcjxvsnby") - .setDisplayName("abnmocpcyshu") - .setLoadTestConfig(new LoadTestConfig().setEngineInstances(1217713745).setSplitAllCSVs(true)) - .setPassFailCriteria( - new PassFailCriteria() - .setPassFailMetrics( - mapOf( - "a", - new PassFailMetric() - .setClientmetric("ajzyul") - .setAggregate("u") - .setCondition("krlkhbzhfepg") - .setRequestName("qex") - .setValue(89.07795853703163D) - .setAction("scpai"), - "jctbza", - new PassFailMetric() - .setClientmetric("j") - .setAggregate("dxob") - .setCondition("dxkqpx") - .setRequestName("ajionpimexgstxg") - .setValue(84.68225914560935D) - .setAction("maajrmvdjwzrlo"), - "twnpzaoqvuhrhcf", - new PassFailMetric() - .setClientmetric("qsycbkbfkgu") - .setAggregate("kexxppof") - .setCondition("axcfjpgddtocjjx") - .setRequestName("pmouexhdz") - .setValue(17.190158222585094D) - .setAction("ojnxqbzvdd"), - "u", - new PassFailMetric() - .setClientmetric("yd") - .setAggregate("lmjthjq") - .setCondition("pyeicxm") - .setRequestName("iwqvhkh") - .setValue(80.65130941539171D) - .setAction("dtopbob")))) - .setSecrets( - mapOf( - "e", - new SecretMetadata().setValue("cglhslazjdyggdt").setType("xhbkuofq"), - "tynnaamdectehfi", - new SecretMetadata().setValue("hmenevfyexfwhybc").setType("vyvdcs"))) - .setEnvironmentVariables(mapOf("hezrkgq", "jeyp")) - .setSubnetId("jrefovgmkqsle") - .setKeyvaultReferenceIdentityType("vxyqjpkcattpngjc") - .setKeyvaultReferenceIdentityId("czsqpjhvm"); - model = BinaryData.fromObject(model).toObject(TestModel.class); - Assertions.assertEquals("orcjxvsnby", model.getDescription()); - Assertions.assertEquals("abnmocpcyshu", model.getDisplayName()); - Assertions.assertEquals(1217713745, model.getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals("ajzyul", model.getPassFailCriteria().getPassFailMetrics().get("a").getClientmetric()); - Assertions.assertEquals("u", model.getPassFailCriteria().getPassFailMetrics().get("a").getAggregate()); - Assertions.assertEquals( - "krlkhbzhfepg", model.getPassFailCriteria().getPassFailMetrics().get("a").getCondition()); - Assertions.assertEquals("qex", model.getPassFailCriteria().getPassFailMetrics().get("a").getRequestName()); - Assertions.assertEquals( - 89.07795853703163D, model.getPassFailCriteria().getPassFailMetrics().get("a").getValue()); - Assertions.assertEquals("scpai", model.getPassFailCriteria().getPassFailMetrics().get("a").getAction()); - Assertions.assertEquals("cglhslazjdyggdt", model.getSecrets().get("e").getValue()); - Assertions.assertEquals("xhbkuofq", model.getSecrets().get("e").getType()); - Assertions.assertEquals("jeyp", model.getEnvironmentVariables().get("hezrkgq")); - Assertions.assertEquals("jrefovgmkqsle", model.getSubnetId()); - Assertions.assertEquals("vxyqjpkcattpngjc", model.getKeyvaultReferenceIdentityType()); - Assertions.assertEquals("czsqpjhvm", model.getKeyvaultReferenceIdentityId()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java deleted file mode 100644 index 8d3495662a00f..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelResourceListTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; -import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; -import com.azure.developer.loadtesting.implementation.models.TestRunModel; -import com.azure.developer.loadtesting.implementation.models.TestRunModelResourceList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TestRunModelResourceListTests { - @Test - public void testDeserialize() { - TestRunModelResourceList model = - BinaryData.fromString( - "{\"value\":[{\"testRunId\":\"t\",\"displayName\":\"ellwptfdy\",\"testId\":\"fqbuaceopzf\",\"resourceId\":\"hhuao\",\"description\":\"pcqeqx\",\"status\":\"z\",\"startDateTime\":\"2021-01-30T20:29:46Z\",\"endDateTime\":\"2021-04-25T14:15:21Z\",\"loadTestConfig\":{\"engineInstances\":792773086,\"splitAllCSVs\":true},\"testResult\":\"kdmoi\",\"passFailCriteria\":{\"passFailMetrics\":{}},\"testArtifacts\":{\"inputArtifacts\":{}},\"executedDateTime\":\"2021-02-03T18:27:02Z\",\"vusers\":919813735,\"testRunStatistics\":{},\"createdDateTime\":\"2021-06-18T12:29:32Z\",\"createdBy\":\"mfqjhhkxbp\",\"lastModifiedDateTime\":\"2021-06-05T07:23:31Z\",\"lastModifiedBy\":\"jhxxjyn\",\"portalUrl\":\"divkrt\",\"secrets\":{},\"environmentVariables\":{\"auvjfdxxivet\":\"zvszj\",\"qaqtdoqmcbxvwvxy\":\"t\"},\"duration\":196734015305662676,\"subnetId\":\"sfxobl\"},{\"testRunId\":\"k\",\"displayName\":\"mpew\",\"testId\":\"fbkrvrnsvs\",\"resourceId\":\"johxcrsb\",\"description\":\"vasrruvwb\",\"status\":\"qfsubcgjbirx\",\"startDateTime\":\"2021-09-14T01:07:05Z\",\"endDateTime\":\"2021-06-28T04:15:27Z\",\"loadTestConfig\":{\"engineInstances\":716024879,\"splitAllCSVs\":true},\"testResult\":\"twss\",\"passFailCriteria\":{\"passFailMetrics\":{}},\"executedDateTime\":\"2021-01-31T07:10:37Z\",\"vusers\":1235013026,\"testRunStatistics\":{},\"createdDateTime\":\"2021-06-04T04:06:28Z\",\"createdBy\":\"znfqqnvwpmqtar\",\"lastModifiedDateTime\":\"2021-08-18T10:48:38Z\",\"lastModifiedBy\":\"mkcjhwqytjrybn\",\"portalUrl\":\"ewgdrjervn\",\"secrets\":{},\"environmentVariables\":{\"ndoygmifthnzdnd\":\"eh\",\"nayqi\":\"l\",\"hqlkthumaqo\":\"ynduha\"},\"duration\":5649591766559477880,\"subnetId\":\"duiertgcc\"}],\"nextLink\":\"vaolpsslqlf\"}") - .toObject(TestRunModelResourceList.class); - Assertions.assertEquals("ellwptfdy", model.getValue().get(0).getDisplayName()); - Assertions.assertEquals("fqbuaceopzf", model.getValue().get(0).getTestId()); - Assertions.assertEquals("pcqeqx", model.getValue().get(0).getDescription()); - Assertions.assertEquals(792773086, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals("zvszj", model.getValue().get(0).getEnvironmentVariables().get("auvjfdxxivet")); - Assertions.assertEquals("vaolpsslqlf", model.getNextLink()); - } - - @Test - public void testSerialize() { - TestRunModelResourceList model = - new TestRunModelResourceList( - Arrays.asList( - new TestRunModel() - .setDisplayName("ellwptfdy") - .setTestId("fqbuaceopzf") - .setDescription("pcqeqx") - .setLoadTestConfig( - new LoadTestConfig() - .setEngineInstances(792773086) - .setSplitAllCSVs(true)) - .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) - .setSecrets(mapOf()) - .setEnvironmentVariables( - mapOf("auvjfdxxivet", "zvszj", "qaqtdoqmcbxvwvxy", "t")), - new TestRunModel() - .setDisplayName("mpew") - .setTestId("fbkrvrnsvs") - .setDescription("vasrruvwb") - .setLoadTestConfig( - new LoadTestConfig() - .setEngineInstances(716024879) - .setSplitAllCSVs(true)) - .setPassFailCriteria(new PassFailCriteria().setPassFailMetrics(mapOf())) - .setSecrets(mapOf()) - .setEnvironmentVariables( - mapOf( - "ndoygmifthnzdnd", - "eh", - "nayqi", - "l", - "hqlkthumaqo", - "ynduha")))) - .setNextLink("vaolpsslqlf"); - model = BinaryData.fromObject(model).toObject(TestRunModelResourceList.class); - Assertions.assertEquals("ellwptfdy", model.getValue().get(0).getDisplayName()); - Assertions.assertEquals("fqbuaceopzf", model.getValue().get(0).getTestId()); - Assertions.assertEquals("pcqeqx", model.getValue().get(0).getDescription()); - Assertions.assertEquals(792773086, model.getValue().get(0).getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getValue().get(0).getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals("zvszj", model.getValue().get(0).getEnvironmentVariables().get("auvjfdxxivet")); - Assertions.assertEquals("vaolpsslqlf", model.getNextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java deleted file mode 100644 index e859d5982eb27..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunModelTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.LoadTestConfig; -import com.azure.developer.loadtesting.implementation.models.PassFailCriteria; -import com.azure.developer.loadtesting.implementation.models.PassFailMetric; -import com.azure.developer.loadtesting.implementation.models.SecretMetadata; -import com.azure.developer.loadtesting.implementation.models.TestRunModel; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TestRunModelTests { - @Test - public void testDeserialize() { - TestRunModel model = - BinaryData.fromString( - "{\"testRunId\":\"vlopwiyighx\",\"displayName\":\"dwzbaiue\",\"testId\":\"a\",\"resourceId\":\"nyqupedeojnabck\",\"description\":\"mtxpsiebtfh\",\"status\":\"esap\",\"startDateTime\":\"2021-05-25T03:50:38Z\",\"endDateTime\":\"2021-03-26T13:00:09Z\",\"loadTestConfig\":{\"engineInstances\":1631031599,\"splitAllCSVs\":true},\"testResult\":\"tldwkyzxuutk\",\"passFailCriteria\":{\"passFailMetrics\":{\"rmclfplphoxu\":{\"clientmetric\":\"wsvlxotogtwrupqs\",\"aggregate\":\"nmic\",\"condition\":\"vce\",\"requestName\":\"eil\",\"value\":81.31352089914428,\"action\":\"yfjfcnjbkcn\",\"actualValue\":52.227107002027154,\"result\":\"tkphywpnvjtoqn\"},\"xv\":{\"clientmetric\":\"rpabg\",\"aggregate\":\"psbjta\",\"condition\":\"ugxywpmueef\",\"requestName\":\"wfqkquj\",\"value\":76.74346068047178,\"action\":\"onobglaocqx\",\"actualValue\":36.81238428159163,\"result\":\"yudxytlmoy\"}}},\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[]},\"outputArtifacts\":{}},\"executedDateTime\":\"2021-09-30T16:20:35Z\",\"vusers\":530279974,\"testRunStatistics\":{\"eyvjusrtslhspkde\":{\"transaction\":\"bh\",\"sampleCount\":24.63655374283943,\"errorCount\":35.474444145006714,\"errorPct\":84.46088624890977,\"meanResTime\":75.27719677489182,\"medianResTime\":86.14609996604706,\"maxResTime\":5.129382907574698,\"minResTime\":63.799086243272086,\"pct1ResTime\":79.1315828701544,\"pct2ResTime\":54.01100397264773,\"pct3ResTime\":3.1162134970906474,\"throughput\":35.262769789138474,\"receivedKBytesPerSec\":88.79184990376532,\"sentKBytesPerSec\":39.313377855702626}},\"createdDateTime\":\"2021-01-28T17:00:30Z\",\"createdBy\":\"fm\",\"lastModifiedDateTime\":\"2021-03-28T14:27:10Z\",\"lastModifiedBy\":\"vt\",\"portalUrl\":\"lmqkrhahvlj\",\"secrets\":{\"adm\":{\"value\":\"quhcdhmduala\",\"type\":\"qpv\"},\"fmisg\":{\"value\":\"rcrgvx\",\"type\":\"gomz\"}},\"environmentVariables\":{\"e\":\"b\",\"urqhaka\":\"dawkzbali\"},\"duration\":142732787655569529,\"subnetId\":\"sfwxosowzxc\"}") - .toObject(TestRunModel.class); - Assertions.assertEquals("dwzbaiue", model.getDisplayName()); - Assertions.assertEquals("a", model.getTestId()); - Assertions.assertEquals("mtxpsiebtfh", model.getDescription()); - Assertions.assertEquals(1631031599, model.getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals( - "wsvlxotogtwrupqs", - model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getClientmetric()); - Assertions.assertEquals( - "nmic", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAggregate()); - Assertions.assertEquals( - "vce", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getCondition()); - Assertions.assertEquals( - "eil", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getRequestName()); - Assertions.assertEquals( - 81.31352089914428D, model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getValue()); - Assertions.assertEquals( - "yfjfcnjbkcn", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAction()); - Assertions.assertEquals("quhcdhmduala", model.getSecrets().get("adm").getValue()); - Assertions.assertEquals("qpv", model.getSecrets().get("adm").getType()); - Assertions.assertEquals("b", model.getEnvironmentVariables().get("e")); - } - - @Test - public void testSerialize() { - TestRunModel model = - new TestRunModel() - .setDisplayName("dwzbaiue") - .setTestId("a") - .setDescription("mtxpsiebtfh") - .setLoadTestConfig(new LoadTestConfig().setEngineInstances(1631031599).setSplitAllCSVs(true)) - .setPassFailCriteria( - new PassFailCriteria() - .setPassFailMetrics( - mapOf( - "rmclfplphoxu", - new PassFailMetric() - .setClientmetric("wsvlxotogtwrupqs") - .setAggregate("nmic") - .setCondition("vce") - .setRequestName("eil") - .setValue(81.31352089914428D) - .setAction("yfjfcnjbkcn"), - "xv", - new PassFailMetric() - .setClientmetric("rpabg") - .setAggregate("psbjta") - .setCondition("ugxywpmueef") - .setRequestName("wfqkquj") - .setValue(76.74346068047178D) - .setAction("onobglaocqx")))) - .setSecrets( - mapOf( - "adm", - new SecretMetadata().setValue("quhcdhmduala").setType("qpv"), - "fmisg", - new SecretMetadata().setValue("rcrgvx").setType("gomz"))) - .setEnvironmentVariables(mapOf("e", "b", "urqhaka", "dawkzbali")); - model = BinaryData.fromObject(model).toObject(TestRunModel.class); - Assertions.assertEquals("dwzbaiue", model.getDisplayName()); - Assertions.assertEquals("a", model.getTestId()); - Assertions.assertEquals("mtxpsiebtfh", model.getDescription()); - Assertions.assertEquals(1631031599, model.getLoadTestConfig().getEngineInstances()); - Assertions.assertEquals(true, model.getLoadTestConfig().isSplitAllCSVs()); - Assertions.assertEquals( - "wsvlxotogtwrupqs", - model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getClientmetric()); - Assertions.assertEquals( - "nmic", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAggregate()); - Assertions.assertEquals( - "vce", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getCondition()); - Assertions.assertEquals( - "eil", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getRequestName()); - Assertions.assertEquals( - 81.31352089914428D, model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getValue()); - Assertions.assertEquals( - "yfjfcnjbkcn", model.getPassFailCriteria().getPassFailMetrics().get("rmclfplphoxu").getAction()); - Assertions.assertEquals("quhcdhmduala", model.getSecrets().get("adm").getValue()); - Assertions.assertEquals("qpv", model.getSecrets().get("adm").getType()); - Assertions.assertEquals("b", model.getEnvironmentVariables().get("e")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java deleted file mode 100644 index d2f8948177c12..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TestRunStatisticsModelTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.TestRunStatisticsModel; -import org.junit.jupiter.api.Test; - -public final class TestRunStatisticsModelTests { - @Test - public void testDeserialize() { - TestRunStatisticsModel model = - BinaryData.fromString( - "{\"transaction\":\"hpigv\",\"sampleCount\":96.56638831709824,\"errorCount\":47.73901870768239,\"errorPct\":34.06246241376222,\"meanResTime\":64.27272756849982,\"medianResTime\":0.6725728926900598,\"maxResTime\":71.87981583778927,\"minResTime\":31.709384380932327,\"pct1ResTime\":17.348168143392495,\"pct2ResTime\":56.09490979241981,\"pct3ResTime\":15.560917310063903,\"throughput\":68.83488215598939,\"receivedKBytesPerSec\":51.04859450119774,\"sentKBytesPerSec\":66.88936945530081}") - .toObject(TestRunStatisticsModel.class); - } - - @Test - public void testSerialize() { - TestRunStatisticsModel model = new TestRunStatisticsModel(); - model = BinaryData.fromObject(model).toObject(TestRunStatisticsModel.class); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java deleted file mode 100644 index e1e24aa1aa048..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeRangeTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.TimeRange; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TimeRangeTests { - @Test - public void testDeserialize() { - TimeRange model = - BinaryData.fromString("{\"startTime\":\"2021-04-04T10:24:56Z\",\"endTime\":\"2020-12-21T19:48:14Z\"}") - .toObject(TimeRange.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T10:24:56Z"), model.getStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T19:48:14Z"), model.getEndTime()); - } - - @Test - public void testSerialize() { - TimeRange model = - new TimeRange() - .setStartTime(OffsetDateTime.parse("2021-04-04T10:24:56Z")) - .setEndTime(OffsetDateTime.parse("2020-12-21T19:48:14Z")); - model = BinaryData.fromObject(model).toObject(TimeRange.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T10:24:56Z"), model.getStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T19:48:14Z"), model.getEndTime()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java deleted file mode 100644 index 57fed852e618a..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/TimeSeriesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.models.TimeSeries; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TimeSeriesTests { - @Test - public void testDeserialize() { - TimeSeries model = - BinaryData.fromString("{\"timestamp\":\"2021-07-29T10:41:12Z\",\"value\":3.5167160326068148}") - .toObject(TimeSeries.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T10:41:12Z"), model.getTimestamp()); - Assertions.assertEquals(3.5167160326068148D, model.getValue()); - } - - @Test - public void testSerialize() { - TimeSeries model = - new TimeSeries() - .setTimestamp(OffsetDateTime.parse("2021-07-29T10:41:12Z")) - .setValue(3.5167160326068148D); - model = BinaryData.fromObject(model).toObject(TimeSeries.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T10:41:12Z"), model.getTimestamp()); - Assertions.assertEquals(3.5167160326068148D, model.getValue()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java deleted file mode 100644 index 2ea3e03e93e38..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadTestFileTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class UploadTestFileTests extends LoadTestClientTestBase { - @Test - @Disabled - public void testUploadTestFileTests() { - BinaryData file = BinaryData.fromString("\"multipart-form-data\""); - RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); - Response response = - testClient.uploadTestFileWithResponse( - "12345678-1234-1234-1234-123456789012", - "92345678-1234-1111-1234-123456789012", - file, - requestOptions); - Assertions.assertEquals(201, response.getStatusCode()); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index 699413a5a42ac..ad493e0f9800b 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -1,20 +1,20 @@ ## Generate autorest code ```yaml -require: https://github.com/Azure/azure-rest-api-specs/blob/9401446f22177696d920cf110893a0de7452ee9e/specification/loadtestservice/data-plane/readme.md +require: C:/Users/harshanb/source/repos/azure-rest-api-specs/specification/loadtestservice/data-plane/readme.md output-folder: ../ java: true regenerate-pom: false -title: LoadTestClient +title: LoadTestingClient security: AADToken security-scopes: https://loadtest.azure-dev.com/.default data-plane: true -generate-tests: true +generate-tests: false generate-models: true artifact-id: azure-developer-loadtesting -generate-samples: true +generate-samples: false namespace: com.azure.developer.loadtesting -partial-update: true +partial-update: false service-versions: - 2022-06-01-preview ``` From 32bc5cb3906025ef1bef65aeea1b551fe8ecfb35 Mon Sep 17 00:00:00 2001 From: Harshan B Date: Wed, 14 Sep 2022 17:21:24 +0530 Subject: [PATCH 04/18] Add multipart file upload Add troubleshooting and next steps in README Fix SDK path in CODEOWNERS --- .github/CODEOWNERS | 3 + .../azure-developer-loadtesting/README.md | 15 ++++- .../loadtesting/TestAsyncClient.java | 66 +++++++++++++++++++ .../developer/loadtesting/TestClient.java | 53 +++++++++++++++ .../implementation/util/MultipartHelper.java | 32 +++++++++ .../developer/loadtesting/ReadmeSamples.java | 5 +- .../swagger/README.md | 2 +- 7 files changed, 172 insertions(+), 4 deletions(-) create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0c5fde77d37f3..aa98bbff12bfe 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -89,6 +89,9 @@ # PRLabel: %azure-spring /sdk/cosmos/azure-spring-data-cosmos-test/ @kushagraThapar @mbhaskar @backwind1233 @chenrujun @hui1110 @netyyyy @saragluna @stliu @yiliuTo @xinlian12 @moarychan +# PRLabel: %Load Testing +/sdk/loadtestservice @Harshan01 @abranj1219 + # ServiceLabel: %Device Update for IoT Hub %Service Attention /sdk/deviceupdate/ @dpokluda diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index d9238a83b093d..08e2f402c9727 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -135,7 +135,7 @@ TestClient testClient = testClientBuilder .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); -BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", fileData, null).getValue(); +BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null).getValue(); System.out.println(fileUrlOut.toString()); ``` @@ -162,6 +162,17 @@ BinaryData testRunOut = testRunClient.createAndUpdateTestWithResponse("testrun12 System.out.println(testRunOut.toString()); ``` +## Troubleshooting + +Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite +their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help +locate the root issue. View the [logging][logging] wiki for guidance about enabling logging. + +## Next steps + +Azure Loading Testing Java SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered. +See [Azure Load Testing samples][sample_code]. + ## Contributing For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). @@ -174,9 +185,11 @@ For details on contributing to this repository, see the [contributing guide](htt [source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src +[sample_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples [api_reference_doc]: https://docs.microsoft.com/rest/api/loadtesting/ [product_documentation]: https://azure.microsoft.com/services/load-testing/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java index 57c76c8e47cd4..3850f0e8678b6 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java @@ -4,6 +4,9 @@ package com.azure.developer.loadtesting; +import java.io.IOException; +import java.util.Random; + import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -17,11 +20,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.developer.loadtesting.implementation.TestsImpl; +import com.azure.developer.loadtesting.implementation.util.MultipartHelper; + import reactor.core.publisher.Mono; /** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = TestClientBuilder.class, isAsync = true) public final class TestAsyncClient { + private static final Random RANDOM = new Random(); + @Generated private final TestsImpl serviceClient; /** @@ -420,6 +427,65 @@ public Mono> uploadTestFileWithResponse( return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions); } + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileName Name of test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws IOException thrown if the multipart/form-data body cannot be constructed from file. + * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadTestFileWithResponse( + String testId, String fileId, String fileName, BinaryData file, RequestOptions requestOptions) throws IOException { + String boundary = MultipartHelper.getMultipartBoundary(String.format("%6x", RANDOM.nextInt(0x1000000))); + if (requestOptions == null) { + requestOptions = new RequestOptions(); + } + requestOptions.setHeader("Content-Type", "multipart/form-data;boundary=" + boundary); + + BinaryData multipartBody = MultipartHelper.createMultipartBodyFromFile(fileName, file, boundary); + + return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, multipartBody, requestOptions); + } + /** * Get test file by the file name. * diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java index 1c22d4bdf0322..263e7dc650cdf 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java @@ -4,6 +4,8 @@ package com.azure.developer.loadtesting; +import java.io.IOException; + import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -418,6 +420,57 @@ public Response uploadTestFileWithResponse( return this.client.uploadTestFileWithResponse(testId, fileId, file, requestOptions).block(); } + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileName Name of test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws IOException thrown if the multipart/form-data body cannot be constructed from file. + * @return fileUrl Model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadTestFileWithResponse( + String testId, String fileId, String fileName, BinaryData file, RequestOptions requestOptions) throws IOException { + return this.client.uploadTestFileWithResponse(testId, fileId, fileName, file, requestOptions).block(); + } + /** * Get test file by the file name. * diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java new file mode 100644 index 0000000000000..0cd7b3c81f983 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.developer.loadtesting.implementation.util; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import com.azure.core.util.BinaryData; + +/** + * This class provides helper methods for constructing multipart/form-data body + */ +public final class MultipartHelper { + private static final char CR = (char) 0x0D; + private static final char LF = (char) 0x0A; + private static final String NEWLINE = "" + CR + LF; + + public static String getMultipartBoundary(String boundarySuffix) { + return "----WebkitFormBoundary" + boundarySuffix; + } + + public static BinaryData createMultipartBodyFromFile(String fileName, BinaryData file, String boundary) throws IOException { + ByteArrayOutputStream bodyByteStream = new ByteArrayOutputStream(); + bodyByteStream.write(("--" + boundary + NEWLINE).getBytes("UTF-8")); + bodyByteStream.write(("Content-Disposition: form-data; name=\"file\"; filename=\"" + fileName + "\"" + NEWLINE).getBytes("UTF-8")); + bodyByteStream.write(("Content-Type: application/octet-stream" + NEWLINE + NEWLINE).getBytes("UTF-8")); + bodyByteStream.write(file.toBytes()); + bodyByteStream.write((NEWLINE + NEWLINE + "--" + boundary + "--").getBytes("UTF-8")); + + return BinaryData.fromBytes(bodyByteStream.toByteArray()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java index fb55a1d6ede24..b690e096f9ff6 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -5,6 +5,7 @@ package com.azure.developer.loadtesting; import java.io.File; +import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -40,7 +41,7 @@ public void createTest() { // END: java-readme-sample-createTest } - public void uploadTestFile() { + public void uploadTestFile() throws IOException { // BEGIN: java-readme-sample-uploadTestFile TestClientBuilder testClientBuilder = new TestClientBuilder(); TestClient testClient = testClientBuilder @@ -49,7 +50,7 @@ public void uploadTestFile() { .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", fileData, null).getValue(); + BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null).getValue(); System.out.println(fileUrlOut.toString()); // END: java-readme-sample-uploadTestFile } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index ad493e0f9800b..fdceb2e8ab4dd 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -14,7 +14,7 @@ generate-models: true artifact-id: azure-developer-loadtesting generate-samples: false namespace: com.azure.developer.loadtesting -partial-update: false +partial-update: true service-versions: - 2022-06-01-preview ``` From 541937c6d0b1cf939222e679013cc696d178f4de Mon Sep 17 00:00:00 2001 From: Harshan B Date: Wed, 14 Sep 2022 20:16:44 +0530 Subject: [PATCH 05/18] Add test recordings and update README --- .../azure-developer-loadtesting/README.md | 2 +- .../loadtesting/AppComponentAsyncClient.java | 2 +- .../loadtesting/AppComponentClient.java | 2 +- .../AppComponentClientBuilder.java | 2 +- .../loadtesting/ServerMetricsAsyncClient.java | 2 +- .../loadtesting/ServerMetricsClient.java | 2 +- .../ServerMetricsClientBuilder.java | 2 +- .../loadtesting/TestAsyncClient.java | 13 +-- .../developer/loadtesting/TestClient.java | 8 +- .../loadtesting/TestClientBuilder.java | 2 +- .../loadtesting/TestRunAsyncClient.java | 2 +- .../developer/loadtesting/TestRunClient.java | 2 +- .../loadtesting/TestRunClientBuilder.java | 2 +- .../CreateAndUpdateTestRunTests.java | 23 ++++ .../loadtesting/CreateOrUpdateTestTests.java | 25 +++++ .../LoadTestingClientTestBase.java | 106 ++++++++++++++++++ .../loadtesting/UploadTestFileTests.java | 31 +++++ .../src/test/resources/sample-JMX-file.jmx | 86 ++++++++++++++ ...RunTests.simpleCreateAndUpdateTestRun.json | 27 +++++ ...ateTestTests.simpleCreateOrUpdateTest.json | 27 +++++ .../UploadTestFileTests.uploadTestFile.json | 28 +++++ .../swagger/README.md | 2 +- 22 files changed, 374 insertions(+), 24 deletions(-) create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index 08e2f402c9727..0d69f5dd89394 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -1,6 +1,6 @@ # Azure Developer LoadTesting client library for Java -Azure Developer LoadTesting client library for Java. +Azure Load Testing provides client library in Java to the user by which they can interact natively with Azure Load Testing service. Azure Load Testing is a fully managed load-testing service that enables you to generate high-scale load. The service simulates traffic for your applications, regardless of where they're hosted. Developers, testers, and quality assurance (QA) engineers can use it to optimize application performance, scalability, or capacity This package contains Microsoft Azure Developer LoadTesting client library. diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java index 9ae35056c496e..3d2b423bd5ff8 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -21,6 +20,7 @@ /** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = AppComponentClientBuilder.class, isAsync = true) public final class AppComponentAsyncClient { + @Generated private final AppComponentsImpl serviceClient; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java index 63f117ef057d3..aaae391e305e1 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -19,6 +18,7 @@ /** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = AppComponentClientBuilder.class) public final class AppComponentClient { + @Generated private final AppComponentAsyncClient client; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java index 9651ec85956b5..9e2743533f576 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -47,6 +46,7 @@ public final class AppComponentClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { + @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java index 2fc37f5dee5bf..cc626a08fb63d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -21,6 +20,7 @@ /** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = ServerMetricsClientBuilder.class, isAsync = true) public final class ServerMetricsAsyncClient { + @Generated private final ServerMetricsImpl serviceClient; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java index 96acb35ea14c5..9648981de9400 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -19,6 +18,7 @@ /** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = ServerMetricsClientBuilder.class) public final class ServerMetricsClient { + @Generated private final ServerMetricsAsyncClient client; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java index 040a3504ca649..c510580c2d90f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -47,6 +46,7 @@ public final class ServerMetricsClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { + @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java index 3850f0e8678b6..795b1667d6789 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java @@ -1,12 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; -import java.io.IOException; -import java.util.Random; - import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -21,12 +17,14 @@ import com.azure.core.util.BinaryData; import com.azure.developer.loadtesting.implementation.TestsImpl; import com.azure.developer.loadtesting.implementation.util.MultipartHelper; - +import java.io.IOException; +import java.util.Random; import reactor.core.publisher.Mono; /** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = TestClientBuilder.class, isAsync = true) public final class TestAsyncClient { + private static final Random RANDOM = new Random(); @Generated private final TestsImpl serviceClient; @@ -474,15 +472,14 @@ public Mono> uploadTestFileWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadTestFileWithResponse( - String testId, String fileId, String fileName, BinaryData file, RequestOptions requestOptions) throws IOException { + String testId, String fileId, String fileName, BinaryData file, RequestOptions requestOptions) + throws IOException { String boundary = MultipartHelper.getMultipartBoundary(String.format("%6x", RANDOM.nextInt(0x1000000))); if (requestOptions == null) { requestOptions = new RequestOptions(); } requestOptions.setHeader("Content-Type", "multipart/form-data;boundary=" + boundary); - BinaryData multipartBody = MultipartHelper.createMultipartBodyFromFile(fileName, file, boundary); - return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, multipartBody, requestOptions); } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java index 263e7dc650cdf..764720a6e4df4 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java @@ -1,11 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; -import java.io.IOException; - import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -18,10 +15,12 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import java.io.IOException; /** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = TestClientBuilder.class) public final class TestClient { + @Generated private final TestAsyncClient client; /** @@ -467,7 +466,8 @@ public Response uploadTestFileWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadTestFileWithResponse( - String testId, String fileId, String fileName, BinaryData file, RequestOptions requestOptions) throws IOException { + String testId, String fileId, String fileName, BinaryData file, RequestOptions requestOptions) + throws IOException { return this.client.uploadTestFileWithResponse(testId, fileId, fileName, file, requestOptions).block(); } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java index e0490abd23d28..ae2067e0d0e1f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -47,6 +46,7 @@ public final class TestClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { + @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java index aa5c4bde99ff4..3142f8d27c991 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -22,6 +21,7 @@ /** Initializes a new instance of the asynchronous LoadTestingClient type. */ @ServiceClient(builder = TestRunClientBuilder.class, isAsync = true) public final class TestRunAsyncClient { + @Generated private final TestRunsImpl serviceClient; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java index c4e84ebed2efc..20c361102ae4f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -20,6 +19,7 @@ /** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = TestRunClientBuilder.class) public final class TestRunClient { + @Generated private final TestRunAsyncClient client; /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java index 374962b3db98d..0e49beebb5355 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -47,6 +46,7 @@ public final class TestRunClientBuilder ConfigurationTrait, TokenCredentialTrait, EndpointTrait { + @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java new file mode 100644 index 0000000000000..aa2b4e0833263 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.developer.loadtesting; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class CreateAndUpdateTestRunTests extends LoadTestingClientTestBase { + private final String CREATE_TEST_RUN_BODY_JSON = "{\"testId\":\"" + DEFAULT_TEST_ID + "\"" + + ",\"description\":\"Sample Test Run\",\"displayName\":\"Java SDK Sample Test Run\"}"; + + @Test + public void simpleCreateAndUpdateTestRun() { + BinaryData file = BinaryData.fromString(CREATE_TEST_RUN_BODY_JSON); + RequestOptions requestOptions = new RequestOptions(); + Response response = testRunClient.createAndUpdateTestWithResponse(DEFAULT_TEST_RUN_ID, file, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java new file mode 100644 index 0000000000000..55b44bdcef3ec --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.developer.loadtesting; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateTestTests extends LoadTestingClientTestBase { + private final String CREATE_TEST_BODY_JSON = "{\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\"," + + "\"environmentVariables\":{\"threads_per_engine\":1,\"ramp_up_time\":0,\"duration_in_sec\":10,\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"}," + + "\"loadTestConfig\":{\"engineInstances\":1}}"; + + @Test + public void simpleCreateOrUpdateTest() { + BinaryData body = BinaryData.fromString(CREATE_TEST_BODY_JSON); + RequestOptions requestOptions = new RequestOptions(); + Response response = testClient.createOrUpdateTestWithResponse(DEFAULT_TEST_ID, body, requestOptions); + Assertions.assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java new file mode 100644 index 0000000000000..f497da866b18f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.developer.loadtesting; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class LoadTestingClientTestBase extends TestBase { + protected AppComponentClient appComponentClient; + + protected ServerMetricsClient serverMetricsClient; + + protected TestClient testClient; + + protected TestRunClient testRunClient; + + private final String DEFAULT_ENDPOINT = "REDACTED.eus.cnt-prod.loadtesting.azure.com"; + + protected final String DEFAULT_TEST_ID = "11111111-1234-1234-1234-123456789012"; + protected final String DEFAULT_FILE_ID = "22222222-1234-1234-1234-123456789012"; + protected final String DEFAULT_TEST_RUN_ID = "33333333-1234-1234-1234-123456789012"; + + @Override + protected void beforeTest() { + AppComponentClientBuilder appComponentClientbuilder = + new AppComponentClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + appComponentClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + appComponentClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + appComponentClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + appComponentClient = appComponentClientbuilder.buildClient(); + + ServerMetricsClientBuilder serverMetricsClientbuilder = + new ServerMetricsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + serverMetricsClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + serverMetricsClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + serverMetricsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + serverMetricsClient = serverMetricsClientbuilder.buildClient(); + + TestClientBuilder testClientbuilder = + new TestClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + testClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + testClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + testClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + testClient = testClientbuilder.buildClient(); + + TestRunClientBuilder testRunClientbuilder = + new TestRunClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + testRunClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + testRunClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + testRunClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + testRunClient = testRunClientbuilder.buildClient(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java new file mode 100644 index 0000000000000..d80be47c6355e --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.developer.loadtesting; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class UploadTestFileTests extends LoadTestingClientTestBase { + private final String FILE_JXM_NAME = "sample-JMX-file.jmx"; + private final URL FILE_JMX_URL = UploadTestFileTests.class.getClassLoader().getResource(FILE_JXM_NAME); + + @Test + public void uploadTestFile() throws IOException { + BinaryData file = BinaryData.fromFile(new File(FILE_JMX_URL.getPath()).toPath()); + RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); + Response response = testClient.uploadTestFileWithResponse( + DEFAULT_TEST_ID, + DEFAULT_FILE_ID, + FILE_JXM_NAME, + file, + requestOptions); + Assertions.assertEquals(201, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx new file mode 100644 index 0000000000000..52feae899c0d3 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx @@ -0,0 +1,86 @@ + + + + + + false + true + false + + + + + + + + + + threads_per_engine + ${__BeanShell( System.getenv("threads_per_engine") )} + = + + + ramp_up_time + ${__BeanShell( System.getenv("ramp_up_time") )} + = + + + duration_in_sec + ${__BeanShell( System.getenv("duration_in_sec") )} + = + + + domain + ${__BeanShell( System.getenv("domain") )} + = + + + protocol + ${__BeanShell( System.getenv("protocol") )} + = + + + path + ${__BeanShell( System.getenv("path") )} + = + + + + + + continue + + false + -1 + + ${threads_per_engine} + ${ramp_up_time} + true + ${duration_in_sec} + 5 + true + + + + + + + ${domain} + + ${protocol} + + ${path} + GET + true + false + true + false + + + + + + + + + diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json new file mode 100644 index 0000000000000..8908fd0ea59d7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/testruns/33333333-1234-1234-1234-123456789012?api-version=2022-06-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", + "x-ms-client-request-id" : "c446af66-2eb0-41f5-a482-1d2780688de6", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "content-length" : "2466", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", + "X-Content-Type-Options" : "nosniff", + "Connection" : "keep-alive", + "mise-correlation-id" : "e8217b5a-9818-43c0-9b7f-9da41019a9b7", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"ACCEPTED\",\"startDateTime\":null,\"endDateTime\":null,\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:57:59.8079697+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:57:59.8079697+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:57:59.8079697+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":null,\"logsUrl\":null}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":null,\"testRunStatistics\":null,\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2f7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":null,\"subnetId\":null,\"errorDetails\":null}", + "Date" : "Fri, 16 Sep 2022 12:47:59 GMT", + "x-ms-correlation-request-id" : "043f7468-76f5-445c-8d43-538a8e384395", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json new file mode 100644 index 0000000000000..99cfe21bca273 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012?api-version=2022-06-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", + "x-ms-client-request-id" : "3bb20e4d-ee76-46c4-afbc-1293c0a52796", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "content-length" : "1276", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", + "X-Content-Type-Options" : "nosniff", + "Connection" : "keep-alive", + "mise-correlation-id" : "3c9b321b-519b-46e0-acea-b6efe3f7b8e8", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:58:00.6497577+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", + "Date" : "Fri, 16 Sep 2022 12:48:00 GMT", + "x-ms-correlation-request-id" : "03128932-816a-4dd2-8ad2-052daf8f31f5", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json new file mode 100644 index 0000000000000..8fa8f88950dbe --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json @@ -0,0 +1,28 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012/files/22222222-1234-1234-1234-123456789012?api-version=2022-06-01-preview&fileType=2", + "Headers" : { + "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", + "x-ms-client-request-id" : "5388f4f0-9bb3-4230-966e-56a0b58b85b5", + "Content-Type" : "multipart/form-data;boundary=----WebkitFormBoundary2871a4" + }, + "Response" : { + "content-length" : "411", + "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", + "X-Content-Type-Options" : "nosniff", + "Connection" : "keep-alive", + "mise-correlation-id" : "b048adb5-cb74-46a1-930e-f76c2ce3985a", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Fri, 16 Sep 2022 12:48:02 GMT", + "x-ms-correlation-request-id" : "03060620-e08d-4a60-8560-d64b31931b85", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Body" : "{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:58:02.020837\",\"validationStatus\":\"VALIDATION_INITIATED\"}", + "Content-Type" : "application/json; charset=utf-8", + "Location" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012/files/22222222-1234-1234-1234-123456789012?resourceId=%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk&api-version=2022-06-01-preview" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index fdceb2e8ab4dd..d07161ef84252 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -1,7 +1,7 @@ ## Generate autorest code ```yaml -require: C:/Users/harshanb/source/repos/azure-rest-api-specs/specification/loadtestservice/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/9401446f22177696d920cf110893a0de7452ee9e/specification/loadtestservice/data-plane/readme.md output-folder: ../ java: true regenerate-pom: false From 70bffda157c10453d8b98a41ae83091c24b2793f Mon Sep 17 00:00:00 2001 From: Harshan B Date: Wed, 21 Sep 2022 18:45:26 +0530 Subject: [PATCH 06/18] Add LoadTesting and Administration clients With swagger directives and accessors --- .../azure-developer-loadtesting/README.md | 21 +- .../loadtesting/AppComponentAsyncClient.java | 205 - .../loadtesting/AppComponentClient.java | 201 - .../AppComponentClientBuilder.java | 296 -- ...=> LoadTestAdministrationAsyncClient.java} | 637 ++- ...java => LoadTestAdministrationClient.java} | 626 ++- ... LoadTestAdministrationClientBuilder.java} | 81 +- .../loadtesting/LoadTestingAsyncClient.java | 50 + .../loadtesting/LoadTestingClient.java | 49 + ...der.java => LoadTestingClientBuilder.java} | 108 +- .../LoadTestingServiceVersion.java | 1 - .../loadtesting/ServerMetricsAsyncClient.java | 282 -- .../loadtesting/ServerMetricsClient.java | 276 -- .../loadtesting/TestRunAsyncClient.java | 574 +-- .../developer/loadtesting/TestRunClient.java | 570 +-- .../loadtesting/TestRunClientBuilder.java | 20 +- .../implementation/AppComponentsImpl.java | 506 -- .../LoadTestAdministrationsImpl.java | 4083 +++++++++++++++++ .../implementation/LoadTestingClientImpl.java | 40 +- .../implementation/ServerMetricsImpl.java | 708 --- .../implementation/TestRunsImpl.java | 1176 ++++- .../loadtesting/implementation/TestsImpl.java | 1632 ------- .../implementation/models/AppComponent.java | 162 - .../models/AppComponentsMap.java | 125 - .../models/ClientMetricsFilters.java | 90 - .../models/ClientMetricsRequestModel.java | 176 - .../models/ClientMetricsResults.java | 64 - .../DefaultServerMetricsConfigListModel.java | 44 - .../DefaultServerMetricsConfigModel.java | 142 - .../implementation/models/Error.java | 117 - .../models/ErrorResponseBody.java | 38 - .../implementation/models/FileType.java | 41 - .../implementation/models/FileUrl.java | 171 - .../implementation/models/FileUrlList.java | 65 - .../implementation/models/Filters.java | 69 - .../models/InputTestArtifacts.java | 132 - .../implementation/models/LoadTestConfig.java | 67 - .../implementation/models/LocalizedName.java | 64 - .../models/OutputTestArtifacts.java | 64 - .../models/PassFailCriteria.java | 39 - .../implementation/models/PassFailMetric.java | 210 - ...estbodyContentMultipartFormDataSchema.java | 41 - .../models/ResourceMetricModel.java | 181 - .../implementation/models/SecretMetadata.java | 64 - .../implementation/models/Series.java | 118 - .../models/ServerMetricName.java | 57 - .../models/ServerMetricsModel.java | 109 - .../models/SupportedResourceType.java | 44 - .../implementation/models/TestArtifacts.java | 66 - .../implementation/models/TestModel.java | 363 -- .../models/TestModelResourceList.java | 65 - .../implementation/models/TestRunModel.java | 461 -- .../models/TestRunModelResourceList.java | 65 - .../models/TestRunStatisticsModel.java | 222 - .../implementation/models/TimeRange.java | 65 - .../implementation/models/TimeSeries.java | 65 - .../implementation/models/package-info.java | 9 - .../src/main/java/module-info.java | 8 - .../developer/loadtesting/ReadmeSamples.java | 22 +- .../CreateAndUpdateTestRunTests.java | 23 +- .../loadtesting/CreateOrUpdateTestTests.java | 34 +- .../LoadTestingClientTestBase.java | 74 +- .../loadtesting/UploadTestFileTests.java | 2 +- ...stRunTests.CreateAndUpdateTestRunDict.json | 27 + ...RunTests.CreateAndUpdateTestRunString.json | 27 + ...RunTests.simpleCreateAndUpdateTestRun.json | 27 - ...eTestTests.CreateOrUpdateTestDictDict.json | 27 + ...ateTestTests.CreateOrUpdateTestString.json | 27 + ...ateTestTests.simpleCreateOrUpdateTest.json | 27 - .../UploadTestFileTests.uploadTestFile.json | 14 +- .../swagger/README.md | 13 + 71 files changed, 7234 insertions(+), 9135 deletions(-) delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java rename sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/{TestAsyncClient.java => LoadTestAdministrationAsyncClient.java} (58%) rename sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/{TestClient.java => LoadTestAdministrationClient.java} (58%) rename sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/{ServerMetricsClientBuilder.java => LoadTestAdministrationClientBuilder.java} (74%) create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java rename sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/{TestClientBuilder.java => LoadTestingClientBuilder.java} (71%) delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json create mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index 0d69f5dd89394..5e74d9553cdc7 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -100,8 +100,7 @@ During a load test, Azure Load Testing collects metrics about the test execution ### Creating a Load Test ```java java-readme-sample-createTest -TestClientBuilder testClientBuilder = new TestClientBuilder(); -TestClient testClient = testClientBuilder +LoadTestingClient client = new LoadTestingClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("") .buildClient(); @@ -121,29 +120,27 @@ testMap.put("environmentVariables", envVarMap); BinaryData test = BinaryData.fromObject(testMap); -BinaryData testOut = testClient.createOrUpdateTestWithResponse("test12345", test, null).getValue(); -System.out.println(testOut.toString()); +Response testOutResponse = client.getAdministration().createOrUpdateTestWithResponse("test12345", test, null); +System.out.println(testOutResponse.getValue().toString()); ``` ### Uploading .jmx file to a Load Test ```java java-readme-sample-uploadTestFile -TestClientBuilder testClientBuilder = new TestClientBuilder(); -TestClient testClient = testClientBuilder +LoadTestingClient client = new LoadTestingClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("") .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); -BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null).getValue(); -System.out.println(fileUrlOut.toString()); +Response fileUrlOut = client.getAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); +System.out.println(fileUrlOut.getValue().toString()); ``` ### Running a Load Test ```java java-readme-sample-runTest -TestRunClientBuilder testRunClientBuilder = new TestRunClientBuilder(); -TestRunClient testRunClient = testRunClientBuilder +LoadTestingClient client = new LoadTestingClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("") .buildClient(); @@ -158,8 +155,8 @@ testRunMap.put("loadTestConfig", loadTestConfigMap); BinaryData testRun = BinaryData.fromObject(testRunMap); -BinaryData testRunOut = testRunClient.createAndUpdateTestWithResponse("testrun12345", testRun, null).getValue(); -System.out.println(testRunOut.toString()); +Response testRunOut = client.getTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); +System.out.println(testRunOut.getValue().toString()); ``` ## Troubleshooting diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java deleted file mode 100644 index 3d2b423bd5ff8..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.developer.loadtesting; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.AppComponentsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous LoadTestingClient type. */ -@ServiceClient(builder = AppComponentClientBuilder.class, isAsync = true) -public final class AppComponentAsyncClient { - - @Generated private final AppComponentsImpl serviceClient; - - /** - * Initializes an instance of AppComponentAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - AppComponentAsyncClient(AppComponentsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Associate an App Component (Azure resource) to a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param body App Component model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponse( - String name, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions); - } - - /** - * Delete an App Component. - * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.deleteAppComponentWithResponseAsync(name, requestOptions); - } - - /** - * Get App Component details by App Component name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Component details by App Component name along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentByNameWithResponseAsync(name, requestOptions); - } - - /** - * Get App Components for a test or a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test or a test run by its name along with {@link Response} on successful completion - * of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getAppComponentWithResponseAsync(requestOptions); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java deleted file mode 100644 index aaae391e305e1..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClient.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.developer.loadtesting; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous LoadTestingClient type. */ -@ServiceClient(builder = AppComponentClientBuilder.class) -public final class AppComponentClient { - - @Generated private final AppComponentAsyncClient client; - - /** - * Initializes an instance of AppComponentClient class. - * - * @param client the async client. - */ - @Generated - AppComponentClient(AppComponentAsyncClient client) { - this.client = client; - } - - /** - * Associate an App Component (Azure resource) to a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param body App Component model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse( - String name, BinaryData body, RequestOptions requestOptions) { - return this.client.createOrUpdateAppComponentsWithResponse(name, body, requestOptions).block(); - } - - /** - * Delete an App Component. - * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { - return this.client.deleteAppComponentWithResponse(name, requestOptions).block(); - } - - /** - * Get App Component details by App Component name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Component details by App Component name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { - return this.client.getAppComponentByNameWithResponse(name, requestOptions).block(); - } - - /** - * Get App Components for a test or a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test or a test run by its name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentWithResponse(RequestOptions requestOptions) { - return this.client.getAppComponentWithResponse(requestOptions).block(); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java deleted file mode 100644 index 9e2743533f576..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentClientBuilder.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.developer.loadtesting; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the AppComponentClient type. */ -@ServiceClientBuilder(serviceClients = {AppComponentClient.class, AppComponentAsyncClient.class}) -public final class AppComponentClientBuilder - implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - EndpointTrait { - - @Generated private static final String SDK_NAME = "name"; - - @Generated private static final String SDK_VERSION = "version"; - - @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; - - @Generated - private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - - @Generated private final List pipelinePolicies; - - /** Create an instance of the AppComponentClientBuilder. */ - @Generated - public AppComponentClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public AppComponentClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated private LoadTestingServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the AppComponentClientBuilder. - */ - @Generated - public AppComponentClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the AppComponentClientBuilder. - */ - @Generated - public AppComponentClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of LoadTestingClientImpl with the provided parameters. - * - * @return an instance of LoadTestingClientImpl. - */ - @Generated - private LoadTestingClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestingServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); - LoadTestingClientImpl client = - new LoadTestingClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } - if (clientOptions == null) { - clientOptions = new ClientOptions(); - } - List policies = new ArrayList<>(); - String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(clientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of AppComponentAsyncClient class. - * - * @return an instance of AppComponentAsyncClient. - */ - @Generated - public AppComponentAsyncClient buildAsyncClient() { - return new AppComponentAsyncClient(buildInnerClient().getAppComponents()); - } - - /** - * Builds an instance of AppComponentClient class. - * - * @return an instance of AppComponentClient. - */ - @Generated - public AppComponentClient buildClient() { - return new AppComponentClient(new AppComponentAsyncClient(buildInnerClient().getAppComponents())); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java similarity index 58% rename from sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java rename to sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index 795b1667d6789..66c51df6e14d3 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -3,6 +3,9 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.developer.loadtesting; +import java.io.IOException; +import java.util.Random; + import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -15,30 +18,446 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.TestsImpl; +import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; import com.azure.developer.loadtesting.implementation.util.MultipartHelper; -import java.io.IOException; -import java.util.Random; + import reactor.core.publisher.Mono; /** Initializes a new instance of the asynchronous LoadTestingClient type. */ -@ServiceClient(builder = TestClientBuilder.class, isAsync = true) -public final class TestAsyncClient { +@ServiceClient(builder = LoadTestAdministrationClientBuilder.class, isAsync = true) +public final class LoadTestAdministrationAsyncClient { private static final Random RANDOM = new Random(); - @Generated private final TestsImpl serviceClient; + @Generated private final LoadTestAdministrationsImpl serviceClient; /** - * Initializes an instance of TestAsyncClient class. + * Initializes an instance of LoadTestAdministrationAsyncClient class. * * @param serviceClient the service client implementation. */ @Generated - TestAsyncClient(TestsImpl serviceClient) { + LoadTestAdministrationAsyncClient(LoadTestAdministrationsImpl serviceClient) { this.serviceClient = serviceClient; } + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateAppComponentsWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteAppComponentWithResponseAsync(name, requestOptions); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getAppComponentByNameWithResponseAsync(name, requestOptions); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getAppComponentWithResponseAsync(requestOptions); + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateServerMetricsConfigWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(name, body, requestOptions); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, requestOptions); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteServerMetricsWithResponseAsync(name, requestOptions); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getServerDefaultMetricsWithResponseAsync(requestOptions); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listSupportedResourceTypeWithResponseAsync(requestOptions); + } + /** * Create a new test or Update an existing test. * @@ -275,106 +694,6 @@ public Mono> getLoadTestWithResponse(String testId, Request return this.serviceClient.getLoadTestWithResponseAsync(testId, requestOptions); } - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testId: String (Optional)
-     *             description: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceId: String (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             inputArtifacts (Optional): {
-     *                 configUrl (Optional): {
-     *                     url: String (Optional)
-     *                     fileId: String (Optional)
-     *                     filename: String (Optional)
-     *                     fileType: String(0/1/2) (Optional)
-     *                     expireTime: OffsetDateTime (Optional)
-     *                     validationStatus: String (Optional)
-     *                 }
-     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                 additionalUrls (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             subnetId: String (Optional)
-     *             keyvaultReferenceIdentityType: String (Optional)
-     *             keyvaultReferenceIdentityId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as - * paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listLoadTestSearch(RequestOptions requestOptions) { - return this.serviceClient.listLoadTestSearchAsync(requestOptions); - } - /** * 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 multipart/form-data. @@ -392,7 +711,7 @@ public PagedFlux listLoadTestSearch(RequestOptions requestOptions) { *

Request Body Schema * *

{@code
-     * BinaryData
+     * Flux
      * }
* *

Response Body Schema @@ -534,6 +853,106 @@ public Mono> deleteTestFileWithResponse( return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileId, requestOptions); } + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLoadTestSearch(RequestOptions requestOptions) { + return this.serviceClient.listLoadTestSearchAsync(requestOptions); + } + /** * Get all test files. * diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java similarity index 58% rename from sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java rename to sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index 764720a6e4df4..95263135c59d5 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -3,6 +3,8 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.developer.loadtesting; +import java.io.IOException; + import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -15,24 +17,434 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import java.io.IOException; /** Initializes a new instance of the synchronous LoadTestingClient type. */ -@ServiceClient(builder = TestClientBuilder.class) -public final class TestClient { +@ServiceClient(builder = LoadTestAdministrationClientBuilder.class) +public final class LoadTestAdministrationClient { - @Generated private final TestAsyncClient client; + @Generated private final LoadTestAdministrationAsyncClient client; /** - * Initializes an instance of TestClient class. + * Initializes an instance of LoadTestAdministrationClient class. * * @param client the async client. */ @Generated - TestClient(TestAsyncClient client) { + LoadTestAdministrationClient(LoadTestAdministrationAsyncClient client) { this.client = client; } + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAppComponentsWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateAppComponentsWithResponse(name, body, requestOptions).block(); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteAppComponentWithResponse(name, requestOptions).block(); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { + return this.client.getAppComponentByNameWithResponse(name, requestOptions).block(); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentWithResponse(RequestOptions requestOptions) { + return this.client.getAppComponentWithResponse(requestOptions).block(); + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateServerMetricsConfigWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateServerMetricsConfigWithResponse(name, body, requestOptions).block(); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.client.getServerMetricsByNameWithResponse(name, requestOptions).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteServerMetricsWithResponse(name, requestOptions).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsWithResponse(RequestOptions requestOptions) { + return this.client.getServerMetricsWithResponse(requestOptions).block(); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return this.client.getServerDefaultMetricsWithResponse(requestOptions).block(); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.client.listSupportedResourceTypeWithResponse(requestOptions).block(); + } + /** * Create a new test or Update an existing test. * @@ -269,106 +681,6 @@ public Response getLoadTestWithResponse(String testId, RequestOption return this.client.getLoadTestWithResponse(testId, requestOptions).block(); } - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testId: String (Optional)
-     *             description: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceId: String (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             inputArtifacts (Optional): {
-     *                 configUrl (Optional): {
-     *                     url: String (Optional)
-     *                     fileId: String (Optional)
-     *                     filename: String (Optional)
-     *                     fileType: String(0/1/2) (Optional)
-     *                     expireTime: OffsetDateTime (Optional)
-     *                     validationStatus: String (Optional)
-     *                 }
-     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                 additionalUrls (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             subnetId: String (Optional)
-     *             keyvaultReferenceIdentityType: String (Optional)
-     *             keyvaultReferenceIdentityId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as - * paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLoadTestSearch(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listLoadTestSearch(requestOptions)); - } - /** * 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 multipart/form-data. @@ -386,7 +698,7 @@ public PagedIterable listLoadTestSearch(RequestOptions requestOption *

Request Body Schema * *

{@code
-     * BinaryData
+     * Flux
      * }
* *

Response Body Schema @@ -520,6 +832,106 @@ public Response deleteTestFileWithResponse(String testId, String fileId, R return this.client.deleteTestFileWithResponse(testId, fileId, requestOptions).block(); } + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLoadTestSearch(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listLoadTestSearch(requestOptions)); + } + /** * Get all test files. * diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java similarity index 74% rename from sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java rename to sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java index c510580c2d90f..e129ccc52c51e 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java @@ -39,13 +39,13 @@ import java.util.Map; import java.util.stream.Collectors; -/** A builder for creating a new instance of the ServerMetricsClient type. */ -@ServiceClientBuilder(serviceClients = {ServerMetricsClient.class, ServerMetricsAsyncClient.class}) -public final class ServerMetricsClientBuilder - implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - EndpointTrait { +/** A builder for creating a new instance of the LoadTestAdministrationClient type. */ +@ServiceClientBuilder(serviceClients = {LoadTestAdministrationClient.class, LoadTestAdministrationAsyncClient.class}) +public final class LoadTestAdministrationClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -58,9 +58,9 @@ public final class ServerMetricsClientBuilder @Generated private final List pipelinePolicies; - /** Create an instance of the ServerMetricsClientBuilder. */ + /** Create an instance of the LoadTestAdministrationClientBuilder. */ @Generated - public ServerMetricsClientBuilder() { + public LoadTestAdministrationClientBuilder() { this.pipelinePolicies = new ArrayList<>(); } @@ -72,7 +72,7 @@ public ServerMetricsClientBuilder() { /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder pipeline(HttpPipeline pipeline) { + public LoadTestAdministrationClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -85,7 +85,7 @@ public ServerMetricsClientBuilder pipeline(HttpPipeline pipeline) { /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder httpClient(HttpClient httpClient) { + public LoadTestAdministrationClientBuilder httpClient(HttpClient httpClient) { this.httpClient = httpClient; return this; } @@ -98,20 +98,21 @@ public ServerMetricsClientBuilder httpClient(HttpClient httpClient) { /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + public LoadTestAdministrationClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { this.httpLogOptions = httpLogOptions; return this; } /* - * The client options such as application ID and custom headers to set on a request. + * The client options such as application ID and custom headers to set on a + * request. */ @Generated private ClientOptions clientOptions; /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder clientOptions(ClientOptions clientOptions) { + public LoadTestAdministrationClientBuilder clientOptions(ClientOptions clientOptions) { this.clientOptions = clientOptions; return this; } @@ -124,7 +125,7 @@ public ServerMetricsClientBuilder clientOptions(ClientOptions clientOptions) { /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder retryOptions(RetryOptions retryOptions) { + public LoadTestAdministrationClientBuilder retryOptions(RetryOptions retryOptions) { this.retryOptions = retryOptions; return this; } @@ -132,20 +133,21 @@ public ServerMetricsClientBuilder retryOptions(RetryOptions retryOptions) { /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + public LoadTestAdministrationClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { pipelinePolicies.add(customPolicy); return this; } /* - * The configuration store that is used during construction of the service client. + * The configuration store that is used during construction of the service + * client. */ @Generated private Configuration configuration; /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder configuration(Configuration configuration) { + public LoadTestAdministrationClientBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; } @@ -158,7 +160,7 @@ public ServerMetricsClientBuilder configuration(Configuration configuration) { /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder credential(TokenCredential tokenCredential) { + public LoadTestAdministrationClientBuilder credential(TokenCredential tokenCredential) { this.tokenCredential = tokenCredential; return this; } @@ -171,7 +173,7 @@ public ServerMetricsClientBuilder credential(TokenCredential tokenCredential) { /** {@inheritDoc}. */ @Generated @Override - public ServerMetricsClientBuilder endpoint(String endpoint) { + public LoadTestAdministrationClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -185,16 +187,17 @@ public ServerMetricsClientBuilder endpoint(String endpoint) { * Sets Service version. * * @param serviceVersion the serviceVersion value. - * @return the ServerMetricsClientBuilder. + * @return the LoadTestAdministrationClientBuilder. */ @Generated - public ServerMetricsClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { + public LoadTestAdministrationClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { this.serviceVersion = serviceVersion; return this; } /* - * The retry policy that will attempt to retry failed requests, if applicable. + * The retry policy that will attempt to retry failed requests, if + * applicable. */ @Generated private RetryPolicy retryPolicy; @@ -202,10 +205,10 @@ public ServerMetricsClientBuilder serviceVersion(LoadTestingServiceVersion servi * Sets The retry policy that will attempt to retry failed requests, if applicable. * * @param retryPolicy the retryPolicy value. - * @return the ServerMetricsClientBuilder. + * @return the LoadTestAdministrationClientBuilder. */ @Generated - public ServerMetricsClientBuilder retryPolicy(RetryPolicy retryPolicy) { + public LoadTestAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) { this.retryPolicy = retryPolicy; return this; } @@ -217,12 +220,15 @@ public ServerMetricsClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private LoadTestingClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestingServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + if (serviceVersion == null) { + this.serviceVersion = LoadTestingServiceVersion.getLatest(); + } LoadTestingClientImpl client = new LoadTestingClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + pipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); return client; } @@ -275,22 +281,23 @@ private HttpPipeline createHttpPipeline() { } /** - * Builds an instance of ServerMetricsAsyncClient class. + * Builds an instance of LoadTestAdministrationAsyncClient class. * - * @return an instance of ServerMetricsAsyncClient. + * @return an instance of LoadTestAdministrationAsyncClient. */ @Generated - public ServerMetricsAsyncClient buildAsyncClient() { - return new ServerMetricsAsyncClient(buildInnerClient().getServerMetrics()); + public LoadTestAdministrationAsyncClient buildAsyncClient() { + return new LoadTestAdministrationAsyncClient(buildInnerClient().getLoadTestAdministrations()); } /** - * Builds an instance of ServerMetricsClient class. + * Builds an instance of LoadTestAdministrationClient class. * - * @return an instance of ServerMetricsClient. + * @return an instance of LoadTestAdministrationClient. */ @Generated - public ServerMetricsClient buildClient() { - return new ServerMetricsClient(new ServerMetricsAsyncClient(buildInnerClient().getServerMetrics())); + public LoadTestAdministrationClient buildClient() { + return new LoadTestAdministrationClient( + new LoadTestAdministrationAsyncClient(buildInnerClient().getLoadTestAdministrations())); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java new file mode 100644 index 0000000000000..05de4050e7a73 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.ServiceClient; +import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; + +/** Initializes a new instance of the asynchronous LoadTestingClient type. */ +@ServiceClient(builder = LoadTestingClientBuilder.class, isAsync = true) +public final class LoadTestingAsyncClient { + + /** + * {@link LoadTestAdministrationAsyncClient} contains AppComponent, ServerMetrics and + * Test operations. + */ + private final LoadTestAdministrationAsyncClient administration; + + /** + * {@link TestRunAsyncClient} involves operations for running a test + */ + private final TestRunAsyncClient testRun; + + /** + * Initializes an instance of LoadTestingAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + LoadTestingAsyncClient(LoadTestingClientImpl serviceClient) { + this.administration = new LoadTestAdministrationAsyncClient(serviceClient.getLoadTestAdministrations()); + this.testRun = new TestRunAsyncClient(serviceClient.getTestRuns()); + } + + /** + * Returns the instance of LoadTestAdministrationAsyncClient class. + * + * @return {@link LoadTestAdministrationAsyncClient} object. + */ + public LoadTestAdministrationAsyncClient getAdministration() { + return this.administration; + } + + /** + * Returns the instance of TestRunAsyncClient class. + * + * @return {@link TestRunAsyncClient} object. + */ + public TestRunAsyncClient getTestRun() { + return this.testRun; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java new file mode 100644 index 0000000000000..96b19148b1ca5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.ServiceClient; + +/** Initializes a new instance of the synchronous LoadTestingClient type. */ +@ServiceClient(builder = LoadTestingClientBuilder.class) +public final class LoadTestingClient { + + /** + * {@link LoadTestAdministrationClient} contains AppComponent, ServerMetrics and + * Test operations. + */ + private final LoadTestAdministrationClient administration; + + /** + * {@link TestRunClient} involves operations for running a test + */ + private final TestRunClient testRun; + + /** + * Initializes an instance of LoadTestingClient class. + * + * @param serviceClient the service client implementation. + */ + LoadTestingClient(LoadTestingAsyncClient client) { + this.administration = new LoadTestAdministrationClient(client.getAdministration()); + this.testRun = new TestRunClient(client.getTestRun()); + } + + /** + * Returns the instance of LoadTestAdministrationClient class. + * + * @return {@link LoadTestAdministrationClient} object. + */ + public LoadTestAdministrationClient getAdministration() { + return this.administration; + } + + /** + * Returns the instance of TestRunClient class. + * + * @return {@link TestRunClient} object. + */ + public TestRunClient getTestRun() { + return this.testRun; + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClientBuilder.java similarity index 71% rename from sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java rename to sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClientBuilder.java index ae2067e0d0e1f..4b79cf6b6844e 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClientBuilder.java @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.developer.loadtesting; -import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; import com.azure.core.client.traits.EndpointTrait; @@ -39,40 +37,37 @@ import java.util.Map; import java.util.stream.Collectors; -/** A builder for creating a new instance of the TestClient type. */ -@ServiceClientBuilder(serviceClients = {TestClient.class, TestAsyncClient.class}) -public final class TestClientBuilder - implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - EndpointTrait { +/** A builder for creating a new instance of the TestRunClient type. */ +@ServiceClientBuilder(serviceClients = {LoadTestingClient.class, LoadTestingAsyncClient.class}) +public final class LoadTestingClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { - @Generated private static final String SDK_NAME = "name"; + private static final String SDK_NAME = "name"; - @Generated private static final String SDK_VERSION = "version"; + private static final String SDK_VERSION = "version"; - @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; - @Generated private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - @Generated private final List pipelinePolicies; + private final List pipelinePolicies; - /** Create an instance of the TestClientBuilder. */ - @Generated - public TestClientBuilder() { + /** Create an instance of the LoadTestingClientBuilder. */ + public LoadTestingClientBuilder() { this.pipelinePolicies = new ArrayList<>(); } /* * The HTTP pipeline to send requests through. */ - @Generated private HttpPipeline pipeline; + private HttpPipeline pipeline; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder pipeline(HttpPipeline pipeline) { + public LoadTestingClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -80,12 +75,11 @@ public TestClientBuilder pipeline(HttpPipeline pipeline) { /* * The HTTP client used to send the request. */ - @Generated private HttpClient httpClient; + private HttpClient httpClient; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder httpClient(HttpClient httpClient) { + public LoadTestingClientBuilder httpClient(HttpClient httpClient) { this.httpClient = httpClient; return this; } @@ -93,12 +87,11 @@ public TestClientBuilder httpClient(HttpClient httpClient) { /* * The logging configuration for HTTP requests and responses. */ - @Generated private HttpLogOptions httpLogOptions; + private HttpLogOptions httpLogOptions; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + public LoadTestingClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { this.httpLogOptions = httpLogOptions; return this; } @@ -106,12 +99,11 @@ public TestClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { /* * The client options such as application ID and custom headers to set on a request. */ - @Generated private ClientOptions clientOptions; + private ClientOptions clientOptions; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder clientOptions(ClientOptions clientOptions) { + public LoadTestingClientBuilder clientOptions(ClientOptions clientOptions) { this.clientOptions = clientOptions; return this; } @@ -119,20 +111,18 @@ public TestClientBuilder clientOptions(ClientOptions clientOptions) { /* * The retry options to configure retry policy for failed requests. */ - @Generated private RetryOptions retryOptions; + private RetryOptions retryOptions; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder retryOptions(RetryOptions retryOptions) { + public LoadTestingClientBuilder retryOptions(RetryOptions retryOptions) { this.retryOptions = retryOptions; return this; } /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + public LoadTestingClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { pipelinePolicies.add(customPolicy); return this; } @@ -140,12 +130,11 @@ public TestClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { /* * The configuration store that is used during construction of the service client. */ - @Generated private Configuration configuration; + private Configuration configuration; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder configuration(Configuration configuration) { + public LoadTestingClientBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; } @@ -153,12 +142,11 @@ public TestClientBuilder configuration(Configuration configuration) { /* * The TokenCredential used for authentication. */ - @Generated private TokenCredential tokenCredential; + private TokenCredential tokenCredential; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder credential(TokenCredential tokenCredential) { + public LoadTestingClientBuilder credential(TokenCredential tokenCredential) { this.tokenCredential = tokenCredential; return this; } @@ -166,12 +154,11 @@ public TestClientBuilder credential(TokenCredential tokenCredential) { /* * The service endpoint */ - @Generated private String endpoint; + private String endpoint; /** {@inheritDoc}. */ - @Generated @Override - public TestClientBuilder endpoint(String endpoint) { + public LoadTestingClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -179,16 +166,15 @@ public TestClientBuilder endpoint(String endpoint) { /* * Service version */ - @Generated private LoadTestingServiceVersion serviceVersion; + private LoadTestingServiceVersion serviceVersion; /** * Sets Service version. * * @param serviceVersion the serviceVersion value. - * @return the TestClientBuilder. + * @return the LoadTestingClientBuilder. */ - @Generated - public TestClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { + public LoadTestingClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { this.serviceVersion = serviceVersion; return this; } @@ -196,16 +182,15 @@ public TestClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion /* * The retry policy that will attempt to retry failed requests, if applicable. */ - @Generated private RetryPolicy retryPolicy; + private RetryPolicy retryPolicy; /** * Sets The retry policy that will attempt to retry failed requests, if applicable. * * @param retryPolicy the retryPolicy value. - * @return the TestClientBuilder. + * @return the LoadTestingClientBuilder. */ - @Generated - public TestClientBuilder retryPolicy(RetryPolicy retryPolicy) { + public LoadTestingClientBuilder retryPolicy(RetryPolicy retryPolicy) { this.retryPolicy = retryPolicy; return this; } @@ -215,7 +200,6 @@ public TestClientBuilder retryPolicy(RetryPolicy retryPolicy) { * * @return an instance of LoadTestingClientImpl. */ - @Generated private LoadTestingClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); LoadTestingServiceVersion localServiceVersion = @@ -226,7 +210,6 @@ private LoadTestingClientImpl buildInnerClient() { return client; } - @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; @@ -275,22 +258,21 @@ private HttpPipeline createHttpPipeline() { } /** - * Builds an instance of TestAsyncClient class. + * Builds an instance of LoadTestingAsyncClient class. * - * @return an instance of TestAsyncClient. + * @return an instance of LoadTestingAsyncClient. */ - @Generated - public TestAsyncClient buildAsyncClient() { - return new TestAsyncClient(buildInnerClient().getTests()); + public LoadTestingAsyncClient buildAsyncClient() { + return new LoadTestingAsyncClient(buildInnerClient()); } /** - * Builds an instance of TestClient class. + * Builds an instance of LoadTestingClient class. * - * @return an instance of TestClient. + * @return an instance of LoadTestingClient. */ - @Generated - public TestClient buildClient() { - return new TestClient(new TestAsyncClient(buildInnerClient().getTests())); + public LoadTestingClient buildClient() { + return new LoadTestingClient(new LoadTestingAsyncClient(buildInnerClient())); } } + diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java index 41a9dbc0eeb72..2a568e5538a32 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java @@ -17,7 +17,6 @@ public enum LoadTestingServiceVersion implements ServiceVersion { this.version = version; } - /** {@inheritDoc} */ @Override public String getVersion() { return this.version; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java deleted file mode 100644 index cc626a08fb63d..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsAsyncClient.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.developer.loadtesting; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.developer.loadtesting.implementation.ServerMetricsImpl; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the asynchronous LoadTestingClient type. */ -@ServiceClient(builder = ServerMetricsClientBuilder.class, isAsync = true) -public final class ServerMetricsAsyncClient { - - @Generated private final ServerMetricsImpl serviceClient; - - /** - * Initializes an instance of ServerMetricsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ServerMetricsAsyncClient(ServerMetricsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Configure server metrics for a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Server metrics configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics config model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponse( - String name, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(name, body, requestOptions); - } - - /** - * Get server metrics configuration by its name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, requestOptions); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.deleteServerMetricsWithResponseAsync(name, requestOptions); - } - - /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions); - } - - /** - * Get all default server metrics configuration for supported resource types. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     defaultMetrics (Optional): {
-     *         String (Optional): [
-     *              (Optional){
-     *                 metricnamespace: String (Optional)
-     *                 aggregation: String (Optional)
-     *                 name (Optional): {
-     *                     value: String (Optional)
-     *                     localizedValue: String (Optional)
-     *                 }
-     *                 unit: String (Optional)
-     *                 displayDescription: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types along with {@link Response} on - * successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getServerDefaultMetricsWithResponseAsync(requestOptions); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on - * successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { - return this.serviceClient.listSupportedResourceTypeWithResponseAsync(requestOptions); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java deleted file mode 100644 index 9648981de9400..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/ServerMetricsClient.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.developer.loadtesting; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; - -/** Initializes a new instance of the synchronous LoadTestingClient type. */ -@ServiceClient(builder = ServerMetricsClientBuilder.class) -public final class ServerMetricsClient { - - @Generated private final ServerMetricsAsyncClient client; - - /** - * Initializes an instance of ServerMetricsClient class. - * - * @param client the async client. - */ - @Generated - ServerMetricsClient(ServerMetricsAsyncClient client) { - this.client = client; - } - - /** - * Configure server metrics for a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Server metrics configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics config model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse( - String name, BinaryData body, RequestOptions requestOptions) { - return this.client.createOrUpdateServerMetricsConfigWithResponse(name, body, requestOptions).block(); - } - - /** - * Get server metrics configuration by its name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { - return this.client.getServerMetricsByNameWithResponse(name, requestOptions).block(); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { - return this.client.deleteServerMetricsWithResponse(name, requestOptions).block(); - } - - /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsWithResponse(RequestOptions requestOptions) { - return this.client.getServerMetricsWithResponse(requestOptions).block(); - } - - /** - * Get all default server metrics configuration for supported resource types. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     defaultMetrics (Optional): {
-     *         String (Optional): [
-     *              (Optional){
-     *                 metricnamespace: String (Optional)
-     *                 aggregation: String (Optional)
-     *                 name (Optional): {
-     *                     value: String (Optional)
-     *                     localizedValue: String (Optional)
-     *                 }
-     *                 unit: String (Optional)
-     *                 displayDescription: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { - return this.client.getServerDefaultMetricsWithResponse(requestOptions).block(); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { - return this.client.listSupportedResourceTypeWithResponse(requestOptions).block(); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java index 3142f8d27c991..776c0d238d9de 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -52,19 +52,9 @@ public Mono> deleteTestRunWithResponse(String testRunId, RequestO } /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get test run details by name. * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
@@ -156,6 +146,55 @@ public Mono> deleteTestRunWithResponse(String testRunId, RequestO
      * }
      * }
* + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunWithResponseAsync(testRunId, requestOptions); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions); + } + + /** + * Stop test run by name. + * *

Response Body Schema * *

{@code
@@ -249,7 +288,6 @@ public Mono> deleteTestRunWithResponse(String testRunId, RequestO
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -259,19 +297,139 @@ public Mono> deleteTestRunWithResponse(String testRunId, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAndUpdateTestWithResponse( + public Mono> stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.stopTestRunWithResponseAsync(testRunId, requestOptions); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createAndUpdateTestWithResponseAsync(testRunId, body, requestOptions); + return this.serviceClient.getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions); } /** - * Get test run details by name. + * Get all filters that are supported for client metrics for a given load test run. * *

Response Body Schema * *

{@code
      * {
      *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     resourceId: String (Optional)
@@ -359,186 +517,6 @@ public Mono> createAndUpdateTestWithResponse(
      * }
      * }
* - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunWithResponseAsync(testRunId, requestOptions); - } - - /** - * Get test run file by file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunFileWithResponse( - String testRunId, String fileId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions); - } - - /** - * Get all test runs with given filters. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", - * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testRunId: String (Optional)
-     *             displayName: String (Optional)
-     *             testId: String (Optional)
-     *             resourceId: String (Optional)
-     *             description: String (Optional)
-     *             status: String (Optional)
-     *             startDateTime: OffsetDateTime (Optional)
-     *             endDateTime: OffsetDateTime (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             testResult: String (Optional)
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             testArtifacts (Optional): {
-     *                 inputArtifacts (Required): {
-     *                     configUrl (Optional): {
-     *                         url: String (Optional)
-     *                         fileId: String (Optional)
-     *                         filename: String (Optional)
-     *                         fileType: String(0/1/2) (Optional)
-     *                         expireTime: OffsetDateTime (Optional)
-     *                         validationStatus: String (Optional)
-     *                     }
-     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                     additionalUrls (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                 }
-     *                 outputArtifacts (Optional): {
-     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
-     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
-     *                 }
-     *             }
-     *             executedDateTime: OffsetDateTime (Optional)
-     *             vusers: Integer (Optional)
-     *             testRunStatistics (Optional): {
-     *                 String (Optional): {
-     *                     transaction: String (Optional)
-     *                     sampleCount: Double (Optional)
-     *                     errorCount: Double (Optional)
-     *                     errorPct: Double (Optional)
-     *                     meanResTime: Double (Optional)
-     *                     medianResTime: Double (Optional)
-     *                     maxResTime: Double (Optional)
-     *                     minResTime: Double (Optional)
-     *                     pct1ResTime: Double (Optional)
-     *                     pct2ResTime: Double (Optional)
-     *                     pct3ResTime: Double (Optional)
-     *                     throughput: Double (Optional)
-     *                     receivedKBytesPerSec: Double (Optional)
-     *                     sentKBytesPerSec: Double (Optional)
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             portalUrl: String (Optional)
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             duration: Long (Optional)
-     *             subnetId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestRunsSearch(RequestOptions requestOptions) { - return this.serviceClient.listTestRunsSearchAsync(requestOptions); - } - - /** - * Stop test run by name. - * *

Response Body Schema * *

{@code
@@ -632,6 +610,7 @@ public PagedFlux listTestRunsSearch(RequestOptions requestOptions) {
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -641,118 +620,139 @@ public PagedFlux listTestRunsSearch(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.stopTestRunWithResponseAsync(testRunId, requestOptions); + public Mono> createAndUpdateTestRunWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createAndUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); } /** - * Get all client metrics for a load test run. + * Get all test runs with given filters. * - *

Request Body Schema + *

Query Parameters * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
+ * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} * *

Response Body Schema * *

{@code
      * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
      *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
      *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunClientMetricsWithResponse( - String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions); - } - - /** - * Get all filters that are supported for client metrics for a given load test run. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
+     *     ]
+     *     nextLink: String (Optional)
      * }
      * }
* - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run along with {@link Response} - * on successful completion of {@link Mono}. + * @return all test runs with given filters as paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunClientMetricsFiltersWithResponse( - String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRunsSearch(RequestOptions requestOptions) { + return this.serviceClient.listTestRunsSearchAsync(requestOptions); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java index 20c361102ae4f..039ec666f319a 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -50,19 +50,9 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions } /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get test run details by name. * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
@@ -154,6 +144,55 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions
      * }
      * }
* + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.getTestRunWithResponse(testRunId, requestOptions).block(); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.client.getTestRunFileWithResponse(testRunId, fileId, requestOptions).block(); + } + + /** + * Stop test run by name. + * *

Response Body Schema * *

{@code
@@ -247,7 +286,6 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -257,19 +295,137 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAndUpdateTestWithResponse( + public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunClientMetricsWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.client.createAndUpdateTestWithResponse(testRunId, body, requestOptions).block(); + return this.client.getTestRunClientMetricsWithResponse(testRunId, body, requestOptions).block(); } /** - * Get test run details by name. + * Get all filters that are supported for client metrics for a given load test run. * *

Response Body Schema * *

{@code
      * {
      *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.client.getTestRunClientMetricsFiltersWithResponse(testRunId, requestOptions).block(); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     resourceId: String (Optional)
@@ -357,186 +513,6 @@ public Response createAndUpdateTestWithResponse(
      * }
      * }
* - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.client.getTestRunWithResponse(testRunId, requestOptions).block(); - } - - /** - * Get test run file by file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunFileWithResponse( - String testRunId, String fileId, RequestOptions requestOptions) { - return this.client.getTestRunFileWithResponse(testRunId, fileId, requestOptions).block(); - } - - /** - * Get all test runs with given filters. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", - * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testRunId: String (Optional)
-     *             displayName: String (Optional)
-     *             testId: String (Optional)
-     *             resourceId: String (Optional)
-     *             description: String (Optional)
-     *             status: String (Optional)
-     *             startDateTime: OffsetDateTime (Optional)
-     *             endDateTime: OffsetDateTime (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             testResult: String (Optional)
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             testArtifacts (Optional): {
-     *                 inputArtifacts (Required): {
-     *                     configUrl (Optional): {
-     *                         url: String (Optional)
-     *                         fileId: String (Optional)
-     *                         filename: String (Optional)
-     *                         fileType: String(0/1/2) (Optional)
-     *                         expireTime: OffsetDateTime (Optional)
-     *                         validationStatus: String (Optional)
-     *                     }
-     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                     additionalUrls (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                 }
-     *                 outputArtifacts (Optional): {
-     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
-     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
-     *                 }
-     *             }
-     *             executedDateTime: OffsetDateTime (Optional)
-     *             vusers: Integer (Optional)
-     *             testRunStatistics (Optional): {
-     *                 String (Optional): {
-     *                     transaction: String (Optional)
-     *                     sampleCount: Double (Optional)
-     *                     errorCount: Double (Optional)
-     *                     errorPct: Double (Optional)
-     *                     meanResTime: Double (Optional)
-     *                     medianResTime: Double (Optional)
-     *                     maxResTime: Double (Optional)
-     *                     minResTime: Double (Optional)
-     *                     pct1ResTime: Double (Optional)
-     *                     pct2ResTime: Double (Optional)
-     *                     pct3ResTime: Double (Optional)
-     *                     throughput: Double (Optional)
-     *                     receivedKBytesPerSec: Double (Optional)
-     *                     sentKBytesPerSec: Double (Optional)
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             portalUrl: String (Optional)
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             duration: Long (Optional)
-     *             subnetId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTestRunsSearch(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listTestRunsSearch(requestOptions)); - } - - /** - * Stop test run by name. - * *

Response Body Schema * *

{@code
@@ -630,6 +606,7 @@ public PagedIterable listTestRunsSearch(RequestOptions requestOption
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -639,116 +616,139 @@ public PagedIterable listTestRunsSearch(RequestOptions requestOption */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); + public Response createAndUpdateTestRunWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.client.createAndUpdateTestRunWithResponse(testRunId, body, requestOptions).block(); } /** - * Get all client metrics for a load test run. + * Get all test runs with given filters. * - *

Request Body Schema + *

Query Parameters * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
+ * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} * *

Response Body Schema * *

{@code
      * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
      *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
      *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunClientMetricsWithResponse( - String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.client.getTestRunClientMetricsWithResponse(testRunId, body, requestOptions).block(); - } - - /** - * Get all filters that are supported for client metrics for a given load test run. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
+     *     ]
+     *     nextLink: String (Optional)
      * }
      * }
* - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. + * @return all test runs with given filters as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunClientMetricsFiltersWithResponse( - String testRunId, RequestOptions requestOptions) { - return this.client.getTestRunClientMetricsFiltersWithResponse(testRunId, requestOptions).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestRunsSearch(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTestRunsSearch(requestOptions)); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java index 0e49beebb5355..71f5ddc81b091 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java @@ -104,7 +104,8 @@ public TestRunClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { } /* - * The client options such as application ID and custom headers to set on a request. + * The client options such as application ID and custom headers to set on a + * request. */ @Generated private ClientOptions clientOptions; @@ -138,7 +139,8 @@ public TestRunClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { } /* - * The configuration store that is used during construction of the service client. + * The configuration store that is used during construction of the service + * client. */ @Generated private Configuration configuration; @@ -194,7 +196,8 @@ public TestRunClientBuilder serviceVersion(LoadTestingServiceVersion serviceVers } /* - * The retry policy that will attempt to retry failed requests, if applicable. + * The retry policy that will attempt to retry failed requests, if + * applicable. */ @Generated private RetryPolicy retryPolicy; @@ -217,12 +220,15 @@ public TestRunClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private LoadTestingClientImpl buildInnerClient() { - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestingServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + if (serviceVersion == null) { + this.serviceVersion = LoadTestingServiceVersion.getLatest(); + } LoadTestingClientImpl client = new LoadTestingClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + pipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); return client; } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java deleted file mode 100644 index edfc613e95a45..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AppComponents. */ -public final class AppComponentsImpl { - /** The proxy service used to perform REST calls. */ - private final AppComponentsService service; - - /** The service client containing this operation class. */ - private final LoadTestingClientImpl client; - - /** - * Initializes an instance of AppComponentsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AppComponentsImpl(LoadTestingClientImpl client) { - this.service = - RestProxy.create(AppComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LoadTestingClientAppComponents to be used by the proxy service to - * perform REST calls. - */ - @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestingClientApp") - private interface AppComponentsService { - @Patch("/appcomponents/{name}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateAppComponents( - @HostParam("Endpoint") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Delete("/appcomponents/{name}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteAppComponent( - @HostParam("Endpoint") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/appcomponents/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAppComponentByName( - @HostParam("Endpoint") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/appcomponents") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAppComponent( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - } - - /** - * Associate an App Component (Azure resource) to a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param body App Component model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponseAsync( - String name, BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.createOrUpdateAppComponents( - this.client.getEndpoint(), - name, - this.client.getServiceVersion().getVersion(), - body, - accept, - requestOptions, - context)); - } - - /** - * Associate an App Component (Azure resource) to a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param body App Component model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse( - String name, BinaryData body, RequestOptions requestOptions) { - return createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions).block(); - } - - /** - * Delete an App Component. - * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAppComponentWithResponseAsync(String name, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.deleteAppComponent( - this.client.getEndpoint(), - name, - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Delete an App Component. - * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { - return deleteAppComponentWithResponseAsync(name, requestOptions).block(); - } - - /** - * Get App Component details by App Component name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Component details by App Component name along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentByNameWithResponseAsync( - String name, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getAppComponentByName( - this.client.getEndpoint(), - name, - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Get App Component details by App Component name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Component details by App Component name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { - return getAppComponentByNameWithResponseAsync(name, requestOptions).block(); - } - - /** - * Get App Components for a test or a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test or a test run by its name along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getAppComponent( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Get App Components for a test or a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test or a test run by its name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentWithResponse(RequestOptions requestOptions) { - return getAppComponentWithResponseAsync(requestOptions).block(); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java new file mode 100644 index 0000000000000..4882926c33a75 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java @@ -0,0 +1,4083 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadTestAdministrations. */ +public final class LoadTestAdministrationsImpl { + /** The proxy service used to perform REST calls. */ + private final LoadTestAdministrationsService service; + + /** The service client containing this operation class. */ + private final LoadTestingClientImpl client; + + /** + * Initializes an instance of LoadTestAdministrationsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadTestAdministrationsImpl(LoadTestingClientImpl client) { + this.service = + RestProxy.create( + LoadTestAdministrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestingClientLoadTestAdministrations to be used by the proxy + * service to perform REST calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestingClientLoa") + private interface LoadTestAdministrationsService { + @Patch("/appcomponents/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateAppComponents( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/appcomponents/{name}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteAppComponent( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/appcomponents/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAppComponentByName( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/appcomponents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAppComponent( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Patch("/serverMetricsConfig/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateServerMetricsConfig( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getServerMetricsByName( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/serverMetricsConfig/{name}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteServerMetrics( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getServerMetrics( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getServerDefaultMetrics( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/serverMetricsConfig/supportedResourceTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listSupportedResourceType( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Patch("/loadtests/{testId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateTest( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/loadtests/{testId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLoadTest( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLoadTest( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/sortAndFilter") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listLoadTestSearch( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + // @Multipart not supported by RestProxy + @Put("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadTestFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @BodyParam("multipart/form-data") BinaryData file, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTestFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}/files") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAllTestFiles( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listLoadTestSearchNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAllTestFilesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + } + + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateAppComponentsWithResponseAsync( + String name, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdateAppComponents( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateAppComponentsWithResponseAsync( + String name, BinaryData body, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.createOrUpdateAppComponents( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context); + } + + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAppComponentsWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions).block(); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAppComponentWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteAppComponent( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAppComponentWithResponseAsync( + String name, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteAppComponent( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAppComponentWithResponse(String name, RequestOptions requestOptions) { + return deleteAppComponentWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentByNameWithResponseAsync( + String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAppComponentByName( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentByNameWithResponseAsync( + String name, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getAppComponentByName( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentByNameWithResponse(String name, RequestOptions requestOptions) { + return getAppComponentByNameWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAppComponent( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentWithResponseAsync(RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getAppComponent( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get App Components for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test or a test run by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentWithResponse(RequestOptions requestOptions) { + return getAppComponentWithResponseAsync(requestOptions).block(); + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateServerMetricsConfigWithResponseAsync( + String name, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdateServerMetricsConfig( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateServerMetricsConfigWithResponseAsync( + String name, BinaryData body, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.createOrUpdateServerMetricsConfig( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context); + } + + /** + * Configure server metrics for a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics config model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateServerMetricsConfigWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateServerMetricsConfigWithResponseAsync(name, body, requestOptions).block(); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsByNameWithResponseAsync( + String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getServerMetricsByName( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsByNameWithResponseAsync( + String name, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getServerMetricsByName( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return getServerMetricsByNameWithResponseAsync(name, requestOptions).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteServerMetricsWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteServerMetrics( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteServerMetricsWithResponseAsync( + String name, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteServerMetrics( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return deleteServerMetricsWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getServerMetrics( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsWithResponseAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getServerMetrics( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsWithResponse(RequestOptions requestOptions) { + return getServerMetricsWithResponseAsync(requestOptions).block(); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerDefaultMetricsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getServerDefaultMetrics( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerDefaultMetricsWithResponseAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getServerDefaultMetrics( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return getServerDefaultMetricsWithResponseAsync(requestOptions).block(); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSupportedResourceTypeWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listSupportedResourceType( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSupportedResourceTypeWithResponseAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listSupportedResourceType( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return listSupportedResourceTypeWithResponseAsync(requestOptions).block(); + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTestWithResponseAsync( + String testId, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdateTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + body, + accept, + requestOptions, + context)); + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTestWithResponseAsync( + String testId, BinaryData body, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.createOrUpdateTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + body, + accept, + requestOptions, + context); + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateTestWithResponseAsync(testId, body, requestOptions).block(); + } + + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLoadTestWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteLoadTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context)); + } + + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLoadTestWithResponseAsync( + String testId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteLoadTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context); + } + + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return deleteLoadTestWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLoadTestWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getLoadTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context)); + } + + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLoadTestWithResponseAsync( + String testId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getLoadTest( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context); + } + + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLoadTestWithResponse(String testId, RequestOptions requestOptions) { + return getLoadTestWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLoadTestSearchSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listLoadTestSearch( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLoadTestSearchSinglePageAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listLoadTestSearch( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLoadTestSearchAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listLoadTestSearchSinglePageAsync(requestOptions), + nextLink -> listLoadTestSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLoadTestSearchAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listLoadTestSearchSinglePageAsync(requestOptions, context), + nextLink -> listLoadTestSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLoadTestSearch(RequestOptions requestOptions) { + return new PagedIterable<>(listLoadTestSearchAsync(requestOptions)); + } + + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadTestFileWithResponseAsync( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.uploadTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + file, + accept, + requestOptions, + context)); + } + + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadTestFileWithResponseAsync( + String testId, String fileId, BinaryData file, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.uploadTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + file, + accept, + requestOptions, + context); + } + + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadTestFileWithResponse( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + return uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions).block(); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return getTestFileWithResponseAsync(testId, fileId, requestOptions).block(); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteTestFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return deleteTestFileWithResponseAsync(testId, fileId, requestOptions).block(); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAllTestFilesSinglePageAsync( + String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAllTestFiles( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAllTestFilesSinglePageAsync( + String testId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getAllTestFiles( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + testId, + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getAllTestFilesAsync(String testId, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> getAllTestFilesSinglePageAsync(testId, requestOptions), + nextLink -> getAllTestFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getAllTestFilesAsync(String testId, RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> getAllTestFilesSinglePageAsync(testId, requestOptions, context), + nextLink -> getAllTestFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getAllTestFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(getAllTestFilesAsync(testId, requestOptions)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLoadTestSearchNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listLoadTestSearchNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testId: String (Optional)
+     *             description: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceId: String (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             inputArtifacts (Optional): {
+     *                 configUrl (Optional): {
+     *                     url: String (Optional)
+     *                     fileId: String (Optional)
+     *                     filename: String (Optional)
+     *                     fileType: String(0/1/2) (Optional)
+     *                     expireTime: OffsetDateTime (Optional)
+     *                     validationStatus: String (Optional)
+     *                 }
+     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                 additionalUrls (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             subnetId: String (Optional)
+     *             keyvaultReferenceIdentityType: String (Optional)
+     *             keyvaultReferenceIdentityId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLoadTestSearchNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listLoadTestSearchNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAllTestFilesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAllTestFilesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAllTestFilesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getAllTestFilesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java index 5182cc1cbd8f3..1019d4c2ad952 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java @@ -63,40 +63,16 @@ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The AppComponentsImpl object to access its operations. */ - private final AppComponentsImpl appComponents; + /** The LoadTestAdministrationsImpl object to access its operations. */ + private final LoadTestAdministrationsImpl loadTestAdministrations; /** - * Gets the AppComponentsImpl object to access its operations. + * Gets the LoadTestAdministrationsImpl object to access its operations. * - * @return the AppComponentsImpl object. + * @return the LoadTestAdministrationsImpl object. */ - public AppComponentsImpl getAppComponents() { - return this.appComponents; - } - - /** The ServerMetricsImpl object to access its operations. */ - private final ServerMetricsImpl serverMetrics; - - /** - * Gets the ServerMetricsImpl object to access its operations. - * - * @return the ServerMetricsImpl object. - */ - public ServerMetricsImpl getServerMetrics() { - return this.serverMetrics; - } - - /** The TestsImpl object to access its operations. */ - private final TestsImpl tests; - - /** - * Gets the TestsImpl object to access its operations. - * - * @return the TestsImpl object. - */ - public TestsImpl getTests() { - return this.tests; + public LoadTestAdministrationsImpl getLoadTestAdministrations() { + return this.loadTestAdministrations; } /** The TestRunsImpl object to access its operations. */ @@ -155,9 +131,7 @@ public LoadTestingClientImpl( this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceVersion = serviceVersion; - this.appComponents = new AppComponentsImpl(this); - this.serverMetrics = new ServerMetricsImpl(this); - this.tests = new TestsImpl(this); + this.loadTestAdministrations = new LoadTestAdministrationsImpl(this); this.testRuns = new TestRunsImpl(this); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java deleted file mode 100644 index 8c7e1c1fde984..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/ServerMetricsImpl.java +++ /dev/null @@ -1,708 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServerMetrics. */ -public final class ServerMetricsImpl { - /** The proxy service used to perform REST calls. */ - private final ServerMetricsService service; - - /** The service client containing this operation class. */ - private final LoadTestingClientImpl client; - - /** - * Initializes an instance of ServerMetricsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerMetricsImpl(LoadTestingClientImpl client) { - this.service = - RestProxy.create(ServerMetricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LoadTestingClientServerMetrics to be used by the proxy service to - * perform REST calls. - */ - @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestingClientSer") - private interface ServerMetricsService { - @Patch("/serverMetricsConfig/{name}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateServerMetricsConfig( - @HostParam("Endpoint") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/serverMetricsConfig/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getServerMetricsByName( - @HostParam("Endpoint") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Delete("/serverMetricsConfig/{name}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteServerMetrics( - @HostParam("Endpoint") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/serverMetricsConfig") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getServerMetrics( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/serverMetricsConfig/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getServerDefaultMetrics( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/serverMetricsConfig/supportedResourceTypes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listSupportedResourceType( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - } - - /** - * Configure server metrics for a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Server metrics configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics config model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponseAsync( - String name, BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.createOrUpdateServerMetricsConfig( - this.client.getEndpoint(), - name, - this.client.getServiceVersion().getVersion(), - body, - accept, - requestOptions, - context)); - } - - /** - * Configure server metrics for a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Server metrics configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics config model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse( - String name, BinaryData body, RequestOptions requestOptions) { - return createOrUpdateServerMetricsConfigWithResponseAsync(name, body, requestOptions).block(); - } - - /** - * Get server metrics configuration by its name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsByNameWithResponseAsync( - String name, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getServerMetricsByName( - this.client.getEndpoint(), - name, - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Get server metrics configuration by its name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { - return getServerMetricsByNameWithResponseAsync(name, requestOptions).block(); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteServerMetricsWithResponseAsync(String name, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.deleteServerMetrics( - this.client.getEndpoint(), - name, - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { - return deleteServerMetricsWithResponseAsync(name, requestOptions).block(); - } - - /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getServerMetrics( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsWithResponse(RequestOptions requestOptions) { - return getServerMetricsWithResponseAsync(requestOptions).block(); - } - - /** - * Get all default server metrics configuration for supported resource types. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     defaultMetrics (Optional): {
-     *         String (Optional): [
-     *              (Optional){
-     *                 metricnamespace: String (Optional)
-     *                 aggregation: String (Optional)
-     *                 name (Optional): {
-     *                     value: String (Optional)
-     *                     localizedValue: String (Optional)
-     *                 }
-     *                 unit: String (Optional)
-     *                 displayDescription: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerDefaultMetricsWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getServerDefaultMetrics( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Get all default server metrics configuration for supported resource types. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     defaultMetrics (Optional): {
-     *         String (Optional): [
-     *              (Optional){
-     *                 metricnamespace: String (Optional)
-     *                 aggregation: String (Optional)
-     *                 name (Optional): {
-     *                     value: String (Optional)
-     *                     localizedValue: String (Optional)
-     *                 }
-     *                 unit: String (Optional)
-     *                 displayDescription: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { - return getServerDefaultMetricsWithResponseAsync(requestOptions).block(); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSupportedResourceTypeWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listSupportedResourceType( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { - return listSupportedResourceTypeWithResponseAsync(requestOptions).block(); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java index f0ea687d02189..5d4b613fca96c 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java @@ -95,7 +95,7 @@ Mono> deleteTestRun( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createAndUpdateTest( + Mono> createAndUpdateTestRun( @HostParam("Endpoint") String endpoint, @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, @@ -270,6 +270,31 @@ public Mono> deleteTestRunWithResponseAsync(String testRunId, Req context)); } + /** + * Delete a test run by its name. + * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestRunWithResponseAsync( + String testRunId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + /** * Delete a test run by its name. * @@ -493,12 +518,12 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAndUpdateTestWithResponseAsync( + public Mono> createAndUpdateTestRunWithResponseAsync( String testRunId, BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.createAndUpdateTest( + service.createAndUpdateTestRun( this.client.getEndpoint(), testRunId, this.client.getServiceVersion().getVersion(), @@ -708,6 +733,227 @@ public Mono> createAndUpdateTestWithResponseAsync( * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. * @param body Load test run model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAndUpdateTestRunWithResponseAsync( + String testRunId, BinaryData body, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.createAndUpdateTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -715,9 +961,9 @@ public Mono> createAndUpdateTestWithResponseAsync( * @return load test run model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAndUpdateTestWithResponse( + public Response createAndUpdateTestRunWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return createAndUpdateTestWithResponseAsync(testRunId, body, requestOptions).block(); + return createAndUpdateTestRunWithResponseAsync(testRunId, body, requestOptions).block(); } /** @@ -934,48 +1180,165 @@ public Mono> getTestRunWithResponseAsync(String testRunId, * * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name along with {@link Response}. + * @return test run details by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return getTestRunWithResponseAsync(testRunId, requestOptions).block(); + public Mono> getTestRunWithResponseAsync( + String testRunId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); } /** - * Get test run file by file name. + * Get test run details by name. * *

Response Body Schema * *

{@code
      * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunFileWithResponseAsync( - String testRunId, String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> + * testRunId: String (Optional) + * displayName: String (Optional) + * testId: String (Optional) + * resourceId: String (Optional) + * description: String (Optional) + * status: String (Optional) + * startDateTime: OffsetDateTime (Optional) + * endDateTime: OffsetDateTime (Optional) + * loadTestConfig (Optional): { + * engineInstances: Integer (Optional) + * splitAllCSVs: Boolean (Optional) + * } + * testResult: String (Optional) + * passFailCriteria (Optional): { + * passFailMetrics (Optional): { + * String (Optional): { + * clientmetric: String (Optional) + * aggregate: String (Optional) + * condition: String (Optional) + * requestName: String (Optional) + * value: Double (Optional) + * action: String (Optional) + * actualValue: Double (Optional) + * result: String (Optional) + * } + * } + * } + * testArtifacts (Optional): { + * inputArtifacts (Required): { + * configUrl (Optional): { + * url: String (Optional) + * fileId: String (Optional) + * filename: String (Optional) + * fileType: String(0/1/2) (Optional) + * expireTime: OffsetDateTime (Optional) + * validationStatus: String (Optional) + * } + * testScriptUrl (Optional): (recursive schema, see testScriptUrl above) + * userPropUrl (Optional): (recursive schema, see userPropUrl above) + * inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above) + * additionalUrls (Optional): [ + * (recursive schema, see above) + * ] + * } + * outputArtifacts (Optional): { + * resultUrl (Optional): (recursive schema, see resultUrl above) + * logsUrl (Optional): (recursive schema, see logsUrl above) + * } + * } + * executedDateTime: OffsetDateTime (Optional) + * vusers: Integer (Optional) + * testRunStatistics (Optional): { + * String (Optional): { + * transaction: String (Optional) + * sampleCount: Double (Optional) + * errorCount: Double (Optional) + * errorPct: Double (Optional) + * meanResTime: Double (Optional) + * medianResTime: Double (Optional) + * maxResTime: Double (Optional) + * minResTime: Double (Optional) + * pct1ResTime: Double (Optional) + * pct2ResTime: Double (Optional) + * pct3ResTime: Double (Optional) + * throughput: Double (Optional) + * receivedKBytesPerSec: Double (Optional) + * sentKBytesPerSec: Double (Optional) + * } + * } + * createdDateTime: OffsetDateTime (Optional) + * createdBy: String (Optional) + * lastModifiedDateTime: OffsetDateTime (Optional) + * lastModifiedBy: String (Optional) + * portalUrl: String (Optional) + * secrets (Optional): { + * String (Optional): { + * value: String (Optional) + * type: String (Optional) + * } + * } + * environmentVariables (Optional): { + * String: String (Optional) + * } + * duration: Long (Optional) + * subnetId: String (Optional) + * } + * } + * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return getTestRunWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunFileWithResponseAsync( + String testRunId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getTestRunFile( this.client.getEndpoint(), testRunId, @@ -986,6 +1349,46 @@ public Mono> getTestRunFileWithResponseAsync( context)); } + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunFileWithResponseAsync( + String testRunId, String fileId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getTestRunFile( + this.client.getEndpoint(), + testRunId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + /** * Get test run file by file name. * @@ -1284,22 +1687,33 @@ public Mono> listTestRunsSearchSinglePageAsync(Request * } * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedFlux}. + * @return all test runs with given filters along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestRunsSearchAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE); - return new PagedFlux<>( - () -> listTestRunsSearchSinglePageAsync(requestOptions), - nextLink -> listTestRunsSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestRunsSearchSinglePageAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listTestRunsSearch( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); } /** @@ -1425,11 +1839,403 @@ public PagedFlux listTestRunsSearchAsync(RequestOptions requestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedIterable}. + * @return all test runs with given filters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRunsSearchAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listTestRunsSearchSinglePageAsync(requestOptions), + nextLink -> listTestRunsSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs with given filters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRunsSearchAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listTestRunsSearchSinglePageAsync(requestOptions, context), + nextLink -> listTestRunsSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response.
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoThe end DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoThe start DateTime(ISO 8601 literal format) of test-run execution time filter range.
statusStringNoComma separated list of test run status, value can be - "ACCEPTED", "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", + * "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED".
maxPageSizeIntegerNoNumber of results in response.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs with given filters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestRunsSearch(RequestOptions requestOptions) { + return new PagedIterable<>(listTestRunsSearchAsync(requestOptions)); + } + + /** + * Stop test run by name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTestRunsSearch(RequestOptions requestOptions) { - return new PagedIterable<>(listTestRunsSearchAsync(requestOptions)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.stopTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); } /** @@ -1529,6 +2335,7 @@ public PagedIterable listTestRunsSearch(RequestOptions requestOption * * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -1536,17 +2343,16 @@ public PagedIterable listTestRunsSearch(RequestOptions requestOption * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + public Mono> stopTestRunWithResponseAsync( + String testRunId, RequestOptions requestOptions, Context context) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.stopTestRun( - this.client.getEndpoint(), - testRunId, - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); + return service.stopTestRun( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); } /** @@ -1738,6 +2544,86 @@ public Mono> getTestRunClientMetricsWithResponseAsync( context)); } + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsWithResponseAsync( + String testRunId, BinaryData body, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getTestRunClientMetrics( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context); + } + /** * Get all client metrics for a load test run. * @@ -1855,6 +2741,52 @@ public Mono> getTestRunClientMetricsFiltersWithResponseAsyn context)); } + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsFiltersWithResponseAsync( + String testRunId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getTestRunClientMetricsFilters( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + /** * Get all filters that are supported for client metrics for a given load test run. * @@ -1992,8 +2924,7 @@ public Response getTestRunClientMetricsFiltersWithResponse( * } * } * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * @param nextLink The nextLink parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2020,6 +2951,131 @@ public Mono> listTestRunsSearchNextSinglePageAsync( null)); } + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             testRunId: String (Optional)
+     *             displayName: String (Optional)
+     *             testId: String (Optional)
+     *             resourceId: String (Optional)
+     *             description: String (Optional)
+     *             status: String (Optional)
+     *             startDateTime: OffsetDateTime (Optional)
+     *             endDateTime: OffsetDateTime (Optional)
+     *             loadTestConfig (Optional): {
+     *                 engineInstances: Integer (Optional)
+     *                 splitAllCSVs: Boolean (Optional)
+     *             }
+     *             testResult: String (Optional)
+     *             passFailCriteria (Optional): {
+     *                 passFailMetrics (Optional): {
+     *                     String (Optional): {
+     *                         clientmetric: String (Optional)
+     *                         aggregate: String (Optional)
+     *                         condition: String (Optional)
+     *                         requestName: String (Optional)
+     *                         value: Double (Optional)
+     *                         action: String (Optional)
+     *                         actualValue: Double (Optional)
+     *                         result: String (Optional)
+     *                     }
+     *                 }
+     *             }
+     *             testArtifacts (Optional): {
+     *                 inputArtifacts (Required): {
+     *                     configUrl (Optional): {
+     *                         url: String (Optional)
+     *                         fileId: String (Optional)
+     *                         filename: String (Optional)
+     *                         fileType: String(0/1/2) (Optional)
+     *                         expireTime: OffsetDateTime (Optional)
+     *                         validationStatus: String (Optional)
+     *                     }
+     *                     testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *                     userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *                     inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *                     additionalUrls (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *                 outputArtifacts (Optional): {
+     *                     resultUrl (Optional): (recursive schema, see resultUrl above)
+     *                     logsUrl (Optional): (recursive schema, see logsUrl above)
+     *                 }
+     *             }
+     *             executedDateTime: OffsetDateTime (Optional)
+     *             vusers: Integer (Optional)
+     *             testRunStatistics (Optional): {
+     *                 String (Optional): {
+     *                     transaction: String (Optional)
+     *                     sampleCount: Double (Optional)
+     *                     errorCount: Double (Optional)
+     *                     errorPct: Double (Optional)
+     *                     meanResTime: Double (Optional)
+     *                     medianResTime: Double (Optional)
+     *                     maxResTime: Double (Optional)
+     *                     minResTime: Double (Optional)
+     *                     pct1ResTime: Double (Optional)
+     *                     pct2ResTime: Double (Optional)
+     *                     pct3ResTime: Double (Optional)
+     *                     throughput: Double (Optional)
+     *                     receivedKBytesPerSec: Double (Optional)
+     *                     sentKBytesPerSec: Double (Optional)
+     *                 }
+     *             }
+     *             createdDateTime: OffsetDateTime (Optional)
+     *             createdBy: String (Optional)
+     *             lastModifiedDateTime: OffsetDateTime (Optional)
+     *             lastModifiedBy: String (Optional)
+     *             portalUrl: String (Optional)
+     *             secrets (Optional): {
+     *                 String (Optional): {
+     *                     value: String (Optional)
+     *                     type: String (Optional)
+     *                 }
+     *             }
+     *             environmentVariables (Optional): {
+     *                 String: String (Optional)
+     *             }
+     *             duration: Long (Optional)
+     *             subnetId: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestRunsSearchNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listTestRunsSearchNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + private List getValues(BinaryData binaryData, String path) { try { Map obj = binaryData.toObject(Map.class); diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java deleted file mode 100644 index d2ee5585c7389..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java +++ /dev/null @@ -1,1632 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in Tests. */ -public final class TestsImpl { - /** The proxy service used to perform REST calls. */ - private final TestsService service; - - /** The service client containing this operation class. */ - private final LoadTestingClientImpl client; - - /** - * Initializes an instance of TestsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TestsImpl(LoadTestingClientImpl client) { - this.service = RestProxy.create(TestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for LoadTestingClientTests to be used by the proxy service to perform - * REST calls. - */ - @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestingClientTes") - private interface TestsService { - @Patch("/loadtests/{testId}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateTest( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("testId") String testId, - @BodyParam("application/merge-patch+json") BinaryData body, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Delete("/loadtests/{testId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteLoadTest( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("testId") String testId, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/loadtests/{testId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLoadTest( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("testId") String testId, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/loadtests/sortAndFilter") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listLoadTestSearch( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - // @Multipart not supported by RestProxy - @Put("/loadtests/{testId}/files/{fileId}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> uploadTestFile( - @HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, - @PathParam("fileId") String fileId, - @QueryParam("api-version") String apiVersion, - @BodyParam("multipart/form-data") BinaryData file, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/loadtests/{testId}/files/{fileId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getTestFile( - @HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, - @PathParam("fileId") String fileId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Delete("/loadtests/{testId}/files/{fileId}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteTestFile( - @HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, - @PathParam("fileId") String fileId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("/loadtests/{testId}/files") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAllTestFiles( - @HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("testId") String testId, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listLoadTestSearchNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAllTestFilesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); - } - - /** - * Create a new test or Update an existing test. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateTestWithResponseAsync( - String testId, BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.createOrUpdateTest( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - testId, - body, - accept, - requestOptions, - context)); - } - - /** - * Create a new test or Update an existing test. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateTestWithResponse( - String testId, BinaryData body, RequestOptions requestOptions) { - return createOrUpdateTestWithResponseAsync(testId, body, requestOptions).block(); - } - - /** - * Delete a test by its name. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteLoadTestWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.deleteLoadTest( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - testId, - accept, - requestOptions, - context)); - } - - /** - * Delete a test by its name. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteLoadTestWithResponse(String testId, RequestOptions requestOptions) { - return deleteLoadTestWithResponseAsync(testId, requestOptions).block(); - } - - /** - * Get load test details by test name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLoadTestWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getLoadTest( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - testId, - accept, - requestOptions, - context)); - } - - /** - * Get load test details by test name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLoadTestWithResponse(String testId, RequestOptions requestOptions) { - return getLoadTestWithResponseAsync(testId, requestOptions).block(); - } - - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testId: String (Optional)
-     *             description: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceId: String (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             inputArtifacts (Optional): {
-     *                 configUrl (Optional): {
-     *                     url: String (Optional)
-     *                     fileId: String (Optional)
-     *                     filename: String (Optional)
-     *                     fileType: String(0/1/2) (Optional)
-     *                     expireTime: OffsetDateTime (Optional)
-     *                     validationStatus: String (Optional)
-     *                 }
-     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                 additionalUrls (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             subnetId: String (Optional)
-     *             keyvaultReferenceIdentityType: String (Optional)
-     *             keyvaultReferenceIdentityId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listLoadTestSearchSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listLoadTestSearch( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - getValues(res.getValue(), "value"), - getNextLink(res.getValue(), "nextLink"), - null)); - } - - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testId: String (Optional)
-     *             description: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceId: String (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             inputArtifacts (Optional): {
-     *                 configUrl (Optional): {
-     *                     url: String (Optional)
-     *                     fileId: String (Optional)
-     *                     filename: String (Optional)
-     *                     fileType: String(0/1/2) (Optional)
-     *                     expireTime: OffsetDateTime (Optional)
-     *                     validationStatus: String (Optional)
-     *                 }
-     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                 additionalUrls (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             subnetId: String (Optional)
-     *             keyvaultReferenceIdentityType: String (Optional)
-     *             keyvaultReferenceIdentityId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listLoadTestSearchAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE); - return new PagedFlux<>( - () -> listLoadTestSearchSinglePageAsync(requestOptions), - nextLink -> listLoadTestSearchNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - * - *

Query Parameters - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc.
searchStringNoFilter search based on searchable fields - testId, createdBy.
lastUpdatedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
lastUpdatedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of the last updated time range to filter tests.
continuationTokenStringNoContinuation token to get the next page of response.
maxPageSizeIntegerNoNumber of results in response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testId: String (Optional)
-     *             description: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceId: String (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             inputArtifacts (Optional): {
-     *                 configUrl (Optional): {
-     *                     url: String (Optional)
-     *                     fileId: String (Optional)
-     *                     filename: String (Optional)
-     *                     fileType: String(0/1/2) (Optional)
-     *                     expireTime: OffsetDateTime (Optional)
-     *                     validationStatus: String (Optional)
-     *                 }
-     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                 additionalUrls (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             subnetId: String (Optional)
-     *             keyvaultReferenceIdentityType: String (Optional)
-     *             keyvaultReferenceIdentityId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLoadTestSearch(RequestOptions requestOptions) { - return new PagedIterable<>(listLoadTestSearchAsync(requestOptions)); - } - - /** - * 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 multipart/form-data. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param file The file to be uploaded. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadTestFileWithResponseAsync( - String testId, String fileId, BinaryData file, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.uploadTestFile( - this.client.getEndpoint(), - testId, - fileId, - this.client.getServiceVersion().getVersion(), - file, - accept, - requestOptions, - context)); - } - - /** - * 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 multipart/form-data. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * BinaryData
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param file The file to be uploaded. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return fileUrl Model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadTestFileWithResponse( - String testId, String fileId, BinaryData file, RequestOptions requestOptions) { - return uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions).block(); - } - - /** - * Get test file by the file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestFileWithResponseAsync( - String testId, String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getTestFile( - this.client.getEndpoint(), - testId, - fileId, - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Get test file by the file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { - return getTestFileWithResponseAsync(testId, fileId, requestOptions).block(); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTestFileWithResponseAsync( - String testId, String fileId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.deleteTestFile( - this.client.getEndpoint(), - testId, - fileId, - this.client.getServiceVersion().getVersion(), - accept, - requestOptions, - context)); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTestFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { - return deleteTestFileWithResponseAsync(testId, fileId, requestOptions).block(); - } - - /** - * Get all test files. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAllTestFilesSinglePageAsync( - String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getAllTestFiles( - this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), - testId, - accept, - requestOptions, - context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - getValues(res.getValue(), "value"), - getNextLink(res.getValue(), "nextLink"), - null)); - } - - /** - * Get all test files. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getAllTestFilesAsync(String testId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE); - return new PagedFlux<>( - () -> getAllTestFilesSinglePageAsync(testId, requestOptions), - nextLink -> getAllTestFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get all test files. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getAllTestFiles(String testId, RequestOptions requestOptions) { - return new PagedIterable<>(getAllTestFilesAsync(testId, requestOptions)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             testId: String (Optional)
-     *             description: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceId: String (Optional)
-     *             loadTestConfig (Optional): {
-     *                 engineInstances: Integer (Optional)
-     *                 splitAllCSVs: Boolean (Optional)
-     *             }
-     *             passFailCriteria (Optional): {
-     *                 passFailMetrics (Optional): {
-     *                     String (Optional): {
-     *                         clientmetric: String (Optional)
-     *                         aggregate: String (Optional)
-     *                         condition: String (Optional)
-     *                         requestName: String (Optional)
-     *                         value: Double (Optional)
-     *                         action: String (Optional)
-     *                         actualValue: Double (Optional)
-     *                         result: String (Optional)
-     *                     }
-     *                 }
-     *             }
-     *             createdDateTime: OffsetDateTime (Optional)
-     *             createdBy: String (Optional)
-     *             lastModifiedDateTime: OffsetDateTime (Optional)
-     *             lastModifiedBy: String (Optional)
-     *             inputArtifacts (Optional): {
-     *                 configUrl (Optional): {
-     *                     url: String (Optional)
-     *                     fileId: String (Optional)
-     *                     filename: String (Optional)
-     *                     fileType: String(0/1/2) (Optional)
-     *                     expireTime: OffsetDateTime (Optional)
-     *                     validationStatus: String (Optional)
-     *                 }
-     *                 testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *                 userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *                 inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *                 additionalUrls (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *             secrets (Optional): {
-     *                 String (Optional): {
-     *                     value: String (Optional)
-     *                     type: String (Optional)
-     *                 }
-     *             }
-     *             environmentVariables (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *             subnetId: String (Optional)
-     *             keyvaultReferenceIdentityType: String (Optional)
-     *             keyvaultReferenceIdentityId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listLoadTestSearchNextSinglePageAsync( - String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.listLoadTestSearchNext( - nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - getValues(res.getValue(), "value"), - getNextLink(res.getValue(), "nextLink"), - null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAllTestFilesNextSinglePageAsync( - String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getAllTestFilesNext( - nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - getValues(res.getValue(), "value"), - getNextLink(res.getValue(), "nextLink"), - null)); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java deleted file mode 100644 index c085ca3c4c019..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponent.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * An Azure resource object (Refer azure generic resource model : - * https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource). - */ -@Fluent -public final class AppComponent { - /* - * Fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} - */ - @JsonProperty(value = "resourceId", required = true) - private String resourceId; - - /* - * Azure resource name - */ - @JsonProperty(value = "resourceName", required = true) - private String resourceName; - - /* - * Azure resource type - */ - @JsonProperty(value = "resourceType", required = true) - private String resourceType; - - /* - * Azure resource display name - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Resource group name of the Azure resource - */ - @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * Subscription Id of the Azure resource - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * Kind of Azure resource type - */ - @JsonProperty(value = "kind") - private String kind; - - /** - * Creates an instance of AppComponent class. - * - * @param resourceId the resourceId value to set. - * @param resourceName the resourceName value to set. - * @param resourceType the resourceType value to set. - */ - @JsonCreator - public AppComponent( - @JsonProperty(value = "resourceId", required = true) String resourceId, - @JsonProperty(value = "resourceName", required = true) String resourceName, - @JsonProperty(value = "resourceType", required = true) String resourceType) { - this.resourceId = resourceId; - this.resourceName = resourceName; - this.resourceType = resourceType; - } - - /** - * Get the resourceId property: Fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - * - * @return the resourceId value. - */ - public String getResourceId() { - return this.resourceId; - } - - /** - * Get the resourceName property: Azure resource name. - * - * @return the resourceName value. - */ - public String getResourceName() { - return this.resourceName; - } - - /** - * Get the resourceType property: Azure resource type. - * - * @return the resourceType value. - */ - public String getResourceType() { - return this.resourceType; - } - - /** - * Get the displayName property: Azure resource display name. - * - * @return the displayName value. - */ - public String getDisplayName() { - return this.displayName; - } - - /** - * Set the displayName property: Azure resource display name. - * - * @param displayName the displayName value to set. - * @return the AppComponent object itself. - */ - public AppComponent setDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the resourceGroup property: Resource group name of the Azure resource. - * - * @return the resourceGroup value. - */ - public String getResourceGroup() { - return this.resourceGroup; - } - - /** - * Get the subscriptionId property: Subscription Id of the Azure resource. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * Get the kind property: Kind of Azure resource type. - * - * @return the kind value. - */ - public String getKind() { - return this.kind; - } - - /** - * Set the kind property: Kind of Azure resource type. - * - * @param kind the kind value to set. - * @return the AppComponent object itself. - */ - public AppComponent setKind(String kind) { - this.kind = kind; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java deleted file mode 100644 index 3f4df73160a27..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/AppComponentsMap.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** App Components model. */ -@Fluent -public final class AppComponentsMap { - /* - * Azure Load Testing resource Id - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * [Required, if testRunId is not given] Load test unique identifier - */ - @JsonProperty(value = "testId") - private String testId; - - /* - * [Required if testId is not given] Load test run unique identifier - */ - @JsonProperty(value = "testRunId") - private String testRunId; - - /* - * AppComponent name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * AppComponents Map { resource id (Fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource - * object } - */ - @JsonProperty(value = "value", required = true) - private Map value; - - /** - * Creates an instance of AppComponentsMap class. - * - * @param value the value value to set. - */ - @JsonCreator - public AppComponentsMap(@JsonProperty(value = "value", required = true) Map value) { - this.value = value; - } - - /** - * Get the resourceId property: Azure Load Testing resource Id. - * - * @return the resourceId value. - */ - public String getResourceId() { - return this.resourceId; - } - - /** - * Get the testId property: [Required, if testRunId is not given] Load test unique identifier. - * - * @return the testId value. - */ - public String getTestId() { - return this.testId; - } - - /** - * Set the testId property: [Required, if testRunId is not given] Load test unique identifier. - * - * @param testId the testId value to set. - * @return the AppComponentsMap object itself. - */ - public AppComponentsMap setTestId(String testId) { - this.testId = testId; - return this; - } - - /** - * Get the testRunId property: [Required if testId is not given] Load test run unique identifier. - * - * @return the testRunId value. - */ - public String getTestRunId() { - return this.testRunId; - } - - /** - * Set the testRunId property: [Required if testId is not given] Load test run unique identifier. - * - * @param testRunId the testRunId value to set. - * @return the AppComponentsMap object itself. - */ - public AppComponentsMap setTestRunId(String testRunId) { - this.testRunId = testRunId; - return this; - } - - /** - * Get the name property: AppComponent name. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * Get the value property: AppComponents Map { resource id (Fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource - * object }. - * - * @return the value value. - */ - public Map getValue() { - return this.value; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java deleted file mode 100644 index 175cd8b85fc83..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsFilters.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ClientMetricsFilters model. */ -@Fluent -public final class ClientMetricsFilters { - /* - * Test run name for which client metrics filters is required. - */ - @JsonProperty(value = "testRunId") - private String testRunId; - - /* - * The filters property. - */ - @JsonProperty(value = "filters") - private Filters filters; - - /* - * The timeRange property. - */ - @JsonProperty(value = "timeRange") - private TimeRange timeRange; - - /** - * Get the testRunId property: Test run name for which client metrics filters is required. - * - * @return the testRunId value. - */ - public String getTestRunId() { - return this.testRunId; - } - - /** - * Set the testRunId property: Test run name for which client metrics filters is required. - * - * @param testRunId the testRunId value to set. - * @return the ClientMetricsFilters object itself. - */ - public ClientMetricsFilters setTestRunId(String testRunId) { - this.testRunId = testRunId; - return this; - } - - /** - * Get the filters property: The filters property. - * - * @return the filters value. - */ - public Filters getFilters() { - return this.filters; - } - - /** - * Set the filters property: The filters property. - * - * @param filters the filters value to set. - * @return the ClientMetricsFilters object itself. - */ - public ClientMetricsFilters setFilters(Filters filters) { - this.filters = filters; - return this; - } - - /** - * Get the timeRange property: The timeRange property. - * - * @return the timeRange value. - */ - public TimeRange getTimeRange() { - return this.timeRange; - } - - /** - * Set the timeRange property: The timeRange property. - * - * @param timeRange the timeRange value to set. - * @return the ClientMetricsFilters object itself. - */ - public ClientMetricsFilters setTimeRange(TimeRange timeRange) { - this.timeRange = timeRange; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java deleted file mode 100644 index 92012513734c4..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsRequestModel.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Client metrics request payload. */ -@Fluent -public final class ClientMetricsRequestModel { - /* - * List of request samplers, maximum supported samplers for queries are 20. In case of empty, it will return - * metrics for maximum 20 samplers - */ - @JsonProperty(value = "requestSamplers") - private List requestSamplers; - - /* - * List of errors, maximum supported errors for queries are 20. In case of empty, by default will return metrics - * for maximum 20 errors - */ - @JsonProperty(value = "errors") - private List errors; - - /* - * List of percentiles values for response time, supported values 50,90,99,95. Default value is 50th percentile. - */ - @JsonProperty(value = "percentiles") - private List percentiles; - - /* - * For test duration less than 10 minutes group by time interval can be any one of 5s,10s,1m,5m.\n\nFor test - * duration greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. Default value is 1m. - */ - @JsonProperty(value = "groupByInterval") - private String groupByInterval; - - /* - * Start time - */ - @JsonProperty(value = "startTime", required = true) - private OffsetDateTime startTime; - - /* - * End time - */ - @JsonProperty(value = "endTime", required = true) - private OffsetDateTime endTime; - - /** - * Creates an instance of ClientMetricsRequestModel class. - * - * @param startTime the startTime value to set. - * @param endTime the endTime value to set. - */ - @JsonCreator - public ClientMetricsRequestModel( - @JsonProperty(value = "startTime", required = true) OffsetDateTime startTime, - @JsonProperty(value = "endTime", required = true) OffsetDateTime endTime) { - this.startTime = startTime; - this.endTime = endTime; - } - - /** - * Get the requestSamplers property: List of request samplers, maximum supported samplers for queries are 20. In - * case of empty, it will return metrics for maximum 20 samplers. - * - * @return the requestSamplers value. - */ - public List getRequestSamplers() { - return this.requestSamplers; - } - - /** - * Set the requestSamplers property: List of request samplers, maximum supported samplers for queries are 20. In - * case of empty, it will return metrics for maximum 20 samplers. - * - * @param requestSamplers the requestSamplers value to set. - * @return the ClientMetricsRequestModel object itself. - */ - public ClientMetricsRequestModel setRequestSamplers(List requestSamplers) { - this.requestSamplers = requestSamplers; - return this; - } - - /** - * Get the errors property: List of errors, maximum supported errors for queries are 20. In case of empty, by - * default will return metrics for maximum 20 errors. - * - * @return the errors value. - */ - public List getErrors() { - return this.errors; - } - - /** - * Set the errors property: List of errors, maximum supported errors for queries are 20. In case of empty, by - * default will return metrics for maximum 20 errors. - * - * @param errors the errors value to set. - * @return the ClientMetricsRequestModel object itself. - */ - public ClientMetricsRequestModel setErrors(List errors) { - this.errors = errors; - return this; - } - - /** - * Get the percentiles property: List of percentiles values for response time, supported values 50,90,99,95. Default - * value is 50th percentile. - * - * @return the percentiles value. - */ - public List getPercentiles() { - return this.percentiles; - } - - /** - * Set the percentiles property: List of percentiles values for response time, supported values 50,90,99,95. Default - * value is 50th percentile. - * - * @param percentiles the percentiles value to set. - * @return the ClientMetricsRequestModel object itself. - */ - public ClientMetricsRequestModel setPercentiles(List percentiles) { - this.percentiles = percentiles; - return this; - } - - /** - * Get the groupByInterval property: For test duration less than 10 minutes group by time interval can be any one of - * 5s,10s,1m,5m.\n\nFor test duration greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. - * Default value is 1m. - * - * @return the groupByInterval value. - */ - public String getGroupByInterval() { - return this.groupByInterval; - } - - /** - * Set the groupByInterval property: For test duration less than 10 minutes group by time interval can be any one of - * 5s,10s,1m,5m.\n\nFor test duration greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. - * Default value is 1m. - * - * @param groupByInterval the groupByInterval value to set. - * @return the ClientMetricsRequestModel object itself. - */ - public ClientMetricsRequestModel setGroupByInterval(String groupByInterval) { - this.groupByInterval = groupByInterval; - return this; - } - - /** - * Get the startTime property: Start time. - * - * @return the startTime value. - */ - public OffsetDateTime getStartTime() { - return this.startTime; - } - - /** - * Get the endTime property: End time. - * - * @return the endTime value. - */ - public OffsetDateTime getEndTime() { - return this.endTime; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java deleted file mode 100644 index 524c9d66c68d3..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ClientMetricsResults.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ClientMetricsResults model. */ -@Fluent -public final class ClientMetricsResults { - /* - * Test run name for which client metrics results is required. - */ - @JsonProperty(value = "testRunId") - private String testRunId; - - /* - * The timeSeries property. - */ - @JsonProperty(value = "timeSeries") - private Series timeSeries; - - /** - * Get the testRunId property: Test run name for which client metrics results is required. - * - * @return the testRunId value. - */ - public String getTestRunId() { - return this.testRunId; - } - - /** - * Set the testRunId property: Test run name for which client metrics results is required. - * - * @param testRunId the testRunId value to set. - * @return the ClientMetricsResults object itself. - */ - public ClientMetricsResults setTestRunId(String testRunId) { - this.testRunId = testRunId; - return this; - } - - /** - * Get the timeSeries property: The timeSeries property. - * - * @return the timeSeries value. - */ - public Series getTimeSeries() { - return this.timeSeries; - } - - /** - * Set the timeSeries property: The timeSeries property. - * - * @param timeSeries the timeSeries value to set. - * @return the ClientMetricsResults object itself. - */ - public ClientMetricsResults setTimeSeries(Series timeSeries) { - this.timeSeries = timeSeries; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java deleted file mode 100644 index 0da9f7bb76d70..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigListModel.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Default server metrics config. */ -@Fluent -public final class DefaultServerMetricsConfigListModel { - /* - * Default metrics map {resourceType : list of metrics config} (Refer for metrics structure: - * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition) - */ - @JsonProperty(value = "defaultMetrics") - private Map> defaultMetrics; - - /** - * Get the defaultMetrics property: Default metrics map {resourceType : list of metrics config} (Refer for metrics - * structure: https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - * - * @return the defaultMetrics value. - */ - public Map> getDefaultMetrics() { - return this.defaultMetrics; - } - - /** - * Set the defaultMetrics property: Default metrics map {resourceType : list of metrics config} (Refer for metrics - * structure: https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - * - * @param defaultMetrics the defaultMetrics value to set. - * @return the DefaultServerMetricsConfigListModel object itself. - */ - public DefaultServerMetricsConfigListModel setDefaultMetrics( - Map> defaultMetrics) { - this.defaultMetrics = defaultMetrics; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java deleted file mode 100644 index 77df25bfa1f88..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/DefaultServerMetricsConfigModel.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metrics config model. */ -@Fluent -public final class DefaultServerMetricsConfigModel { - /* - * The metricnamespace property. - */ - @JsonProperty(value = "metricnamespace") - private String metricnamespace; - - /* - * The aggregation property. - */ - @JsonProperty(value = "aggregation") - private String aggregation; - - /* - * The name property. - */ - @JsonProperty(value = "name") - private LocalizedName name; - - /* - * The unit property. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * The displayDescription property. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /** - * Get the metricnamespace property: The metricnamespace property. - * - * @return the metricnamespace value. - */ - public String getMetricnamespace() { - return this.metricnamespace; - } - - /** - * Set the metricnamespace property: The metricnamespace property. - * - * @param metricnamespace the metricnamespace value to set. - * @return the DefaultServerMetricsConfigModel object itself. - */ - public DefaultServerMetricsConfigModel setMetricnamespace(String metricnamespace) { - this.metricnamespace = metricnamespace; - return this; - } - - /** - * Get the aggregation property: The aggregation property. - * - * @return the aggregation value. - */ - public String getAggregation() { - return this.aggregation; - } - - /** - * Set the aggregation property: The aggregation property. - * - * @param aggregation the aggregation value to set. - * @return the DefaultServerMetricsConfigModel object itself. - */ - public DefaultServerMetricsConfigModel setAggregation(String aggregation) { - this.aggregation = aggregation; - return this; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public LocalizedName getName() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the DefaultServerMetricsConfigModel object itself. - */ - public DefaultServerMetricsConfigModel setName(LocalizedName name) { - this.name = name; - return this; - } - - /** - * Get the unit property: The unit property. - * - * @return the unit value. - */ - public String getUnit() { - return this.unit; - } - - /** - * Set the unit property: The unit property. - * - * @param unit the unit value to set. - * @return the DefaultServerMetricsConfigModel object itself. - */ - public DefaultServerMetricsConfigModel setUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the displayDescription property: The displayDescription property. - * - * @return the displayDescription value. - */ - public String getDisplayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: The displayDescription property. - * - * @param displayDescription the displayDescription value to set. - * @return the DefaultServerMetricsConfigModel object itself. - */ - public DefaultServerMetricsConfigModel setDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java deleted file mode 100644 index 6cde42082d973..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Error.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Error from a REST request. */ -@Fluent -public final class Error { - /* - * The error code. - */ - @JsonProperty(value = "code") - private String code; - - /* - * The error message. - */ - @JsonProperty(value = "message") - private String message; - - /* - * The error target. - */ - @JsonProperty(value = "target") - private String target; - - /* - * Additional details and inner errors. - */ - @JsonProperty(value = "details") - private List details; - - /** - * Get the code property: The error code. - * - * @return the code value. - */ - public String getCode() { - return this.code; - } - - /** - * Set the code property: The error code. - * - * @param code the code value to set. - * @return the Error object itself. - */ - public Error setCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: The error message. - * - * @return the message value. - */ - public String getMessage() { - return this.message; - } - - /** - * Set the message property: The error message. - * - * @param message the message value to set. - * @return the Error object itself. - */ - public Error setMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the target property: The error target. - * - * @return the target value. - */ - public String getTarget() { - return this.target; - } - - /** - * Set the target property: The error target. - * - * @param target the target value to set. - * @return the Error object itself. - */ - public Error setTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the details property: Additional details and inner errors. - * - * @return the details value. - */ - public List getDetails() { - return this.details; - } - - /** - * Set the details property: Additional details and inner errors. - * - * @param details the details value to set. - * @return the Error object itself. - */ - public Error setDetails(List details) { - this.details = details; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java deleted file mode 100644 index 0eb2d138f7b38..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ErrorResponseBody.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The definition of an error object. */ -@Fluent -public final class ErrorResponseBody { - /* - * Error from a REST request. - */ - @JsonProperty(value = "error") - private Error error; - - /** - * Get the error property: Error from a REST request. - * - * @return the error value. - */ - public Error getError() { - return this.error; - } - - /** - * Set the error property: Error from a REST request. - * - * @param error the error value to set. - * @return the ErrorResponseBody object itself. - */ - public ErrorResponseBody setError(Error error) { - this.error = error; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java deleted file mode 100644 index 00c68b7973bf7..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileType.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). */ -public final class FileType extends ExpandableStringEnum { - /** Static value 0 for FileType. */ - public static final FileType ZERO = fromInt(0); - - /** Static value 1 for FileType. */ - public static final FileType ONE = fromInt(1); - - /** Static value 2 for FileType. */ - public static final FileType TWO = fromInt(2); - - /** - * Creates or finds a FileType from its string representation. - * - * @param name a name to look for. - * @return the corresponding FileType. - */ - @JsonCreator - public static FileType fromInt(int name) { - return fromString(String.valueOf(name), FileType.class); - } - - /** - * Gets known FileType values. - * - * @return known FileType values. - */ - public static Collection values() { - return values(FileType.class); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java deleted file mode 100644 index 1be29279a48e7..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrl.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** FileUrl Model. */ -@Fluent -public final class FileUrl { - /* - * File URL. - */ - @JsonProperty(value = "url") - private String url; - - /* - * File unique identifier. - */ - @JsonProperty(value = "fileId") - private String fileId; - - /* - * Name of the file. - */ - @JsonProperty(value = "filename") - private String filename; - - /* - * Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS) - */ - @JsonProperty(value = "fileType") - private FileType fileType; - - /* - * Expiry time of the file - */ - @JsonProperty(value = "expireTime") - private OffsetDateTime expireTime; - - /* - * Validation status of the file - */ - @JsonProperty(value = "validationStatus") - private String validationStatus; - - /** - * Get the url property: File URL. - * - * @return the url value. - */ - public String getUrl() { - return this.url; - } - - /** - * Set the url property: File URL. - * - * @param url the url value to set. - * @return the FileUrl object itself. - */ - public FileUrl setUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the fileId property: File unique identifier. - * - * @return the fileId value. - */ - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: File unique identifier. - * - * @param fileId the fileId value to set. - * @return the FileUrl object itself. - */ - public FileUrl setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the filename property: Name of the file. - * - * @return the filename value. - */ - public String getFilename() { - return this.filename; - } - - /** - * Set the filename property: Name of the file. - * - * @param filename the filename value to set. - * @return the FileUrl object itself. - */ - public FileUrl setFilename(String filename) { - this.filename = filename; - return this; - } - - /** - * Get the fileType property: Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - * ADDITIONAL_ARTIFACTS). - * - * @return the fileType value. - */ - public FileType getFileType() { - return this.fileType; - } - - /** - * Set the fileType property: Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - * ADDITIONAL_ARTIFACTS). - * - * @param fileType the fileType value to set. - * @return the FileUrl object itself. - */ - public FileUrl setFileType(FileType fileType) { - this.fileType = fileType; - return this; - } - - /** - * Get the expireTime property: Expiry time of the file. - * - * @return the expireTime value. - */ - public OffsetDateTime getExpireTime() { - return this.expireTime; - } - - /** - * Set the expireTime property: Expiry time of the file. - * - * @param expireTime the expireTime value to set. - * @return the FileUrl object itself. - */ - public FileUrl setExpireTime(OffsetDateTime expireTime) { - this.expireTime = expireTime; - return this; - } - - /** - * Get the validationStatus property: Validation status of the file. - * - * @return the validationStatus value. - */ - public String getValidationStatus() { - return this.validationStatus; - } - - /** - * Set the validationStatus property: Validation status of the file. - * - * @param validationStatus the validationStatus value to set. - * @return the FileUrl object itself. - */ - public FileUrl setValidationStatus(String validationStatus) { - this.validationStatus = validationStatus; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java deleted file mode 100644 index 38abbb51c353b..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/FileUrlList.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The FileUrlList model. */ -@Fluent -public final class FileUrlList { - /* - * List of file URLs. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link for the next list of file URLs, if applicable - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Creates an instance of FileUrlList class. - * - * @param value the value value to set. - */ - @JsonCreator - public FileUrlList(@JsonProperty(value = "value", required = true) List value) { - this.value = value; - } - - /** - * Get the value property: List of file URLs. - * - * @return the value value. - */ - public List getValue() { - return this.value; - } - - /** - * Get the nextLink property: Link for the next list of file URLs, if applicable. - * - * @return the nextLink value. - */ - public String getNextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link for the next list of file URLs, if applicable. - * - * @param nextLink the nextLink value to set. - * @return the FileUrlList object itself. - */ - public FileUrlList setNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java deleted file mode 100644 index f2ebb85169d09..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Filters.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The Filters model. */ -@Fluent -public final class Filters { - /* - * List of request sampler for the test run, for which client metrics can be filtered. - */ - @JsonProperty(value = "requestSamplerValues") - private List requestSamplerValues; - - /* - * List of errors occurred for the test run, for which client metrics can be filtered. - */ - @JsonProperty(value = "errorFiltersValues") - private List errorFiltersValues; - - /** - * Get the requestSamplerValues property: List of request sampler for the test run, for which client metrics can be - * filtered. - * - * @return the requestSamplerValues value. - */ - public List getRequestSamplerValues() { - return this.requestSamplerValues; - } - - /** - * Set the requestSamplerValues property: List of request sampler for the test run, for which client metrics can be - * filtered. - * - * @param requestSamplerValues the requestSamplerValues value to set. - * @return the Filters object itself. - */ - public Filters setRequestSamplerValues(List requestSamplerValues) { - this.requestSamplerValues = requestSamplerValues; - return this; - } - - /** - * Get the errorFiltersValues property: List of errors occurred for the test run, for which client metrics can be - * filtered. - * - * @return the errorFiltersValues value. - */ - public List getErrorFiltersValues() { - return this.errorFiltersValues; - } - - /** - * Set the errorFiltersValues property: List of errors occurred for the test run, for which client metrics can be - * filtered. - * - * @param errorFiltersValues the errorFiltersValues value to set. - * @return the Filters object itself. - */ - public Filters setErrorFiltersValues(List errorFiltersValues) { - this.errorFiltersValues = errorFiltersValues; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java deleted file mode 100644 index 0b6a7c3ca38c2..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/InputTestArtifacts.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The input artifacts for the test. */ -@Fluent -public final class InputTestArtifacts { - /* - * FileUrl Model. - */ - @JsonProperty(value = "configUrl") - private FileUrl configUrl; - - /* - * FileUrl Model. - */ - @JsonProperty(value = "testScriptUrl") - private FileUrl testScriptUrl; - - /* - * FileUrl Model. - */ - @JsonProperty(value = "userPropUrl") - private FileUrl userPropUrl; - - /* - * FileUrl Model. - */ - @JsonProperty(value = "inputArtifactsZipFileurl") - private FileUrl inputArtifactsZipFileurl; - - /* - * The input artifacts file { name : url } map for the test run. - */ - @JsonProperty(value = "additionalUrls", access = JsonProperty.Access.WRITE_ONLY) - private List additionalUrls; - - /** - * Get the configUrl property: FileUrl Model. - * - * @return the configUrl value. - */ - public FileUrl getConfigUrl() { - return this.configUrl; - } - - /** - * Set the configUrl property: FileUrl Model. - * - * @param configUrl the configUrl value to set. - * @return the InputTestArtifacts object itself. - */ - public InputTestArtifacts setConfigUrl(FileUrl configUrl) { - this.configUrl = configUrl; - return this; - } - - /** - * Get the testScriptUrl property: FileUrl Model. - * - * @return the testScriptUrl value. - */ - public FileUrl getTestScriptUrl() { - return this.testScriptUrl; - } - - /** - * Set the testScriptUrl property: FileUrl Model. - * - * @param testScriptUrl the testScriptUrl value to set. - * @return the InputTestArtifacts object itself. - */ - public InputTestArtifacts setTestScriptUrl(FileUrl testScriptUrl) { - this.testScriptUrl = testScriptUrl; - return this; - } - - /** - * Get the userPropUrl property: FileUrl Model. - * - * @return the userPropUrl value. - */ - public FileUrl getUserPropUrl() { - return this.userPropUrl; - } - - /** - * Set the userPropUrl property: FileUrl Model. - * - * @param userPropUrl the userPropUrl value to set. - * @return the InputTestArtifacts object itself. - */ - public InputTestArtifacts setUserPropUrl(FileUrl userPropUrl) { - this.userPropUrl = userPropUrl; - return this; - } - - /** - * Get the inputArtifactsZipFileurl property: FileUrl Model. - * - * @return the inputArtifactsZipFileurl value. - */ - public FileUrl getInputArtifactsZipFileurl() { - return this.inputArtifactsZipFileurl; - } - - /** - * Set the inputArtifactsZipFileurl property: FileUrl Model. - * - * @param inputArtifactsZipFileurl the inputArtifactsZipFileurl value to set. - * @return the InputTestArtifacts object itself. - */ - public InputTestArtifacts setInputArtifactsZipFileurl(FileUrl inputArtifactsZipFileurl) { - this.inputArtifactsZipFileurl = inputArtifactsZipFileurl; - return this; - } - - /** - * Get the additionalUrls property: The input artifacts file { name : url } map for the test run. - * - * @return the additionalUrls value. - */ - public List getAdditionalUrls() { - return this.additionalUrls; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java deleted file mode 100644 index ab6588f7fa6bd..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LoadTestConfig.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The load test configuration. */ -@Fluent -public final class LoadTestConfig { - /* - * The number of engine instances to execute load test. Supported values are in range of 1-45. Required for - * creating a new test. - */ - @JsonProperty(value = "engineInstances") - private Integer engineInstances; - - /* - * Whether all the input CSV files should be split evenly across all engines. - */ - @JsonProperty(value = "splitAllCSVs") - private Boolean splitAllCSVs; - - /** - * Get the engineInstances property: The number of engine instances to execute load test. Supported values are in - * range of 1-45. Required for creating a new test. - * - * @return the engineInstances value. - */ - public Integer getEngineInstances() { - return this.engineInstances; - } - - /** - * Set the engineInstances property: The number of engine instances to execute load test. Supported values are in - * range of 1-45. Required for creating a new test. - * - * @param engineInstances the engineInstances value to set. - * @return the LoadTestConfig object itself. - */ - public LoadTestConfig setEngineInstances(Integer engineInstances) { - this.engineInstances = engineInstances; - return this; - } - - /** - * Get the splitAllCSVs property: Whether all the input CSV files should be split evenly across all engines. - * - * @return the splitAllCSVs value. - */ - public Boolean isSplitAllCSVs() { - return this.splitAllCSVs; - } - - /** - * Set the splitAllCSVs property: Whether all the input CSV files should be split evenly across all engines. - * - * @param splitAllCSVs the splitAllCSVs value to set. - * @return the LoadTestConfig object itself. - */ - public LoadTestConfig setSplitAllCSVs(Boolean splitAllCSVs) { - this.splitAllCSVs = splitAllCSVs; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java deleted file mode 100644 index 80a5e50ad2cd1..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/LocalizedName.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The LocalizedName model. */ -@Fluent -public final class LocalizedName { - /* - * The value property. - */ - @JsonProperty(value = "value") - private String value; - - /* - * The localizedValue property. - */ - @JsonProperty(value = "localizedValue") - private String localizedValue; - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public String getValue() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the LocalizedName object itself. - */ - public LocalizedName setValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: The localizedValue property. - * - * @return the localizedValue value. - */ - public String getLocalizedValue() { - return this.localizedValue; - } - - /** - * Set the localizedValue property: The localizedValue property. - * - * @param localizedValue the localizedValue value to set. - * @return the LocalizedName object itself. - */ - public LocalizedName setLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java deleted file mode 100644 index 834308e57edef..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/OutputTestArtifacts.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The output artifacts for the test run. */ -@Fluent -public final class OutputTestArtifacts { - /* - * FileUrl Model. - */ - @JsonProperty(value = "resultUrl") - private FileUrl resultUrl; - - /* - * FileUrl Model. - */ - @JsonProperty(value = "logsUrl") - private FileUrl logsUrl; - - /** - * Get the resultUrl property: FileUrl Model. - * - * @return the resultUrl value. - */ - public FileUrl getResultUrl() { - return this.resultUrl; - } - - /** - * Set the resultUrl property: FileUrl Model. - * - * @param resultUrl the resultUrl value to set. - * @return the OutputTestArtifacts object itself. - */ - public OutputTestArtifacts setResultUrl(FileUrl resultUrl) { - this.resultUrl = resultUrl; - return this; - } - - /** - * Get the logsUrl property: FileUrl Model. - * - * @return the logsUrl value. - */ - public FileUrl getLogsUrl() { - return this.logsUrl; - } - - /** - * Set the logsUrl property: FileUrl Model. - * - * @param logsUrl the logsUrl value to set. - * @return the OutputTestArtifacts object itself. - */ - public OutputTestArtifacts setLogsUrl(FileUrl logsUrl) { - this.logsUrl = logsUrl; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java deleted file mode 100644 index 1d4df534f051b..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailCriteria.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Pass fail criteria for a test. */ -@Fluent -public final class PassFailCriteria { - /* - * Map of id and pass fail metrics { id : pass fail metrics }. - */ - @JsonProperty(value = "passFailMetrics") - private Map passFailMetrics; - - /** - * Get the passFailMetrics property: Map of id and pass fail metrics { id : pass fail metrics }. - * - * @return the passFailMetrics value. - */ - public Map getPassFailMetrics() { - return this.passFailMetrics; - } - - /** - * Set the passFailMetrics property: Map of id and pass fail metrics { id : pass fail metrics }. - * - * @param passFailMetrics the passFailMetrics value to set. - * @return the PassFailCriteria object itself. - */ - public PassFailCriteria setPassFailMetrics(Map passFailMetrics) { - this.passFailMetrics = passFailMetrics; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java deleted file mode 100644 index fd2b1b6c0b64e..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/PassFailMetric.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The PassFailMetric model. */ -@Fluent -public final class PassFailMetric { - /* - * The client metric on which the criteria should be applied. Allowed values - ‘response_time_ms’ , ‘latency’, - * ‘error’, ‘requests’, ‘requests_per_sec’. - */ - @JsonProperty(value = "clientmetric") - private String clientmetric; - - /* - * The aggregation function to be applied on the client metric. Allowed functions - ‘percentage’ - for error metric - * ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and latency metric, ‘avg’ - for - * requests_per_sec, ‘count’ - for requests. - */ - @JsonProperty(value = "aggregate") - private String aggregate; - - /* - * The comparison operator. Supported types ‘>’ - */ - @JsonProperty(value = "condition") - private String condition; - - /* - * Request name for which the Pass fail criteria has to be applied. - */ - @JsonProperty(value = "requestName") - private String requestName; - - /* - * The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] unit- % ’, response_time_ms - * and latency : any integer value unit- ms. - */ - @JsonProperty(value = "value") - private Double value; - - /* - * Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. - */ - @JsonProperty(value = "action") - private String action; - - /* - * The actual value of the client metric for the test run. - */ - @JsonProperty(value = "actualValue", access = JsonProperty.Access.WRITE_ONLY) - private Double actualValue; - - /* - * Outcome of the test run. possible outcome - ‘passed’ , ‘failed’ , ‘undetermined’. - */ - @JsonProperty(value = "result", access = JsonProperty.Access.WRITE_ONLY) - private String result; - - /** - * Get the clientmetric property: The client metric on which the criteria should be applied. Allowed values - - * ‘response_time_ms’ , ‘latency’, ‘error’, ‘requests’, ‘requests_per_sec’. - * - * @return the clientmetric value. - */ - public String getClientmetric() { - return this.clientmetric; - } - - /** - * Set the clientmetric property: The client metric on which the criteria should be applied. Allowed values - - * ‘response_time_ms’ , ‘latency’, ‘error’, ‘requests’, ‘requests_per_sec’. - * - * @param clientmetric the clientmetric value to set. - * @return the PassFailMetric object itself. - */ - public PassFailMetric setClientmetric(String clientmetric) { - this.clientmetric = clientmetric; - return this; - } - - /** - * Get the aggregate property: The aggregation function to be applied on the client metric. Allowed functions - - * ‘percentage’ - for error metric ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and - * latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests. - * - * @return the aggregate value. - */ - public String getAggregate() { - return this.aggregate; - } - - /** - * Set the aggregate property: The aggregation function to be applied on the client metric. Allowed functions - - * ‘percentage’ - for error metric ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and - * latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests. - * - * @param aggregate the aggregate value to set. - * @return the PassFailMetric object itself. - */ - public PassFailMetric setAggregate(String aggregate) { - this.aggregate = aggregate; - return this; - } - - /** - * Get the condition property: The comparison operator. Supported types ‘>’. - * - * @return the condition value. - */ - public String getCondition() { - return this.condition; - } - - /** - * Set the condition property: The comparison operator. Supported types ‘>’. - * - * @param condition the condition value to set. - * @return the PassFailMetric object itself. - */ - public PassFailMetric setCondition(String condition) { - this.condition = condition; - return this; - } - - /** - * Get the requestName property: Request name for which the Pass fail criteria has to be applied. - * - * @return the requestName value. - */ - public String getRequestName() { - return this.requestName; - } - - /** - * Set the requestName property: Request name for which the Pass fail criteria has to be applied. - * - * @param requestName the requestName value to set. - * @return the PassFailMetric object itself. - */ - public PassFailMetric setRequestName(String requestName) { - this.requestName = requestName; - return this; - } - - /** - * Get the value property: The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] - * unit- % ’, response_time_ms and latency : any integer value unit- ms. - * - * @return the value value. - */ - public Double getValue() { - return this.value; - } - - /** - * Set the value property: The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] - * unit- % ’, response_time_ms and latency : any integer value unit- ms. - * - * @param value the value value to set. - * @return the PassFailMetric object itself. - */ - public PassFailMetric setValue(Double value) { - this.value = value; - return this; - } - - /** - * Get the action property: Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. - * - * @return the action value. - */ - public String getAction() { - return this.action; - } - - /** - * Set the action property: Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. - * - * @param action the action value to set. - * @return the PassFailMetric object itself. - */ - public PassFailMetric setAction(String action) { - this.action = action; - return this; - } - - /** - * Get the actualValue property: The actual value of the client metric for the test run. - * - * @return the actualValue value. - */ - public Double getActualValue() { - return this.actualValue; - } - - /** - * Get the result property: Outcome of the test run. possible outcome - ‘passed’ , ‘failed’ , ‘undetermined’. - * - * @return the result value. - */ - public String getResult() { - return this.result; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java deleted file mode 100644 index bf4dacd406060..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; - -/** The Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema model. */ -@Fluent -public final class Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema { - /* - * The file to be uploaded. - */ - @JsonProperty(value = "file", required = true) - private Flux file; - - /** - * Creates an instance of Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema class. - * - * @param file the file value to set. - */ - @JsonCreator - public Paths73K4RbLoadtestsTestidFilesFileidPutRequestbodyContentMultipartFormDataSchema( - @JsonProperty(value = "file", required = true) Flux file) { - this.file = file; - } - - /** - * Get the file property: The file to be uploaded. - * - * @return the file value. - */ - public Flux getFile() { - return this.file; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java deleted file mode 100644 index a01119f47e1a0..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ResourceMetricModel.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Associated metric definition for particular metrics of the azure resource ( Refer : - * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - */ -@Fluent -public final class ResourceMetricModel { - /* - * Unique identifier for metric. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Azure resource Id. - */ - @JsonProperty(value = "resourceId", required = true) - private String resourceId; - - /* - * Metric name space. - */ - @JsonProperty(value = "metricnamespace", required = true) - private String metricnamespace; - - /* - * Metric description. - */ - @JsonProperty(value = "displayDescription") - private String displayDescription; - - /* - * Metric name object. - */ - @JsonProperty(value = "name", required = true) - private ServerMetricName name; - - /* - * Metric aggregation. - */ - @JsonProperty(value = "aggregation", required = true) - private String aggregation; - - /* - * Metric unit. - */ - @JsonProperty(value = "unit") - private String unit; - - /* - * Azure resource type. - */ - @JsonProperty(value = "resourceType", required = true) - private String resourceType; - - /** - * Creates an instance of ResourceMetricModel class. - * - * @param resourceId the resourceId value to set. - * @param metricnamespace the metricnamespace value to set. - * @param name the name value to set. - * @param aggregation the aggregation value to set. - * @param resourceType the resourceType value to set. - */ - @JsonCreator - public ResourceMetricModel( - @JsonProperty(value = "resourceId", required = true) String resourceId, - @JsonProperty(value = "metricnamespace", required = true) String metricnamespace, - @JsonProperty(value = "name", required = true) ServerMetricName name, - @JsonProperty(value = "aggregation", required = true) String aggregation, - @JsonProperty(value = "resourceType", required = true) String resourceType) { - this.resourceId = resourceId; - this.metricnamespace = metricnamespace; - this.name = name; - this.aggregation = aggregation; - this.resourceType = resourceType; - } - - /** - * Get the id property: Unique identifier for metric. - * - * @return the id value. - */ - public String getId() { - return this.id; - } - - /** - * Get the resourceId property: Azure resource Id. - * - * @return the resourceId value. - */ - public String getResourceId() { - return this.resourceId; - } - - /** - * Get the metricnamespace property: Metric name space. - * - * @return the metricnamespace value. - */ - public String getMetricnamespace() { - return this.metricnamespace; - } - - /** - * Get the displayDescription property: Metric description. - * - * @return the displayDescription value. - */ - public String getDisplayDescription() { - return this.displayDescription; - } - - /** - * Set the displayDescription property: Metric description. - * - * @param displayDescription the displayDescription value to set. - * @return the ResourceMetricModel object itself. - */ - public ResourceMetricModel setDisplayDescription(String displayDescription) { - this.displayDescription = displayDescription; - return this; - } - - /** - * Get the name property: Metric name object. - * - * @return the name value. - */ - public ServerMetricName getName() { - return this.name; - } - - /** - * Get the aggregation property: Metric aggregation. - * - * @return the aggregation value. - */ - public String getAggregation() { - return this.aggregation; - } - - /** - * Get the unit property: Metric unit. - * - * @return the unit value. - */ - public String getUnit() { - return this.unit; - } - - /** - * Set the unit property: Metric unit. - * - * @param unit the unit value to set. - * @return the ResourceMetricModel object itself. - */ - public ResourceMetricModel setUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the resourceType property: Azure resource type. - * - * @return the resourceType value. - */ - public String getResourceType() { - return this.resourceType; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java deleted file mode 100644 index c917db6cb083b..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SecretMetadata.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SecretMetadata model. */ -@Fluent -public final class SecretMetadata { - /* - * The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE - */ - @JsonProperty(value = "value") - private String value; - - /* - * Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the value property: The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE. - * - * @return the value value. - */ - public String getValue() { - return this.value; - } - - /** - * Set the value property: The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE. - * - * @param value the value value to set. - * @return the SecretMetadata object itself. - */ - public SecretMetadata setValue(String value) { - this.value = value; - return this; - } - - /** - * Get the type property: Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE. - * - * @return the type value. - */ - public String getType() { - return this.type; - } - - /** - * Set the type property: Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE. - * - * @param type the type value to set. - * @return the SecretMetadata object itself. - */ - public SecretMetadata setType(String type) { - this.type = type; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java deleted file mode 100644 index f79156aacfcfe..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/Series.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The Series model. */ -@Fluent -public final class Series { - /* - * Active users time series data. - */ - @JsonProperty(value = "activeUsers") - private Map> activeUsers; - - /* - * Response time, time series data. - */ - @JsonProperty(value = "responseTime") - private Map> responseTime; - - /* - * Throughput time series data. - */ - @JsonProperty(value = "throughput") - private Map> throughput; - - /* - * Errors time series data. - */ - @JsonProperty(value = "errors") - private Map> errors; - - /** - * Get the activeUsers property: Active users time series data. - * - * @return the activeUsers value. - */ - public Map> getActiveUsers() { - return this.activeUsers; - } - - /** - * Set the activeUsers property: Active users time series data. - * - * @param activeUsers the activeUsers value to set. - * @return the Series object itself. - */ - public Series setActiveUsers(Map> activeUsers) { - this.activeUsers = activeUsers; - return this; - } - - /** - * Get the responseTime property: Response time, time series data. - * - * @return the responseTime value. - */ - public Map> getResponseTime() { - return this.responseTime; - } - - /** - * Set the responseTime property: Response time, time series data. - * - * @param responseTime the responseTime value to set. - * @return the Series object itself. - */ - public Series setResponseTime(Map> responseTime) { - this.responseTime = responseTime; - return this; - } - - /** - * Get the throughput property: Throughput time series data. - * - * @return the throughput value. - */ - public Map> getThroughput() { - return this.throughput; - } - - /** - * Set the throughput property: Throughput time series data. - * - * @param throughput the throughput value to set. - * @return the Series object itself. - */ - public Series setThroughput(Map> throughput) { - this.throughput = throughput; - return this; - } - - /** - * Get the errors property: Errors time series data. - * - * @return the errors value. - */ - public Map> getErrors() { - return this.errors; - } - - /** - * Set the errors property: Errors time series data. - * - * @param errors the errors value to set. - * @return the Series object itself. - */ - public Series setErrors(Map> errors) { - this.errors = errors; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java deleted file mode 100644 index d98943bfe3d3a..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricName.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metric name object. */ -@Fluent -public final class ServerMetricName { - /* - * Metric name value. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /* - * Metric localized name. - */ - @JsonProperty(value = "localizedValue", required = true) - private String localizedValue; - - /** - * Creates an instance of ServerMetricName class. - * - * @param value the value value to set. - * @param localizedValue the localizedValue value to set. - */ - @JsonCreator - public ServerMetricName( - @JsonProperty(value = "value", required = true) String value, - @JsonProperty(value = "localizedValue", required = true) String localizedValue) { - this.value = value; - this.localizedValue = localizedValue; - } - - /** - * Get the value property: Metric name value. - * - * @return the value value. - */ - public String getValue() { - return this.value; - } - - /** - * Get the localizedValue property: Metric localized name. - * - * @return the localizedValue value. - */ - public String getLocalizedValue() { - return this.localizedValue; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java deleted file mode 100644 index 1fbe5868da2da..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/ServerMetricsModel.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Server metrics config model. */ -@Fluent -public final class ServerMetricsModel { - /* - * Server metrics config name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * [Required, if testRunId is not given] Load test unique identifier - */ - @JsonProperty(value = "testId") - private String testId; - - /* - * [Required, if testId is not given] Load test run unique identifier - */ - @JsonProperty(value = "testRunId") - private String testRunId; - - /* - * Metrics map {metric id : metrics object} (Refer : - * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). - */ - @JsonProperty(value = "metrics") - private Map metrics; - - /** - * Get the name property: Server metrics config name. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * Get the testId property: [Required, if testRunId is not given] Load test unique identifier. - * - * @return the testId value. - */ - public String getTestId() { - return this.testId; - } - - /** - * Set the testId property: [Required, if testRunId is not given] Load test unique identifier. - * - * @param testId the testId value to set. - * @return the ServerMetricsModel object itself. - */ - public ServerMetricsModel setTestId(String testId) { - this.testId = testId; - return this; - } - - /** - * Get the testRunId property: [Required, if testId is not given] Load test run unique identifier. - * - * @return the testRunId value. - */ - public String getTestRunId() { - return this.testRunId; - } - - /** - * Set the testRunId property: [Required, if testId is not given] Load test run unique identifier. - * - * @param testRunId the testRunId value to set. - * @return the ServerMetricsModel object itself. - */ - public ServerMetricsModel setTestRunId(String testRunId) { - this.testRunId = testRunId; - return this; - } - - /** - * Get the metrics property: Metrics map {metric id : metrics object} (Refer : - * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). - * - * @return the metrics value. - */ - public Map getMetrics() { - return this.metrics; - } - - /** - * Set the metrics property: Metrics map {metric id : metrics object} (Refer : - * https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). - * - * @param metrics the metrics value to set. - * @return the ServerMetricsModel object itself. - */ - public ServerMetricsModel setMetrics(Map metrics) { - this.metrics = metrics; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java deleted file mode 100644 index 8497b87d0b7de..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/SupportedResourceType.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Supported azure resource types for App Component like Microsoft.LoadTestService/loadtests, Microsoft.ClassicCompute, - * Microsoft.ClassicStorage etc. (Refer for full list of available resource types in azure : - * https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types, some of them - * we are supporting for server side metrics configuration). - */ -@Fluent -public final class SupportedResourceType { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List getValue() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the SupportedResourceType object itself. - */ - public SupportedResourceType setValue(List value) { - this.value = value; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java deleted file mode 100644 index e232f5e199a56..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestArtifacts.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The TestArtifacts model. */ -@Fluent -public final class TestArtifacts { - /* - * The input artifacts for the test. - */ - @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.WRITE_ONLY) - private InputTestArtifacts inputArtifacts; - - /* - * The output artifacts for the test run. - */ - @JsonProperty(value = "outputArtifacts") - private OutputTestArtifacts outputArtifacts; - - /** - * Creates an instance of TestArtifacts class. - * - * @param inputArtifacts the inputArtifacts value to set. - */ - @JsonCreator - public TestArtifacts( - @JsonProperty(value = "inputArtifacts", required = true, access = JsonProperty.Access.WRITE_ONLY) - InputTestArtifacts inputArtifacts) { - this.inputArtifacts = inputArtifacts; - } - - /** - * Get the inputArtifacts property: The input artifacts for the test. - * - * @return the inputArtifacts value. - */ - public InputTestArtifacts getInputArtifacts() { - return this.inputArtifacts; - } - - /** - * Get the outputArtifacts property: The output artifacts for the test run. - * - * @return the outputArtifacts value. - */ - public OutputTestArtifacts getOutputArtifacts() { - return this.outputArtifacts; - } - - /** - * Set the outputArtifacts property: The output artifacts for the test run. - * - * @param outputArtifacts the outputArtifacts value to set. - * @return the TestArtifacts object itself. - */ - public TestArtifacts setOutputArtifacts(OutputTestArtifacts outputArtifacts) { - this.outputArtifacts = outputArtifacts; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java deleted file mode 100644 index 2618c24a5276d..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModel.java +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Load test model. */ -@Fluent -public final class TestModel { - /* - * Unique test name as identifier. - */ - @JsonProperty(value = "testId", access = JsonProperty.Access.WRITE_ONLY) - private String testId; - - /* - * The test description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Display name of a test. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Fully qualified resource Id e.g - * /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * The load test configuration. - */ - @JsonProperty(value = "loadTestConfig") - private LoadTestConfig loadTestConfig; - - /* - * Pass fail criteria for a test. - */ - @JsonProperty(value = "passFailCriteria") - private PassFailCriteria passFailCriteria; - - /* - * The created DateTime(ISO 8601 literal format) of the test model. - */ - @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDateTime; - - /* - * The user that created the test model. - */ - @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) - private String createdBy; - - /* - * The last Modified DateTime(ISO 8601 literal format) of the test model. - */ - @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedDateTime; - - /* - * The user that last modified the test model. - */ - @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) - private String lastModifiedBy; - - /* - * The input artifacts for the test. - */ - @JsonProperty(value = "inputArtifacts", access = JsonProperty.Access.WRITE_ONLY) - private InputTestArtifacts inputArtifacts; - - /* - * Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key - * Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored - * elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. - */ - @JsonProperty(value = "secrets") - private Map secrets; - - /* - * Environment variables which are defined as a set of pairs. - */ - @JsonProperty(value = "environmentVariables") - private Map environmentVariables; - - /* - * Subnet ID on which the load test instances should run. - */ - @JsonProperty(value = "subnetId") - private String subnetId; - - /* - * Type of the managed identity referencing the Key vault. - */ - @JsonProperty(value = "keyvaultReferenceIdentityType") - private String keyvaultReferenceIdentityType; - - /* - * Resource Id of the managed identity referencing the Key vault. - */ - @JsonProperty(value = "keyvaultReferenceIdentityId") - private String keyvaultReferenceIdentityId; - - /** - * Get the testId property: Unique test name as identifier. - * - * @return the testId value. - */ - public String getTestId() { - return this.testId; - } - - /** - * Get the description property: The test description. - * - * @return the description value. - */ - public String getDescription() { - return this.description; - } - - /** - * Set the description property: The test description. - * - * @param description the description value to set. - * @return the TestModel object itself. - */ - public TestModel setDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the displayName property: Display name of a test. - * - * @return the displayName value. - */ - public String getDisplayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of a test. - * - * @param displayName the displayName value to set. - * @return the TestModel object itself. - */ - public TestModel setDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the resourceId property: Fully qualified resource Id e.g - * /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - * - * @return the resourceId value. - */ - public String getResourceId() { - return this.resourceId; - } - - /** - * Get the loadTestConfig property: The load test configuration. - * - * @return the loadTestConfig value. - */ - public LoadTestConfig getLoadTestConfig() { - return this.loadTestConfig; - } - - /** - * Set the loadTestConfig property: The load test configuration. - * - * @param loadTestConfig the loadTestConfig value to set. - * @return the TestModel object itself. - */ - public TestModel setLoadTestConfig(LoadTestConfig loadTestConfig) { - this.loadTestConfig = loadTestConfig; - return this; - } - - /** - * Get the passFailCriteria property: Pass fail criteria for a test. - * - * @return the passFailCriteria value. - */ - public PassFailCriteria getPassFailCriteria() { - return this.passFailCriteria; - } - - /** - * Set the passFailCriteria property: Pass fail criteria for a test. - * - * @param passFailCriteria the passFailCriteria value to set. - * @return the TestModel object itself. - */ - public TestModel setPassFailCriteria(PassFailCriteria passFailCriteria) { - this.passFailCriteria = passFailCriteria; - return this; - } - - /** - * Get the createdDateTime property: The created DateTime(ISO 8601 literal format) of the test model. - * - * @return the createdDateTime value. - */ - public OffsetDateTime getCreatedDateTime() { - return this.createdDateTime; - } - - /** - * Get the createdBy property: The user that created the test model. - * - * @return the createdBy value. - */ - public String getCreatedBy() { - return this.createdBy; - } - - /** - * Get the lastModifiedDateTime property: The last Modified DateTime(ISO 8601 literal format) of the test model. - * - * @return the lastModifiedDateTime value. - */ - public OffsetDateTime getLastModifiedDateTime() { - return this.lastModifiedDateTime; - } - - /** - * Get the lastModifiedBy property: The user that last modified the test model. - * - * @return the lastModifiedBy value. - */ - public String getLastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Get the inputArtifacts property: The input artifacts for the test. - * - * @return the inputArtifacts value. - */ - public InputTestArtifacts getInputArtifacts() { - return this.inputArtifacts; - } - - /** - * Get the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is - * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If - * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. - * - * @return the secrets value. - */ - public Map getSecrets() { - return this.secrets; - } - - /** - * Set the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is - * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If - * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. - * - * @param secrets the secrets value to set. - * @return the TestModel object itself. - */ - public TestModel setSecrets(Map secrets) { - this.secrets = secrets; - return this; - } - - /** - * Get the environmentVariables property: Environment variables which are defined as a set of <name,value> - * pairs. - * - * @return the environmentVariables value. - */ - public Map getEnvironmentVariables() { - return this.environmentVariables; - } - - /** - * Set the environmentVariables property: Environment variables which are defined as a set of <name,value> - * pairs. - * - * @param environmentVariables the environmentVariables value to set. - * @return the TestModel object itself. - */ - public TestModel setEnvironmentVariables(Map environmentVariables) { - this.environmentVariables = environmentVariables; - return this; - } - - /** - * Get the subnetId property: Subnet ID on which the load test instances should run. - * - * @return the subnetId value. - */ - public String getSubnetId() { - return this.subnetId; - } - - /** - * Set the subnetId property: Subnet ID on which the load test instances should run. - * - * @param subnetId the subnetId value to set. - * @return the TestModel object itself. - */ - public TestModel setSubnetId(String subnetId) { - this.subnetId = subnetId; - return this; - } - - /** - * Get the keyvaultReferenceIdentityType property: Type of the managed identity referencing the Key vault. - * - * @return the keyvaultReferenceIdentityType value. - */ - public String getKeyvaultReferenceIdentityType() { - return this.keyvaultReferenceIdentityType; - } - - /** - * Set the keyvaultReferenceIdentityType property: Type of the managed identity referencing the Key vault. - * - * @param keyvaultReferenceIdentityType the keyvaultReferenceIdentityType value to set. - * @return the TestModel object itself. - */ - public TestModel setKeyvaultReferenceIdentityType(String keyvaultReferenceIdentityType) { - this.keyvaultReferenceIdentityType = keyvaultReferenceIdentityType; - return this; - } - - /** - * Get the keyvaultReferenceIdentityId property: Resource Id of the managed identity referencing the Key vault. - * - * @return the keyvaultReferenceIdentityId value. - */ - public String getKeyvaultReferenceIdentityId() { - return this.keyvaultReferenceIdentityId; - } - - /** - * Set the keyvaultReferenceIdentityId property: Resource Id of the managed identity referencing the Key vault. - * - * @param keyvaultReferenceIdentityId the keyvaultReferenceIdentityId value to set. - * @return the TestModel object itself. - */ - public TestModel setKeyvaultReferenceIdentityId(String keyvaultReferenceIdentityId) { - this.keyvaultReferenceIdentityId = keyvaultReferenceIdentityId; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java deleted file mode 100644 index e965cac8b2a04..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestModelResourceList.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Resources. */ -@Fluent -public final class TestModelResourceList { - /* - * List of Resources - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link for the next list of resources in case of paginated results, if applicable - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Creates an instance of TestModelResourceList class. - * - * @param value the value value to set. - */ - @JsonCreator - public TestModelResourceList(@JsonProperty(value = "value", required = true) List value) { - this.value = value; - } - - /** - * Get the value property: List of Resources. - * - * @return the value value. - */ - public List getValue() { - return this.value; - } - - /** - * Get the nextLink property: Link for the next list of resources in case of paginated results, if applicable. - * - * @return the nextLink value. - */ - public String getNextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link for the next list of resources in case of paginated results, if applicable. - * - * @param nextLink the nextLink value to set. - * @return the TestModelResourceList object itself. - */ - public TestModelResourceList setNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java deleted file mode 100644 index 610b9a2f1af85..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModel.java +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Load test run model. */ -@Fluent -public final class TestRunModel { - /* - * Unique test run name as identifier. - */ - @JsonProperty(value = "testRunId", access = JsonProperty.Access.WRITE_ONLY) - private String testRunId; - - /* - * Display name of a test run. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Associated test Id. - */ - @JsonProperty(value = "testId") - private String testId; - - /* - * Load test resource Id. - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * The test run description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The test run status. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The test run start DateTime(ISO 8601 literal format). - */ - @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startDateTime; - - /* - * The test run end DateTime(ISO 8601 literal format). - */ - @JsonProperty(value = "endDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endDateTime; - - /* - * The load test configuration. - */ - @JsonProperty(value = "loadTestConfig") - private LoadTestConfig loadTestConfig; - - /* - * Test result for pass/Fail criteria used during the test run. possible outcome - ‘Passed’ , ‘Failed’ , ‘Not - * Applicable’. - */ - @JsonProperty(value = "testResult", access = JsonProperty.Access.WRITE_ONLY) - private String testResult; - - /* - * Pass fail criteria for a test. - */ - @JsonProperty(value = "passFailCriteria") - private PassFailCriteria passFailCriteria; - - /* - * The testArtifacts property. - */ - @JsonProperty(value = "testArtifacts", access = JsonProperty.Access.WRITE_ONLY) - private TestArtifacts testArtifacts; - - /* - * Test run initiated time - */ - @JsonProperty(value = "executedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime executedDateTime; - - /* - * Number of virtual users, for which test has been run. - */ - @JsonProperty(value = "vusers", access = JsonProperty.Access.WRITE_ONLY) - private Integer vusers; - - /* - * Test run statistics - */ - @JsonProperty(value = "testRunStatistics", access = JsonProperty.Access.WRITE_ONLY) - private Map testRunStatistics; - - /* - * The created DateTime(ISO 8601 literal format) of the test run. - */ - @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDateTime; - - /* - * The user that created the test run. - */ - @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) - private String createdBy; - - /* - * The last updated DateTime(ISO 8601 literal format) of the test run. - */ - @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedDateTime; - - /* - * The user that updated the test run. - */ - @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) - private String lastModifiedBy; - - /* - * Portal url. - */ - @JsonProperty(value = "portalUrl", access = JsonProperty.Access.WRITE_ONLY) - private String portalUrl; - - /* - * Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key - * Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored - * elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. - */ - @JsonProperty(value = "secrets") - private Map secrets; - - /* - * Environment variables which are defined as a set of pairs. - */ - @JsonProperty(value = "environmentVariables") - private Map environmentVariables; - - /* - * Test run duration in milliseconds. - */ - @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY) - private Long duration; - - /* - * Subnet ID on which the load test instances should run. - */ - @JsonProperty(value = "subnetId", access = JsonProperty.Access.WRITE_ONLY) - private String subnetId; - - /** - * Get the testRunId property: Unique test run name as identifier. - * - * @return the testRunId value. - */ - public String getTestRunId() { - return this.testRunId; - } - - /** - * Get the displayName property: Display name of a test run. - * - * @return the displayName value. - */ - public String getDisplayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of a test run. - * - * @param displayName the displayName value to set. - * @return the TestRunModel object itself. - */ - public TestRunModel setDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the testId property: Associated test Id. - * - * @return the testId value. - */ - public String getTestId() { - return this.testId; - } - - /** - * Set the testId property: Associated test Id. - * - * @param testId the testId value to set. - * @return the TestRunModel object itself. - */ - public TestRunModel setTestId(String testId) { - this.testId = testId; - return this; - } - - /** - * Get the resourceId property: Load test resource Id. - * - * @return the resourceId value. - */ - public String getResourceId() { - return this.resourceId; - } - - /** - * Get the description property: The test run description. - * - * @return the description value. - */ - public String getDescription() { - return this.description; - } - - /** - * Set the description property: The test run description. - * - * @param description the description value to set. - * @return the TestRunModel object itself. - */ - public TestRunModel setDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the status property: The test run status. - * - * @return the status value. - */ - public String getStatus() { - return this.status; - } - - /** - * Get the startDateTime property: The test run start DateTime(ISO 8601 literal format). - * - * @return the startDateTime value. - */ - public OffsetDateTime getStartDateTime() { - return this.startDateTime; - } - - /** - * Get the endDateTime property: The test run end DateTime(ISO 8601 literal format). - * - * @return the endDateTime value. - */ - public OffsetDateTime getEndDateTime() { - return this.endDateTime; - } - - /** - * Get the loadTestConfig property: The load test configuration. - * - * @return the loadTestConfig value. - */ - public LoadTestConfig getLoadTestConfig() { - return this.loadTestConfig; - } - - /** - * Set the loadTestConfig property: The load test configuration. - * - * @param loadTestConfig the loadTestConfig value to set. - * @return the TestRunModel object itself. - */ - public TestRunModel setLoadTestConfig(LoadTestConfig loadTestConfig) { - this.loadTestConfig = loadTestConfig; - return this; - } - - /** - * Get the testResult property: Test result for pass/Fail criteria used during the test run. possible outcome - - * ‘Passed’ , ‘Failed’ , ‘Not Applicable’. - * - * @return the testResult value. - */ - public String getTestResult() { - return this.testResult; - } - - /** - * Get the passFailCriteria property: Pass fail criteria for a test. - * - * @return the passFailCriteria value. - */ - public PassFailCriteria getPassFailCriteria() { - return this.passFailCriteria; - } - - /** - * Set the passFailCriteria property: Pass fail criteria for a test. - * - * @param passFailCriteria the passFailCriteria value to set. - * @return the TestRunModel object itself. - */ - public TestRunModel setPassFailCriteria(PassFailCriteria passFailCriteria) { - this.passFailCriteria = passFailCriteria; - return this; - } - - /** - * Get the testArtifacts property: The testArtifacts property. - * - * @return the testArtifacts value. - */ - public TestArtifacts getTestArtifacts() { - return this.testArtifacts; - } - - /** - * Get the executedDateTime property: Test run initiated time. - * - * @return the executedDateTime value. - */ - public OffsetDateTime getExecutedDateTime() { - return this.executedDateTime; - } - - /** - * Get the vusers property: Number of virtual users, for which test has been run. - * - * @return the vusers value. - */ - public Integer getVusers() { - return this.vusers; - } - - /** - * Get the testRunStatistics property: Test run statistics. - * - * @return the testRunStatistics value. - */ - public Map getTestRunStatistics() { - return this.testRunStatistics; - } - - /** - * Get the createdDateTime property: The created DateTime(ISO 8601 literal format) of the test run. - * - * @return the createdDateTime value. - */ - public OffsetDateTime getCreatedDateTime() { - return this.createdDateTime; - } - - /** - * Get the createdBy property: The user that created the test run. - * - * @return the createdBy value. - */ - public String getCreatedBy() { - return this.createdBy; - } - - /** - * Get the lastModifiedDateTime property: The last updated DateTime(ISO 8601 literal format) of the test run. - * - * @return the lastModifiedDateTime value. - */ - public OffsetDateTime getLastModifiedDateTime() { - return this.lastModifiedDateTime; - } - - /** - * Get the lastModifiedBy property: The user that updated the test run. - * - * @return the lastModifiedBy value. - */ - public String getLastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Get the portalUrl property: Portal url. - * - * @return the portalUrl value. - */ - public String getPortalUrl() { - return this.portalUrl; - } - - /** - * Get the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is - * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If - * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. - * - * @return the secrets value. - */ - public Map getSecrets() { - return this.secrets; - } - - /** - * Set the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is - * stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If - * the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. - * - * @param secrets the secrets value to set. - * @return the TestRunModel object itself. - */ - public TestRunModel setSecrets(Map secrets) { - this.secrets = secrets; - return this; - } - - /** - * Get the environmentVariables property: Environment variables which are defined as a set of <name,value> - * pairs. - * - * @return the environmentVariables value. - */ - public Map getEnvironmentVariables() { - return this.environmentVariables; - } - - /** - * Set the environmentVariables property: Environment variables which are defined as a set of <name,value> - * pairs. - * - * @param environmentVariables the environmentVariables value to set. - * @return the TestRunModel object itself. - */ - public TestRunModel setEnvironmentVariables(Map environmentVariables) { - this.environmentVariables = environmentVariables; - return this; - } - - /** - * Get the duration property: Test run duration in milliseconds. - * - * @return the duration value. - */ - public Long getDuration() { - return this.duration; - } - - /** - * Get the subnetId property: Subnet ID on which the load test instances should run. - * - * @return the subnetId value. - */ - public String getSubnetId() { - return this.subnetId; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java deleted file mode 100644 index d5a82f6a7c4f6..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunModelResourceList.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Resources. */ -@Fluent -public final class TestRunModelResourceList { - /* - * List of Resources - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * Link for the next list of resources in case of paginated results, if applicable - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Creates an instance of TestRunModelResourceList class. - * - * @param value the value value to set. - */ - @JsonCreator - public TestRunModelResourceList(@JsonProperty(value = "value", required = true) List value) { - this.value = value; - } - - /** - * Get the value property: List of Resources. - * - * @return the value value. - */ - public List getValue() { - return this.value; - } - - /** - * Get the nextLink property: Link for the next list of resources in case of paginated results, if applicable. - * - * @return the nextLink value. - */ - public String getNextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link for the next list of resources in case of paginated results, if applicable. - * - * @param nextLink the nextLink value to set. - * @return the TestRunModelResourceList object itself. - */ - public TestRunModelResourceList setNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java deleted file mode 100644 index a338088ad19c9..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TestRunStatisticsModel.java +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Test run statistics. */ -@Immutable -public final class TestRunStatisticsModel { - /* - * Transaction name. - */ - @JsonProperty(value = "transaction", access = JsonProperty.Access.WRITE_ONLY) - private String transaction; - - /* - * Sampler count. - */ - @JsonProperty(value = "sampleCount", access = JsonProperty.Access.WRITE_ONLY) - private Double sampleCount; - - /* - * Error count. - */ - @JsonProperty(value = "errorCount", access = JsonProperty.Access.WRITE_ONLY) - private Double errorCount; - - /* - * Error percentage. - */ - @JsonProperty(value = "errorPct", access = JsonProperty.Access.WRITE_ONLY) - private Double errorPct; - - /* - * Mean response time. - */ - @JsonProperty(value = "meanResTime", access = JsonProperty.Access.WRITE_ONLY) - private Double meanResTime; - - /* - * Median response time. - */ - @JsonProperty(value = "medianResTime", access = JsonProperty.Access.WRITE_ONLY) - private Double medianResTime; - - /* - * Max response time. - */ - @JsonProperty(value = "maxResTime", access = JsonProperty.Access.WRITE_ONLY) - private Double maxResTime; - - /* - * Minimum response time. - */ - @JsonProperty(value = "minResTime", access = JsonProperty.Access.WRITE_ONLY) - private Double minResTime; - - /* - * 90 percentile response time. - */ - @JsonProperty(value = "pct1ResTime", access = JsonProperty.Access.WRITE_ONLY) - private Double pct1ResTime; - - /* - * 95 percentile response time. - */ - @JsonProperty(value = "pct2ResTime", access = JsonProperty.Access.WRITE_ONLY) - private Double pct2ResTime; - - /* - * 99 percentile response time. - */ - @JsonProperty(value = "pct3ResTime", access = JsonProperty.Access.WRITE_ONLY) - private Double pct3ResTime; - - /* - * Throughput. - */ - @JsonProperty(value = "throughput", access = JsonProperty.Access.WRITE_ONLY) - private Double throughput; - - /* - * Received network bytes. - */ - @JsonProperty(value = "receivedKBytesPerSec", access = JsonProperty.Access.WRITE_ONLY) - private Double receivedKBytesPerSec; - - /* - * Sent network bytes. - */ - @JsonProperty(value = "sentKBytesPerSec", access = JsonProperty.Access.WRITE_ONLY) - private Double sentKBytesPerSec; - - /** - * Get the transaction property: Transaction name. - * - * @return the transaction value. - */ - public String getTransaction() { - return this.transaction; - } - - /** - * Get the sampleCount property: Sampler count. - * - * @return the sampleCount value. - */ - public Double getSampleCount() { - return this.sampleCount; - } - - /** - * Get the errorCount property: Error count. - * - * @return the errorCount value. - */ - public Double getErrorCount() { - return this.errorCount; - } - - /** - * Get the errorPct property: Error percentage. - * - * @return the errorPct value. - */ - public Double getErrorPct() { - return this.errorPct; - } - - /** - * Get the meanResTime property: Mean response time. - * - * @return the meanResTime value. - */ - public Double getMeanResTime() { - return this.meanResTime; - } - - /** - * Get the medianResTime property: Median response time. - * - * @return the medianResTime value. - */ - public Double getMedianResTime() { - return this.medianResTime; - } - - /** - * Get the maxResTime property: Max response time. - * - * @return the maxResTime value. - */ - public Double getMaxResTime() { - return this.maxResTime; - } - - /** - * Get the minResTime property: Minimum response time. - * - * @return the minResTime value. - */ - public Double getMinResTime() { - return this.minResTime; - } - - /** - * Get the pct1ResTime property: 90 percentile response time. - * - * @return the pct1ResTime value. - */ - public Double getPct1ResTime() { - return this.pct1ResTime; - } - - /** - * Get the pct2ResTime property: 95 percentile response time. - * - * @return the pct2ResTime value. - */ - public Double getPct2ResTime() { - return this.pct2ResTime; - } - - /** - * Get the pct3ResTime property: 99 percentile response time. - * - * @return the pct3ResTime value. - */ - public Double getPct3ResTime() { - return this.pct3ResTime; - } - - /** - * Get the throughput property: Throughput. - * - * @return the throughput value. - */ - public Double getThroughput() { - return this.throughput; - } - - /** - * Get the receivedKBytesPerSec property: Received network bytes. - * - * @return the receivedKBytesPerSec value. - */ - public Double getReceivedKBytesPerSec() { - return this.receivedKBytesPerSec; - } - - /** - * Get the sentKBytesPerSec property: Sent network bytes. - * - * @return the sentKBytesPerSec value. - */ - public Double getSentKBytesPerSec() { - return this.sentKBytesPerSec; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java deleted file mode 100644 index f2c8876794026..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeRange.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The TimeRange model. */ -@Fluent -public final class TimeRange { - /* - * start DateTime(ISO 8601 literal format) for the requested client metrics filter. - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * end DateTime(ISO 8601 literal format) for the requested client metrics filter. - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /** - * Get the startTime property: start DateTime(ISO 8601 literal format) for the requested client metrics filter. - * - * @return the startTime value. - */ - public OffsetDateTime getStartTime() { - return this.startTime; - } - - /** - * Set the startTime property: start DateTime(ISO 8601 literal format) for the requested client metrics filter. - * - * @param startTime the startTime value to set. - * @return the TimeRange object itself. - */ - public TimeRange setStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: end DateTime(ISO 8601 literal format) for the requested client metrics filter. - * - * @return the endTime value. - */ - public OffsetDateTime getEndTime() { - return this.endTime; - } - - /** - * Set the endTime property: end DateTime(ISO 8601 literal format) for the requested client metrics filter. - * - * @param endTime the endTime value to set. - * @return the TimeRange object itself. - */ - public TimeRange setEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java deleted file mode 100644 index 708caf4aac6ec..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/TimeSeries.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.developer.loadtesting.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The TimeSeries model. */ -@Fluent -public final class TimeSeries { - /* - * Timestamp(ISO 8601 literal format). - */ - @JsonProperty(value = "timestamp") - private OffsetDateTime timestamp; - - /* - * Value at timestamp. - */ - @JsonProperty(value = "value") - private Double value; - - /** - * Get the timestamp property: Timestamp(ISO 8601 literal format). - * - * @return the timestamp value. - */ - public OffsetDateTime getTimestamp() { - return this.timestamp; - } - - /** - * Set the timestamp property: Timestamp(ISO 8601 literal format). - * - * @param timestamp the timestamp value to set. - * @return the TimeSeries object itself. - */ - public TimeSeries setTimestamp(OffsetDateTime timestamp) { - this.timestamp = timestamp; - return this; - } - - /** - * Get the value property: Value at timestamp. - * - * @return the value value. - */ - public Double getValue() { - return this.value; - } - - /** - * Set the value property: Value at timestamp. - * - * @param value the value value to set. - * @return the TimeSeries object itself. - */ - public TimeSeries setValue(Double value) { - this.value = value; - return this; - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java deleted file mode 100644 index b62f7aa3946c1..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the data models for LoadTestingClient. These APIs allow end users to create, view and run load - * tests using Azure Load Test Service. - */ -package com.azure.developer.loadtesting.implementation.models; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java index 960b20797e517..46c02485cca93 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java @@ -1,13 +1,5 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - module com.azure.developer.loadtesting { requires transitive com.azure.core; exports com.azure.developer.loadtesting; - - opens com.azure.developer.loadtesting.implementation.models to - com.azure.core, - com.fasterxml.jackson.databind; } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java index b690e096f9ff6..7d285f362f19b 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -9,14 +9,14 @@ import java.util.HashMap; import java.util.Map; +import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; public final class ReadmeSamples { public void createTest() { // BEGIN: java-readme-sample-createTest - TestClientBuilder testClientBuilder = new TestClientBuilder(); - TestClient testClient = testClientBuilder + LoadTestingClient client = new LoadTestingClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("") .buildClient(); @@ -36,29 +36,27 @@ public void createTest() { BinaryData test = BinaryData.fromObject(testMap); - BinaryData testOut = testClient.createOrUpdateTestWithResponse("test12345", test, null).getValue(); - System.out.println(testOut.toString()); + Response testOutResponse = client.getAdministration().createOrUpdateTestWithResponse("test12345", test, null); + System.out.println(testOutResponse.getValue().toString()); // END: java-readme-sample-createTest } public void uploadTestFile() throws IOException { // BEGIN: java-readme-sample-uploadTestFile - TestClientBuilder testClientBuilder = new TestClientBuilder(); - TestClient testClient = testClientBuilder + LoadTestingClient client = new LoadTestingClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("") .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - BinaryData fileUrlOut = testClient.uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null).getValue(); - System.out.println(fileUrlOut.toString()); + Response fileUrlOut = client.getAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); + System.out.println(fileUrlOut.getValue().toString()); // END: java-readme-sample-uploadTestFile } public void runTest() { // BEGIN: java-readme-sample-runTest - TestRunClientBuilder testRunClientBuilder = new TestRunClientBuilder(); - TestRunClient testRunClient = testRunClientBuilder + LoadTestingClient client = new LoadTestingClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("") .buildClient(); @@ -73,8 +71,8 @@ public void runTest() { BinaryData testRun = BinaryData.fromObject(testRunMap); - BinaryData testRunOut = testRunClient.createAndUpdateTestWithResponse("testrun12345", testRun, null).getValue(); - System.out.println(testRunOut.toString()); + Response testRunOut = client.getTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); + System.out.println(testRunOut.getValue().toString()); // END: java-readme-sample-runTest } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java index aa2b4e0833263..a809ef10a23ae 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java @@ -6,6 +6,8 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -13,11 +15,28 @@ public final class CreateAndUpdateTestRunTests extends LoadTestingClientTestBase private final String CREATE_TEST_RUN_BODY_JSON = "{\"testId\":\"" + DEFAULT_TEST_ID + "\"" + ",\"description\":\"Sample Test Run\",\"displayName\":\"Java SDK Sample Test Run\"}"; + private Map getTestRunBodyFromDict() { + Map testRunMap = new HashMap(); + testRunMap.put("testId", DEFAULT_TEST_ID); + testRunMap.put("displayName", "Java SDK Sample Test Run"); + testRunMap.put("description", "Sample Test Run"); + + return testRunMap; + } + @Test - public void simpleCreateAndUpdateTestRun() { + public void createAndUpdateTestRunString() { BinaryData file = BinaryData.fromString(CREATE_TEST_RUN_BODY_JSON); RequestOptions requestOptions = new RequestOptions(); - Response response = testRunClient.createAndUpdateTestWithResponse(DEFAULT_TEST_RUN_ID, file, requestOptions); + Response response = client.getTestRun().createAndUpdateTestRunWithResponse(DEFAULT_TEST_RUN_ID, file, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } + + @Test + public void createAndUpdateTestRunDict() { + BinaryData file = BinaryData.fromObject(getTestRunBodyFromDict()); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.getTestRun().createAndUpdateTestRunWithResponse(DEFAULT_TEST_RUN_ID, file, requestOptions); Assertions.assertEquals(200, response.getStatusCode()); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java index 55b44bdcef3ec..41b96f98c84b6 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java @@ -7,6 +7,8 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -15,11 +17,39 @@ public final class CreateOrUpdateTestTests extends LoadTestingClientTestBase { + "\"environmentVariables\":{\"threads_per_engine\":1,\"ramp_up_time\":0,\"duration_in_sec\":10,\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"}," + "\"loadTestConfig\":{\"engineInstances\":1}}"; + private Map getTestBodyFromDict() { + Map testMap = new HashMap(); + testMap.put("displayName", "Java SDK Sample Test"); + testMap.put("description", "Sample Test"); + + Map loadTestConfigMap = new HashMap(); + loadTestConfigMap.put("engineInstances", 1); + testMap.put("loadTestConfig", loadTestConfigMap); + + Map envVarMap = new HashMap(); + envVarMap.put("threads_per_engine", 1); + envVarMap.put("ramp_up_time", 0); + envVarMap.put("duration_in_sec", 10); + envVarMap.put("domain", "azure.microsoft.com"); + envVarMap.put("protocol", "https"); + testMap.put("environmentVariables", envVarMap); + + return testMap; + } + @Test - public void simpleCreateOrUpdateTest() { + public void createOrUpdateTestString() { BinaryData body = BinaryData.fromString(CREATE_TEST_BODY_JSON); RequestOptions requestOptions = new RequestOptions(); - Response response = testClient.createOrUpdateTestWithResponse(DEFAULT_TEST_ID, body, requestOptions); + Response response = client.getAdministration().createOrUpdateTestWithResponse(DEFAULT_TEST_ID, body, requestOptions); + Assertions.assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); + } + + @Test + public void createOrUpdateTestDictDict() { + BinaryData body = BinaryData.fromObject(getTestBodyFromDict()); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.getAdministration().createOrUpdateTestWithResponse(DEFAULT_TEST_ID, body, requestOptions); Assertions.assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java index f497da866b18f..5a5adb5998549 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java @@ -15,13 +15,7 @@ import reactor.core.publisher.Mono; class LoadTestingClientTestBase extends TestBase { - protected AppComponentClient appComponentClient; - - protected ServerMetricsClient serverMetricsClient; - - protected TestClient testClient; - - protected TestRunClient testRunClient; + protected LoadTestingClient client; private final String DEFAULT_ENDPOINT = "REDACTED.eus.cnt-prod.loadtesting.azure.com"; @@ -31,76 +25,22 @@ class LoadTestingClientTestBase extends TestBase { @Override protected void beforeTest() { - AppComponentClientBuilder appComponentClientbuilder = - new AppComponentClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - appComponentClientbuilder - .httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - appComponentClientbuilder - .addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - appComponentClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - appComponentClient = appComponentClientbuilder.buildClient(); - - ServerMetricsClientBuilder serverMetricsClientbuilder = - new ServerMetricsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - serverMetricsClientbuilder - .httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - serverMetricsClientbuilder - .addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - serverMetricsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - serverMetricsClient = serverMetricsClientbuilder.buildClient(); - - TestClientBuilder testClientbuilder = - new TestClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) - .httpClient(HttpClient.createDefault()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - testClientbuilder - .httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - testClientbuilder - .addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - testClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); - } - testClient = testClientbuilder.buildClient(); - - TestRunClientBuilder testRunClientbuilder = - new TestRunClientBuilder() + LoadTestingClientBuilder loadTestingClientBuilder = + new LoadTestingClientBuilder() .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { - testRunClientbuilder + loadTestingClientBuilder .httpClient(interceptorManager.getPlaybackClient()) .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); } else if (getTestMode() == TestMode.RECORD) { - testRunClientbuilder + loadTestingClientBuilder .addPolicy(interceptorManager.getRecordPolicy()) .credential(new DefaultAzureCredentialBuilder().build()); } else if (getTestMode() == TestMode.LIVE) { - testRunClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + loadTestingClientBuilder.credential(new DefaultAzureCredentialBuilder().build()); } - testRunClient = testRunClientbuilder.buildClient(); + client = loadTestingClientBuilder.buildClient(); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java index d80be47c6355e..3c0ee1e1c4be9 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java @@ -20,7 +20,7 @@ public final class UploadTestFileTests extends LoadTestingClientTestBase { public void uploadTestFile() throws IOException { BinaryData file = BinaryData.fromFile(new File(FILE_JMX_URL.getPath()).toPath()); RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); - Response response = testClient.uploadTestFileWithResponse( + Response response = client.getAdministration().uploadTestFileWithResponse( DEFAULT_TEST_ID, DEFAULT_FILE_ID, FILE_JXM_NAME, diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json new file mode 100644 index 0000000000000..3ac3bff70c438 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/testruns/33333333-1234-1234-1234-123456789012?api-version=2022-06-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", + "x-ms-client-request-id" : "1a4d27d7-794e-4642-9113-7e78b113161e", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "content-length" : "4731", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", + "X-Content-Type-Options" : "nosniff", + "Connection" : "keep-alive", + "mise-correlation-id" : "3203ef5c-413e-4dec-95cd-a52f0b1d949e", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"DONE\",\"startDateTime\":\"2022-09-16T12:48:39Z\",\"endDateTime\":\"2022-09-16T12:48:49Z\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"REDACTED\",\"fileId\":\"03352518-352d-4a88-8a19-079c15e552c2\",\"filename\":\"csv.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"},\"logsUrl\":{\"url\":\"REDACTED\",\"fileId\":\"2b1564a9-6dde-4d66-8162-a1158b30a83f\",\"filename\":\"logs.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"}}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":1,\"testRunStatistics\":{\"Homepage\":{\"transaction\":\"Homepage\",\"sampleCount\":1794.0,\"errorCount\":1694.0,\"errorPct\":94.0,\"meanResTime\":5.214046822742475,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":4.0,\"pct2ResTime\":25.0,\"pct3ResTime\":51.0,\"throughput\":199.33,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-0\":{\"transaction\":\"Homepage-0\",\"sampleCount\":101.0,\"errorCount\":0.0,\"errorPct\":0.0,\"meanResTime\":27.940594059405942,\"medianResTime\":31.0,\"maxResTime\":88.0,\"minResTime\":14.0,\"pct1ResTime\":36.0,\"pct2ResTime\":39.0,\"pct3ResTime\":50.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-1\":{\"transaction\":\"Homepage-1\",\"sampleCount\":101.0,\"errorCount\":1.0,\"errorPct\":0.0,\"meanResTime\":13.069306930693068,\"medianResTime\":10.0,\"maxResTime\":54.0,\"minResTime\":5.0,\"pct1ResTime\":20.0,\"pct2ResTime\":22.0,\"pct3ResTime\":24.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Total\":{\"transaction\":\"Total\",\"sampleCount\":1996.0,\"errorCount\":1695.0,\"errorPct\":84.0,\"meanResTime\":6.761523046092185,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":17.0,\"pct2ResTime\":34.0,\"pct3ResTime\":51.0,\"throughput\":221.78,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0}},\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":10000,\"subnetId\":null,\"errorDetails\":null}", + "Date" : "Wed, 21 Sep 2022 20:22:54 GMT", + "x-ms-correlation-request-id" : "1b2116f0-7a60-4995-8e33-c9cfb6258a5f", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json new file mode 100644 index 0000000000000..901cce845321d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/testruns/33333333-1234-1234-1234-123456789012?api-version=2022-06-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", + "x-ms-client-request-id" : "65b2214b-dc99-4c9d-949e-a35bda314b63", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "content-length" : "4725", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", + "X-Content-Type-Options" : "nosniff", + "Connection" : "keep-alive", + "mise-correlation-id" : "c9241f30-d35d-4a5b-8951-88b373a373a1", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"DONE\",\"startDateTime\":\"2022-09-16T12:48:39Z\",\"endDateTime\":\"2022-09-16T12:48:49Z\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"REDACTED\",\"fileId\":\"03352518-352d-4a88-8a19-079c15e552c2\",\"filename\":\"csv.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"},\"logsUrl\":{\"url\":\"REDACTED\",\"fileId\":\"2b1564a9-6dde-4d66-8162-a1158b30a83f\",\"filename\":\"logs.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"}}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":1,\"testRunStatistics\":{\"Homepage\":{\"transaction\":\"Homepage\",\"sampleCount\":1794.0,\"errorCount\":1694.0,\"errorPct\":94.0,\"meanResTime\":5.214046822742475,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":4.0,\"pct2ResTime\":25.0,\"pct3ResTime\":51.0,\"throughput\":199.33,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-0\":{\"transaction\":\"Homepage-0\",\"sampleCount\":101.0,\"errorCount\":0.0,\"errorPct\":0.0,\"meanResTime\":27.940594059405942,\"medianResTime\":31.0,\"maxResTime\":88.0,\"minResTime\":14.0,\"pct1ResTime\":36.0,\"pct2ResTime\":39.0,\"pct3ResTime\":50.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-1\":{\"transaction\":\"Homepage-1\",\"sampleCount\":101.0,\"errorCount\":1.0,\"errorPct\":0.0,\"meanResTime\":13.069306930693068,\"medianResTime\":10.0,\"maxResTime\":54.0,\"minResTime\":5.0,\"pct1ResTime\":20.0,\"pct2ResTime\":22.0,\"pct3ResTime\":24.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Total\":{\"transaction\":\"Total\",\"sampleCount\":1996.0,\"errorCount\":1695.0,\"errorPct\":84.0,\"meanResTime\":6.761523046092185,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":17.0,\"pct2ResTime\":34.0,\"pct3ResTime\":51.0,\"throughput\":221.78,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0}},\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":10000,\"subnetId\":null,\"errorDetails\":null}", + "Date" : "Wed, 21 Sep 2022 20:22:55 GMT", + "x-ms-correlation-request-id" : "c3934572-bb25-456f-8bd8-07b49f6cec69", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json deleted file mode 100644 index 8908fd0ea59d7..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.simpleCreateAndUpdateTestRun.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PATCH", - "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/testruns/33333333-1234-1234-1234-123456789012?api-version=2022-06-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "c446af66-2eb0-41f5-a482-1d2780688de6", - "Content-Type" : "application/merge-patch+json" - }, - "Response" : { - "content-length" : "2466", - "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", - "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", - "X-Content-Type-Options" : "nosniff", - "Connection" : "keep-alive", - "mise-correlation-id" : "e8217b5a-9818-43c0-9b7f-9da41019a9b7", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"ACCEPTED\",\"startDateTime\":null,\"endDateTime\":null,\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:57:59.8079697+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:57:59.8079697+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:57:59.8079697+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":null,\"logsUrl\":null}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":null,\"testRunStatistics\":null,\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2f7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":null,\"subnetId\":null,\"errorDetails\":null}", - "Date" : "Fri, 16 Sep 2022 12:47:59 GMT", - "x-ms-correlation-request-id" : "043f7468-76f5-445c-8d43-538a8e384395", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json new file mode 100644 index 0000000000000..c12ed7576ffa1 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012?api-version=2022-06-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", + "x-ms-client-request-id" : "dd8b74c4-e127-44f5-8922-693ec90bae99", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "content-length" : "1276", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", + "X-Content-Type-Options" : "nosniff", + "Connection" : "keep-alive", + "mise-correlation-id" : "9eca5390-b4a5-4478-9465-1b5786c69ea8", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:56.5669242+00:00\",\"validationStatus\":\"VALIDATION_INITIATED\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", + "Date" : "Wed, 21 Sep 2022 20:22:56 GMT", + "x-ms-correlation-request-id" : "069fcfe3-1d7c-4988-8455-da8335dc93f4", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json new file mode 100644 index 0000000000000..6d7bdb96b5e83 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json @@ -0,0 +1,27 @@ +{ + "networkCallRecords" : [ { + "Method" : "PATCH", + "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012?api-version=2022-06-01-preview", + "Headers" : { + "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", + "x-ms-client-request-id" : "9bc68615-6f14-4d96-9dc2-6cc4c254698a", + "Content-Type" : "application/merge-patch+json" + }, + "Response" : { + "content-length" : "1276", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", + "X-Content-Type-Options" : "nosniff", + "Connection" : "keep-alive", + "mise-correlation-id" : "5cf40290-c0e5-41b4-869a-5e5de254ec69", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:56.0544669+00:00\",\"validationStatus\":\"VALIDATION_INITIATED\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", + "Date" : "Wed, 21 Sep 2022 20:22:56 GMT", + "x-ms-correlation-request-id" : "bdcece66-bbdf-4577-9050-eb28ea71eb25", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json deleted file mode 100644 index 99cfe21bca273..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.simpleCreateOrUpdateTest.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "PATCH", - "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012?api-version=2022-06-01-preview", - "Headers" : { - "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "3bb20e4d-ee76-46c4-afbc-1293c0a52796", - "Content-Type" : "application/merge-patch+json" - }, - "Response" : { - "content-length" : "1276", - "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", - "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", - "X-Content-Type-Options" : "nosniff", - "Connection" : "keep-alive", - "mise-correlation-id" : "3c9b321b-519b-46e0-acea-b6efe3f7b8e8", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:58:00.6497577+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", - "Date" : "Fri, 16 Sep 2022 12:48:00 GMT", - "x-ms-correlation-request-id" : "03128932-816a-4dd2-8ad2-052daf8f31f5", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json index 8fa8f88950dbe..b84b017687bf2 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json @@ -4,21 +4,21 @@ "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012/files/22222222-1234-1234-1234-123456789012?api-version=2022-06-01-preview&fileType=2", "Headers" : { "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "5388f4f0-9bb3-4230-966e-56a0b58b85b5", - "Content-Type" : "multipart/form-data;boundary=----WebkitFormBoundary2871a4" + "x-ms-client-request-id" : "dc2233a4-bd01-4c62-adc1-ffc558b70f67", + "Content-Type" : "multipart/form-data;boundary=----WebkitFormBoundaryfb0748" }, "Response" : { - "content-length" : "411", + "content-length" : "412", "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", "X-Content-Type-Options" : "nosniff", "Connection" : "keep-alive", - "mise-correlation-id" : "b048adb5-cb74-46a1-930e-f76c2ce3985a", + "mise-correlation-id" : "92e9f78c-48e1-43bb-b52e-92dcc1e35e96", "retry-after" : "0", "StatusCode" : "201", - "Date" : "Fri, 16 Sep 2022 12:48:02 GMT", - "x-ms-correlation-request-id" : "03060620-e08d-4a60-8560-d64b31931b85", + "Date" : "Wed, 21 Sep 2022 20:22:57 GMT", + "x-ms-correlation-request-id" : "de2eb6d6-b9d9-4045-af1e-ef682449188f", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", - "Body" : "{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-16T12:58:02.020837\",\"validationStatus\":\"VALIDATION_INITIATED\"}", + "Body" : "{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:57.2856498\",\"validationStatus\":\"VALIDATION_INITIATED\"}", "Content-Type" : "application/json; charset=utf-8", "Location" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012/files/22222222-1234-1234-1234-123456789012?resourceId=%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk&api-version=2022-06-01-preview" }, diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index d07161ef84252..2b6b61c13c960 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -17,4 +17,17 @@ namespace: com.azure.developer.loadtesting partial-update: true service-versions: - 2022-06-01-preview +directive: +- from: swagger-document + where: '$.paths.*[?(@.tags=="AppComponent")]' + transform: > + $["operationId"] = $["operationId"].replace("AppComponent_", "LoadTestAdministration_"); +- from: swagger-document + where: '$.paths.*[?(@.tags=="ServerMetrics")]' + transform: > + $["operationId"] = $["operationId"].replace("ServerMetrics_", "LoadTestAdministration_"); +- from: swagger-document + where: '$.paths.*[?(@.tags=="Test")]' + transform: > + $["operationId"] = $["operationId"].replace("Test_", "LoadTestAdministration_"); ``` From 4b110779d0b5cd39f21a3f5b705fe0f68949b262 Mon Sep 17 00:00:00 2001 From: Harshan B Date: Thu, 22 Sep 2022 18:15:02 +0530 Subject: [PATCH 07/18] Prepend LoadTest to subclients accessor methods Update samples and test cases --- .../azure-developer-loadtesting/README.md | 6 +++--- .../loadtesting/LoadTestingAsyncClient.java | 4 ++-- .../developer/loadtesting/LoadTestingClient.java | 8 ++++---- .../azure/developer/loadtesting/ReadmeSamples.java | 6 +++--- .../loadtesting/CreateAndUpdateTestRunTests.java | 10 +++++----- .../loadtesting/CreateOrUpdateTestTests.java | 8 ++++---- .../loadtesting/LoadTestingClientTestBase.java | 10 +++++----- .../developer/loadtesting/UploadTestFileTests.java | 14 +++++++------- ...ateTestRunTests.CreateAndUpdateTestRunDict.json | 10 +++++----- ...eTestRunTests.CreateAndUpdateTestRunString.json | 12 ++++++------ ...UpdateTestTests.CreateOrUpdateTestDictDict.json | 12 ++++++------ ...OrUpdateTestTests.CreateOrUpdateTestString.json | 12 ++++++------ .../UploadTestFileTests.uploadTestFile.json | 12 ++++++------ 13 files changed, 62 insertions(+), 62 deletions(-) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index 5e74d9553cdc7..0546d49dd3027 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -120,7 +120,7 @@ testMap.put("environmentVariables", envVarMap); BinaryData test = BinaryData.fromObject(testMap); -Response testOutResponse = client.getAdministration().createOrUpdateTestWithResponse("test12345", test, null); +Response testOutResponse = client.getLoadTestAdministration().createOrUpdateTestWithResponse("test12345", test, null); System.out.println(testOutResponse.getValue().toString()); ``` @@ -133,7 +133,7 @@ LoadTestingClient client = new LoadTestingClientBuilder() .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); -Response fileUrlOut = client.getAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); +Response fileUrlOut = client.getLoadTestAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); System.out.println(fileUrlOut.getValue().toString()); ``` @@ -155,7 +155,7 @@ testRunMap.put("loadTestConfig", loadTestConfigMap); BinaryData testRun = BinaryData.fromObject(testRunMap); -Response testRunOut = client.getTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); +Response testRunOut = client.getLoadTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); System.out.println(testRunOut.getValue().toString()); ``` diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java index 05de4050e7a73..2d32627e26307 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java @@ -35,7 +35,7 @@ public final class LoadTestingAsyncClient { * * @return {@link LoadTestAdministrationAsyncClient} object. */ - public LoadTestAdministrationAsyncClient getAdministration() { + public LoadTestAdministrationAsyncClient getLoadTestAdministration() { return this.administration; } @@ -44,7 +44,7 @@ public LoadTestAdministrationAsyncClient getAdministration() { * * @return {@link TestRunAsyncClient} object. */ - public TestRunAsyncClient getTestRun() { + public TestRunAsyncClient getLoadTestRun() { return this.testRun; } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java index 96b19148b1ca5..76b733926196f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java @@ -25,8 +25,8 @@ public final class LoadTestingClient { * @param serviceClient the service client implementation. */ LoadTestingClient(LoadTestingAsyncClient client) { - this.administration = new LoadTestAdministrationClient(client.getAdministration()); - this.testRun = new TestRunClient(client.getTestRun()); + this.administration = new LoadTestAdministrationClient(client.getLoadTestAdministration()); + this.testRun = new TestRunClient(client.getLoadTestRun()); } /** @@ -34,7 +34,7 @@ public final class LoadTestingClient { * * @return {@link LoadTestAdministrationClient} object. */ - public LoadTestAdministrationClient getAdministration() { + public LoadTestAdministrationClient getLoadTestAdministration() { return this.administration; } @@ -43,7 +43,7 @@ public LoadTestAdministrationClient getAdministration() { * * @return {@link TestRunClient} object. */ - public TestRunClient getTestRun() { + public TestRunClient getLoadTestRun() { return this.testRun; } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java index 7d285f362f19b..4e54dfadb4025 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -36,7 +36,7 @@ public void createTest() { BinaryData test = BinaryData.fromObject(testMap); - Response testOutResponse = client.getAdministration().createOrUpdateTestWithResponse("test12345", test, null); + Response testOutResponse = client.getLoadTestAdministration().createOrUpdateTestWithResponse("test12345", test, null); System.out.println(testOutResponse.getValue().toString()); // END: java-readme-sample-createTest } @@ -49,7 +49,7 @@ public void uploadTestFile() throws IOException { .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - Response fileUrlOut = client.getAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); + Response fileUrlOut = client.getLoadTestAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); System.out.println(fileUrlOut.getValue().toString()); // END: java-readme-sample-uploadTestFile } @@ -71,7 +71,7 @@ public void runTest() { BinaryData testRun = BinaryData.fromObject(testRunMap); - Response testRunOut = client.getTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); + Response testRunOut = client.getLoadTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); System.out.println(testRunOut.getValue().toString()); // END: java-readme-sample-runTest } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java index a809ef10a23ae..54bd2e735d263 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java @@ -12,12 +12,12 @@ import org.junit.jupiter.api.Test; public final class CreateAndUpdateTestRunTests extends LoadTestingClientTestBase { - private final String CREATE_TEST_RUN_BODY_JSON = "{\"testId\":\"" + DEFAULT_TEST_ID + "\"" + private final String createTestRunBodyJson = "{\"testId\":\"" + defaultTestId + "\"" + ",\"description\":\"Sample Test Run\",\"displayName\":\"Java SDK Sample Test Run\"}"; private Map getTestRunBodyFromDict() { Map testRunMap = new HashMap(); - testRunMap.put("testId", DEFAULT_TEST_ID); + testRunMap.put("testId", defaultTestId); testRunMap.put("displayName", "Java SDK Sample Test Run"); testRunMap.put("description", "Sample Test Run"); @@ -26,9 +26,9 @@ private Map getTestRunBodyFromDict() { @Test public void createAndUpdateTestRunString() { - BinaryData file = BinaryData.fromString(CREATE_TEST_RUN_BODY_JSON); + BinaryData file = BinaryData.fromString(createTestRunBodyJson); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getTestRun().createAndUpdateTestRunWithResponse(DEFAULT_TEST_RUN_ID, file, requestOptions); + Response response = client.getLoadTestRun().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); Assertions.assertEquals(200, response.getStatusCode()); } @@ -36,7 +36,7 @@ public void createAndUpdateTestRunString() { public void createAndUpdateTestRunDict() { BinaryData file = BinaryData.fromObject(getTestRunBodyFromDict()); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getTestRun().createAndUpdateTestRunWithResponse(DEFAULT_TEST_RUN_ID, file, requestOptions); + Response response = client.getLoadTestRun().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); Assertions.assertEquals(200, response.getStatusCode()); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java index 41b96f98c84b6..5153d53697cf4 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java @@ -13,7 +13,7 @@ import org.junit.jupiter.api.Test; public final class CreateOrUpdateTestTests extends LoadTestingClientTestBase { - private final String CREATE_TEST_BODY_JSON = "{\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\"," + private final String createTestBodyJson = "{\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\"," + "\"environmentVariables\":{\"threads_per_engine\":1,\"ramp_up_time\":0,\"duration_in_sec\":10,\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"}," + "\"loadTestConfig\":{\"engineInstances\":1}}"; @@ -39,9 +39,9 @@ private Map getTestBodyFromDict() { @Test public void createOrUpdateTestString() { - BinaryData body = BinaryData.fromString(CREATE_TEST_BODY_JSON); + BinaryData body = BinaryData.fromString(createTestBodyJson); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getAdministration().createOrUpdateTestWithResponse(DEFAULT_TEST_ID, body, requestOptions); + Response response = client.getLoadTestAdministration().createOrUpdateTestWithResponse(defaultTestId, body, requestOptions); Assertions.assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); } @@ -49,7 +49,7 @@ public void createOrUpdateTestString() { public void createOrUpdateTestDictDict() { BinaryData body = BinaryData.fromObject(getTestBodyFromDict()); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getAdministration().createOrUpdateTestWithResponse(DEFAULT_TEST_ID, body, requestOptions); + Response response = client.getLoadTestAdministration().createOrUpdateTestWithResponse(defaultTestId, body, requestOptions); Assertions.assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java index 5a5adb5998549..8f36dff1dd0ac 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java @@ -17,17 +17,17 @@ class LoadTestingClientTestBase extends TestBase { protected LoadTestingClient client; - private final String DEFAULT_ENDPOINT = "REDACTED.eus.cnt-prod.loadtesting.azure.com"; + private final String defaultEndpoint = "REDACTED.eus.cnt-prod.loadtesting.azure.com"; - protected final String DEFAULT_TEST_ID = "11111111-1234-1234-1234-123456789012"; - protected final String DEFAULT_FILE_ID = "22222222-1234-1234-1234-123456789012"; - protected final String DEFAULT_TEST_RUN_ID = "33333333-1234-1234-1234-123456789012"; + protected final String defaultTestId = "11111111-1234-1234-1234-123456789012"; + protected final String defaultFileId = "22222222-1234-1234-1234-123456789012"; + protected final String defaultTestRunId = "33333333-1234-1234-1234-123456789012"; @Override protected void beforeTest() { LoadTestingClientBuilder loadTestingClientBuilder = new LoadTestingClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", DEFAULT_ENDPOINT)) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", defaultEndpoint)) .httpClient(HttpClient.createDefault()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); if (getTestMode() == TestMode.PLAYBACK) { diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java index 3c0ee1e1c4be9..b4b9dbc00008b 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java @@ -13,17 +13,17 @@ import org.junit.jupiter.api.Test; public final class UploadTestFileTests extends LoadTestingClientTestBase { - private final String FILE_JXM_NAME = "sample-JMX-file.jmx"; - private final URL FILE_JMX_URL = UploadTestFileTests.class.getClassLoader().getResource(FILE_JXM_NAME); + private final String fileJmxName = "sample-JMX-file.jmx"; + private final URL fileJmxUrl = UploadTestFileTests.class.getClassLoader().getResource(fileJmxName); @Test public void uploadTestFile() throws IOException { - BinaryData file = BinaryData.fromFile(new File(FILE_JMX_URL.getPath()).toPath()); + BinaryData file = BinaryData.fromFile(new File(fileJmxUrl.getPath()).toPath()); RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); - Response response = client.getAdministration().uploadTestFileWithResponse( - DEFAULT_TEST_ID, - DEFAULT_FILE_ID, - FILE_JXM_NAME, + Response response = client.getLoadTestAdministration().uploadTestFileWithResponse( + defaultTestId, + defaultFileId, + fileJmxName, file, requestOptions); Assertions.assertEquals(201, response.getStatusCode()); diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json index 3ac3bff70c438..0a71317221628 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json @@ -4,7 +4,7 @@ "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/testruns/33333333-1234-1234-1234-123456789012?api-version=2022-06-01-preview", "Headers" : { "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "1a4d27d7-794e-4642-9113-7e78b113161e", + "x-ms-client-request-id" : "12cfae38-1665-4b09-b786-bb51a67553c9", "Content-Type" : "application/merge-patch+json" }, "Response" : { @@ -13,12 +13,12 @@ "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", "X-Content-Type-Options" : "nosniff", "Connection" : "keep-alive", - "mise-correlation-id" : "3203ef5c-413e-4dec-95cd-a52f0b1d949e", + "mise-correlation-id" : "24eff5f4-3d07-44d4-b60d-c5b219c8a90b", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"DONE\",\"startDateTime\":\"2022-09-16T12:48:39Z\",\"endDateTime\":\"2022-09-16T12:48:49Z\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"REDACTED\",\"fileId\":\"03352518-352d-4a88-8a19-079c15e552c2\",\"filename\":\"csv.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"},\"logsUrl\":{\"url\":\"REDACTED\",\"fileId\":\"2b1564a9-6dde-4d66-8162-a1158b30a83f\",\"filename\":\"logs.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:54.1615876+00:00\",\"validationStatus\":\"\"}}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":1,\"testRunStatistics\":{\"Homepage\":{\"transaction\":\"Homepage\",\"sampleCount\":1794.0,\"errorCount\":1694.0,\"errorPct\":94.0,\"meanResTime\":5.214046822742475,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":4.0,\"pct2ResTime\":25.0,\"pct3ResTime\":51.0,\"throughput\":199.33,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-0\":{\"transaction\":\"Homepage-0\",\"sampleCount\":101.0,\"errorCount\":0.0,\"errorPct\":0.0,\"meanResTime\":27.940594059405942,\"medianResTime\":31.0,\"maxResTime\":88.0,\"minResTime\":14.0,\"pct1ResTime\":36.0,\"pct2ResTime\":39.0,\"pct3ResTime\":50.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-1\":{\"transaction\":\"Homepage-1\",\"sampleCount\":101.0,\"errorCount\":1.0,\"errorPct\":0.0,\"meanResTime\":13.069306930693068,\"medianResTime\":10.0,\"maxResTime\":54.0,\"minResTime\":5.0,\"pct1ResTime\":20.0,\"pct2ResTime\":22.0,\"pct3ResTime\":24.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Total\":{\"transaction\":\"Total\",\"sampleCount\":1996.0,\"errorCount\":1695.0,\"errorPct\":84.0,\"meanResTime\":6.761523046092185,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":17.0,\"pct2ResTime\":34.0,\"pct3ResTime\":51.0,\"throughput\":221.78,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0}},\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":10000,\"subnetId\":null,\"errorDetails\":null}", - "Date" : "Wed, 21 Sep 2022 20:22:54 GMT", - "x-ms-correlation-request-id" : "1b2116f0-7a60-4995-8e33-c9cfb6258a5f", + "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"DONE\",\"startDateTime\":\"2022-09-16T12:48:39Z\",\"endDateTime\":\"2022-09-16T12:48:49Z\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:44.7058466+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:44.7058466+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:44.7058466+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"REDACTED\",\"fileId\":\"03352518-352d-4a88-8a19-079c15e552c2\",\"filename\":\"csv.zip\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:44.7058466+00:00\",\"validationStatus\":\"\"},\"logsUrl\":{\"url\":\"REDACTED\",\"fileId\":\"2b1564a9-6dde-4d66-8162-a1158b30a83f\",\"filename\":\"logs.zip\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:44.7058466+00:00\",\"validationStatus\":\"\"}}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":1,\"testRunStatistics\":{\"Homepage\":{\"transaction\":\"Homepage\",\"sampleCount\":1794.0,\"errorCount\":1694.0,\"errorPct\":94.0,\"meanResTime\":5.214046822742475,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":4.0,\"pct2ResTime\":25.0,\"pct3ResTime\":51.0,\"throughput\":199.33,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-0\":{\"transaction\":\"Homepage-0\",\"sampleCount\":101.0,\"errorCount\":0.0,\"errorPct\":0.0,\"meanResTime\":27.940594059405942,\"medianResTime\":31.0,\"maxResTime\":88.0,\"minResTime\":14.0,\"pct1ResTime\":36.0,\"pct2ResTime\":39.0,\"pct3ResTime\":50.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-1\":{\"transaction\":\"Homepage-1\",\"sampleCount\":101.0,\"errorCount\":1.0,\"errorPct\":0.0,\"meanResTime\":13.069306930693068,\"medianResTime\":10.0,\"maxResTime\":54.0,\"minResTime\":5.0,\"pct1ResTime\":20.0,\"pct2ResTime\":22.0,\"pct3ResTime\":24.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Total\":{\"transaction\":\"Total\",\"sampleCount\":1996.0,\"errorCount\":1695.0,\"errorPct\":84.0,\"meanResTime\":6.761523046092185,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":17.0,\"pct2ResTime\":34.0,\"pct3ResTime\":51.0,\"throughput\":221.78,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0}},\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":10000,\"subnetId\":null,\"errorDetails\":null}", + "Date" : "Thu, 22 Sep 2022 14:12:44 GMT", + "x-ms-correlation-request-id" : "5245c655-6223-4fe9-9932-d1db1601c755", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json index 901cce845321d..9c73446462c0f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json @@ -4,21 +4,21 @@ "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/testruns/33333333-1234-1234-1234-123456789012?api-version=2022-06-01-preview", "Headers" : { "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "65b2214b-dc99-4c9d-949e-a35bda314b63", + "x-ms-client-request-id" : "5745287f-3148-4010-966c-6b6367cb6a59", "Content-Type" : "application/merge-patch+json" }, "Response" : { - "content-length" : "4725", + "content-length" : "4735", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", "X-Content-Type-Options" : "nosniff", "Connection" : "keep-alive", - "mise-correlation-id" : "c9241f30-d35d-4a5b-8951-88b373a373a1", + "mise-correlation-id" : "ea785b04-00cd-46a2-ba25-64c93a9442ec", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"DONE\",\"startDateTime\":\"2022-09-16T12:48:39Z\",\"endDateTime\":\"2022-09-16T12:48:49Z\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"REDACTED\",\"fileId\":\"03352518-352d-4a88-8a19-079c15e552c2\",\"filename\":\"csv.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"},\"logsUrl\":{\"url\":\"REDACTED\",\"fileId\":\"2b1564a9-6dde-4d66-8162-a1158b30a83f\",\"filename\":\"logs.zip\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:55.4196293+00:00\",\"validationStatus\":\"\"}}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":1,\"testRunStatistics\":{\"Homepage\":{\"transaction\":\"Homepage\",\"sampleCount\":1794.0,\"errorCount\":1694.0,\"errorPct\":94.0,\"meanResTime\":5.214046822742475,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":4.0,\"pct2ResTime\":25.0,\"pct3ResTime\":51.0,\"throughput\":199.33,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-0\":{\"transaction\":\"Homepage-0\",\"sampleCount\":101.0,\"errorCount\":0.0,\"errorPct\":0.0,\"meanResTime\":27.940594059405942,\"medianResTime\":31.0,\"maxResTime\":88.0,\"minResTime\":14.0,\"pct1ResTime\":36.0,\"pct2ResTime\":39.0,\"pct3ResTime\":50.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-1\":{\"transaction\":\"Homepage-1\",\"sampleCount\":101.0,\"errorCount\":1.0,\"errorPct\":0.0,\"meanResTime\":13.069306930693068,\"medianResTime\":10.0,\"maxResTime\":54.0,\"minResTime\":5.0,\"pct1ResTime\":20.0,\"pct2ResTime\":22.0,\"pct3ResTime\":24.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Total\":{\"transaction\":\"Total\",\"sampleCount\":1996.0,\"errorCount\":1695.0,\"errorPct\":84.0,\"meanResTime\":6.761523046092185,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":17.0,\"pct2ResTime\":34.0,\"pct3ResTime\":51.0,\"throughput\":221.78,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0}},\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":10000,\"subnetId\":null,\"errorDetails\":null}", - "Date" : "Wed, 21 Sep 2022 20:22:55 GMT", - "x-ms-correlation-request-id" : "c3934572-bb25-456f-8bd8-07b49f6cec69", + "Body" : "{\"testRunId\":\"33333333-1234-1234-1234-123456789012\",\"displayName\":\"Java SDK Sample Test Run\",\"testId\":\"11111111-1234-1234-1234-123456789012\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"description\":\"Sample Test Run\",\"status\":\"DONE\",\"startDateTime\":\"2022-09-16T12:48:39Z\",\"endDateTime\":\"2022-09-16T12:48:49Z\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"testResult\":\"NOT_APPLICABLE\",\"passFailCriteria\":null,\"testArtifacts\":{\"inputArtifacts\":{\"configUrl\":{\"url\":\"REDACTED\",\"fileId\":\"e480b12d-cad0-4071-b236-72ce70a6bf85\",\"filename\":\"config.yaml\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:45.3013994+00:00\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:45.3013994+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":{\"url\":\"REDACTED\",\"fileId\":\"1da610a8-8dd1-40b0-ae82-2509a8f03538\",\"filename\":\"inputartifacts.zip\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:45.3013994+00:00\",\"validationStatus\":\"\"},\"additionalUrls\":[]},\"outputArtifacts\":{\"resultUrl\":{\"url\":\"REDACTED\",\"fileId\":\"03352518-352d-4a88-8a19-079c15e552c2\",\"filename\":\"csv.zip\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:45.3013994+00:00\",\"validationStatus\":\"\"},\"logsUrl\":{\"url\":\"REDACTED\",\"fileId\":\"2b1564a9-6dde-4d66-8162-a1158b30a83f\",\"filename\":\"logs.zip\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:45.3013994+00:00\",\"validationStatus\":\"\"}}},\"executedDateTime\":\"2022-09-16T12:47:59.439Z\",\"vusers\":1,\"testRunStatistics\":{\"Homepage\":{\"transaction\":\"Homepage\",\"sampleCount\":1794.0,\"errorCount\":1694.0,\"errorPct\":94.0,\"meanResTime\":5.214046822742475,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":4.0,\"pct2ResTime\":25.0,\"pct3ResTime\":51.0,\"throughput\":199.33,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-0\":{\"transaction\":\"Homepage-0\",\"sampleCount\":101.0,\"errorCount\":0.0,\"errorPct\":0.0,\"meanResTime\":27.940594059405942,\"medianResTime\":31.0,\"maxResTime\":88.0,\"minResTime\":14.0,\"pct1ResTime\":36.0,\"pct2ResTime\":39.0,\"pct3ResTime\":50.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Homepage-1\":{\"transaction\":\"Homepage-1\",\"sampleCount\":101.0,\"errorCount\":1.0,\"errorPct\":0.0,\"meanResTime\":13.069306930693068,\"medianResTime\":10.0,\"maxResTime\":54.0,\"minResTime\":5.0,\"pct1ResTime\":20.0,\"pct2ResTime\":22.0,\"pct3ResTime\":24.0,\"throughput\":25.25,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0},\"Total\":{\"transaction\":\"Total\",\"sampleCount\":1996.0,\"errorCount\":1695.0,\"errorPct\":84.0,\"meanResTime\":6.761523046092185,\"medianResTime\":3.0,\"maxResTime\":143.0,\"minResTime\":2.0,\"pct1ResTime\":17.0,\"pct2ResTime\":34.0,\"pct3ResTime\":51.0,\"throughput\":221.78,\"receivedKBytesPerSec\":0.0,\"sentKBytesPerSec\":0.0}},\"createdDateTime\":\"2022-09-16T12:47:59.712Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:59.712Z\",\"lastModifiedBy\":null,\"portalUrl\":\"https://portal.azure.com/#blade/Microsoft_Azure_CloudNativeTesting/NewReport//resourceId/%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk/testId/11111111-1234-1234-1234-123456789012/testRunId/33333333-1234-1234-1234-123456789012\",\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"duration\":10000,\"subnetId\":null,\"errorDetails\":null}", + "Date" : "Thu, 22 Sep 2022 14:12:45 GMT", + "x-ms-correlation-request-id" : "a4a721c2-91e8-4b69-a451-9740a90911d1", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json index c12ed7576ffa1..66c388a67ed69 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json @@ -4,21 +4,21 @@ "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012?api-version=2022-06-01-preview", "Headers" : { "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "dd8b74c4-e127-44f5-8922-693ec90bae99", + "x-ms-client-request-id" : "6a3168d0-3777-45c6-93d7-123d539ca647", "Content-Type" : "application/merge-patch+json" }, "Response" : { - "content-length" : "1276", + "content-length" : "1274", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", "X-Content-Type-Options" : "nosniff", "Connection" : "keep-alive", - "mise-correlation-id" : "9eca5390-b4a5-4478-9465-1b5786c69ea8", + "mise-correlation-id" : "a4dcc1d9-6107-468a-9aee-f77984d9d5d4", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:56.5669242+00:00\",\"validationStatus\":\"VALIDATION_INITIATED\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", - "Date" : "Wed, 21 Sep 2022 20:22:56 GMT", - "x-ms-correlation-request-id" : "069fcfe3-1d7c-4988-8455-da8335dc93f4", + "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:46.4975631+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", + "Date" : "Thu, 22 Sep 2022 14:12:46 GMT", + "x-ms-correlation-request-id" : "bb792e69-698d-4570-b6fc-d0b0dd7193d8", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json index 6d7bdb96b5e83..c91f3b4a130a8 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json @@ -4,21 +4,21 @@ "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012?api-version=2022-06-01-preview", "Headers" : { "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "9bc68615-6f14-4d96-9dc2-6cc4c254698a", + "x-ms-client-request-id" : "42c3c726-dedb-4aec-a046-5625d0790f07", "Content-Type" : "application/merge-patch+json" }, "Response" : { - "content-length" : "1276", + "content-length" : "1272", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", "X-Content-Type-Options" : "nosniff", "Connection" : "keep-alive", - "mise-correlation-id" : "5cf40290-c0e5-41b4-869a-5e5de254ec69", + "mise-correlation-id" : "ee45e97f-8257-4ac2-98c6-f1bd1c246cef", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:56.0544669+00:00\",\"validationStatus\":\"VALIDATION_INITIATED\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", - "Date" : "Wed, 21 Sep 2022 20:22:56 GMT", - "x-ms-correlation-request-id" : "bdcece66-bbdf-4577-9050-eb28ea71eb25", + "Body" : "{\"testId\":\"11111111-1234-1234-1234-123456789012\",\"description\":\"Sample Test\",\"displayName\":\"Java SDK Sample Test\",\"resourceId\":\"/subscriptions/REDACTED/resourcegroups/loadtest-sdk/providers/microsoft.loadtestservice/loadtests/loadtestingsdk\",\"loadTestConfig\":{\"engineInstances\":1,\"splitAllCSVs\":null},\"passFailCriteria\":null,\"createdDateTime\":\"2022-09-16T12:47:01.824Z\",\"createdBy\":null,\"lastModifiedDateTime\":\"2022-09-16T12:47:01.824Z\",\"lastModifiedBy\":null,\"inputArtifacts\":{\"configUrl\":null,\"testScriptUrl\":{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:45.8823668+00:00\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":null,\"inputArtifactsZipFileurl\":null,\"additionalUrls\":[]},\"secrets\":null,\"environmentVariables\":{\"threads_per_engine\":\"1\",\"ramp_up_time\":\"0\",\"duration_in_sec\":\"10\",\"domain\":\"azure.microsoft.com\",\"protocol\":\"https\"},\"subnetId\":null,\"keyvaultReferenceIdentityType\":null,\"keyvaultReferenceIdentityId\":null}", + "Date" : "Thu, 22 Sep 2022 14:12:45 GMT", + "x-ms-correlation-request-id" : "f696341c-ac39-4e54-9c1f-9607c8046bed", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json index b84b017687bf2..de947d9c9e182 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/UploadTestFileTests.uploadTestFile.json @@ -4,21 +4,21 @@ "Uri" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012/files/22222222-1234-1234-1234-123456789012?api-version=2022-06-01-preview&fileType=2", "Headers" : { "User-Agent" : "azsdk-java-azure-developer-loadtesting/1.0.0-beta.1 (17.0.4; Windows 11; 10.0)", - "x-ms-client-request-id" : "dc2233a4-bd01-4c62-adc1-ffc558b70f67", - "Content-Type" : "multipart/form-data;boundary=----WebkitFormBoundaryfb0748" + "x-ms-client-request-id" : "add577c9-dd8b-4bbe-9609-019f07e2875b", + "Content-Type" : "multipart/form-data;boundary=----WebkitFormBoundary84aea3" }, "Response" : { "content-length" : "412", "api-supported-versions" : "2021-07-01-preview, 2022-06-01-preview", "X-Content-Type-Options" : "nosniff", "Connection" : "keep-alive", - "mise-correlation-id" : "92e9f78c-48e1-43bb-b52e-92dcc1e35e96", + "mise-correlation-id" : "d9c64a28-8b70-4259-a90e-63d6c0e1ef3d", "retry-after" : "0", "StatusCode" : "201", - "Date" : "Wed, 21 Sep 2022 20:22:57 GMT", - "x-ms-correlation-request-id" : "de2eb6d6-b9d9-4045-af1e-ef682449188f", + "Date" : "Thu, 22 Sep 2022 14:12:47 GMT", + "x-ms-correlation-request-id" : "c93f9281-0e56-40ef-b1de-ae681e0555de", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", - "Body" : "{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-21T20:32:57.2856498\",\"validationStatus\":\"VALIDATION_INITIATED\"}", + "Body" : "{\"url\":\"REDACTED\",\"fileId\":\"22222222-1234-1234-1234-123456789012\",\"filename\":\"sample-JMX-file.jmx\",\"fileType\":2,\"expireTime\":\"2022-09-22T14:22:47.13908\",\"validationStatus\":\"VALIDATION_INITIATED\"}", "Content-Type" : "application/json; charset=utf-8", "Location" : "https://REDACTED.eus.cnt-prod.loadtesting.azure.com/loadtests/11111111-1234-1234-1234-123456789012/files/22222222-1234-1234-1234-123456789012?resourceId=%2fsubscriptions%2fREDACTED%2fresourcegroups%2floadtest-sdk%2fproviders%2fmicrosoft.loadtestservice%2floadtests%2floadtestingsdk&api-version=2022-06-01-preview" }, From 7b2eaa9543df6fa0cf79e7d28db2a5f84433f238 Mon Sep 17 00:00:00 2001 From: Harshan B Date: Thu, 22 Sep 2022 22:44:42 +0530 Subject: [PATCH 08/18] Add TestRun opId rename directive --- sdk/loadtestservice/azure-developer-loadtesting/pom.xml | 2 +- .../loadtesting/LoadTestAdministrationAsyncClient.java | 6 ++---- .../developer/loadtesting/LoadTestAdministrationClient.java | 3 +-- .../azure-developer-loadtesting/swagger/README.md | 4 ++++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml index a7c21e6dbfa22..3af4b10f67432 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml +++ b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml @@ -72,7 +72,7 @@ com.azure azure-identity - 1.5.5 + 1.6.0 test diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index 66c51df6e14d3..6920067fe57a1 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -3,9 +3,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.developer.loadtesting; -import java.io.IOException; -import java.util.Random; - import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -20,7 +17,8 @@ import com.azure.core.util.BinaryData; import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; import com.azure.developer.loadtesting.implementation.util.MultipartHelper; - +import java.io.IOException; +import java.util.Random; import reactor.core.publisher.Mono; /** Initializes a new instance of the asynchronous LoadTestingClient type. */ diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index 95263135c59d5..4dc2b29aab9f6 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -3,8 +3,6 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.developer.loadtesting; -import java.io.IOException; - import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -17,6 +15,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import java.io.IOException; /** Initializes a new instance of the synchronous LoadTestingClient type. */ @ServiceClient(builder = LoadTestAdministrationClientBuilder.class) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index 2b6b61c13c960..7a723fc73cfee 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -18,6 +18,10 @@ partial-update: true service-versions: - 2022-06-01-preview directive: +- from: swagger-document + where: '$.paths["/testruns/{testRunId}"].patch' + transform: > + $["operationId"] = "TestRun_CreateAndUpdateTestRun"; - from: swagger-document where: '$.paths.*[?(@.tags=="AppComponent")]' transform: > From ff85cedfc05f382e5ed95c8da49c687b68ffb09d Mon Sep 17 00:00:00 2001 From: Harshan B Date: Tue, 27 Sep 2022 09:03:22 +0530 Subject: [PATCH 09/18] Remove Administration and TestRun builders --- .../LoadTestAdministrationAsyncClient.java | 2 - .../LoadTestAdministrationClient.java | 2 - .../LoadTestAdministrationClientBuilder.java | 303 ------------------ .../loadtesting/TestRunAsyncClient.java | 2 - .../developer/loadtesting/TestRunClient.java | 2 - .../loadtesting/TestRunClientBuilder.java | 302 ----------------- 6 files changed, 613 deletions(-) delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java delete mode 100644 sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index 6920067fe57a1..5d41efa984009 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.ClientAuthenticationException; import com.azure.core.exception.HttpResponseException; @@ -22,7 +21,6 @@ import reactor.core.publisher.Mono; /** Initializes a new instance of the asynchronous LoadTestingClient type. */ -@ServiceClient(builder = LoadTestAdministrationClientBuilder.class, isAsync = true) public final class LoadTestAdministrationAsyncClient { private static final Random RANDOM = new Random(); diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index 4dc2b29aab9f6..8ca7bcd552d0b 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.ClientAuthenticationException; import com.azure.core.exception.HttpResponseException; @@ -18,7 +17,6 @@ import java.io.IOException; /** Initializes a new instance of the synchronous LoadTestingClient type. */ -@ServiceClient(builder = LoadTestAdministrationClientBuilder.class) public final class LoadTestAdministrationClient { @Generated private final LoadTestAdministrationAsyncClient client; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java deleted file mode 100644 index e129ccc52c51e..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.developer.loadtesting; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the LoadTestAdministrationClient type. */ -@ServiceClientBuilder(serviceClients = {LoadTestAdministrationClient.class, LoadTestAdministrationAsyncClient.class}) -public final class LoadTestAdministrationClientBuilder - implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - EndpointTrait { - - @Generated private static final String SDK_NAME = "name"; - - @Generated private static final String SDK_VERSION = "version"; - - @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; - - @Generated - private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - - @Generated private final List pipelinePolicies; - - /** Create an instance of the LoadTestAdministrationClientBuilder. */ - @Generated - public LoadTestAdministrationClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a - * request. - */ - @Generated private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service - * client. - */ - @Generated private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public LoadTestAdministrationClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated private LoadTestingServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the LoadTestAdministrationClientBuilder. - */ - @Generated - public LoadTestAdministrationClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if - * applicable. - */ - @Generated private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the LoadTestAdministrationClientBuilder. - */ - @Generated - public LoadTestAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of LoadTestingClientImpl with the provided parameters. - * - * @return an instance of LoadTestingClientImpl. - */ - @Generated - private LoadTestingClientImpl buildInnerClient() { - if (pipeline == null) { - this.pipeline = createHttpPipeline(); - } - if (serviceVersion == null) { - this.serviceVersion = LoadTestingServiceVersion.getLatest(); - } - LoadTestingClientImpl client = - new LoadTestingClientImpl( - pipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } - if (clientOptions == null) { - clientOptions = new ClientOptions(); - } - List policies = new ArrayList<>(); - String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(clientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of LoadTestAdministrationAsyncClient class. - * - * @return an instance of LoadTestAdministrationAsyncClient. - */ - @Generated - public LoadTestAdministrationAsyncClient buildAsyncClient() { - return new LoadTestAdministrationAsyncClient(buildInnerClient().getLoadTestAdministrations()); - } - - /** - * Builds an instance of LoadTestAdministrationClient class. - * - * @return an instance of LoadTestAdministrationClient. - */ - @Generated - public LoadTestAdministrationClient buildClient() { - return new LoadTestAdministrationClient( - new LoadTestAdministrationAsyncClient(buildInnerClient().getLoadTestAdministrations())); - } -} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java index 776c0d238d9de..51a4fd0622594 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.ClientAuthenticationException; import com.azure.core.exception.HttpResponseException; @@ -19,7 +18,6 @@ import reactor.core.publisher.Mono; /** Initializes a new instance of the asynchronous LoadTestingClient type. */ -@ServiceClient(builder = TestRunClientBuilder.class, isAsync = true) public final class TestRunAsyncClient { @Generated private final TestRunsImpl serviceClient; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java index 039ec666f319a..f70a59b252567 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -5,7 +5,6 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.ClientAuthenticationException; import com.azure.core.exception.HttpResponseException; @@ -17,7 +16,6 @@ import com.azure.core.util.BinaryData; /** Initializes a new instance of the synchronous LoadTestingClient type. */ -@ServiceClient(builder = TestRunClientBuilder.class) public final class TestRunClient { @Generated private final TestRunAsyncClient client; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java deleted file mode 100644 index 71f5ddc81b091..0000000000000 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.developer.loadtesting; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.AddHeadersPolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.builder.ClientBuilderUtil; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** A builder for creating a new instance of the TestRunClient type. */ -@ServiceClientBuilder(serviceClients = {TestRunClient.class, TestRunAsyncClient.class}) -public final class TestRunClientBuilder - implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - EndpointTrait { - - @Generated private static final String SDK_NAME = "name"; - - @Generated private static final String SDK_VERSION = "version"; - - @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; - - @Generated - private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - - @Generated private final List pipelinePolicies; - - /** Create an instance of the TestRunClientBuilder. */ - @Generated - public TestRunClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated private HttpPipeline pipeline; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated private HttpClient httpClient; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated private HttpLogOptions httpLogOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a - * request. - */ - @Generated private ClientOptions clientOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated private RetryOptions retryOptions; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service - * client. - */ - @Generated private Configuration configuration; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated private TokenCredential tokenCredential; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated private String endpoint; - - /** {@inheritDoc}. */ - @Generated - @Override - public TestRunClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated private LoadTestingServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the TestRunClientBuilder. - */ - @Generated - public TestRunClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if - * applicable. - */ - @Generated private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the TestRunClientBuilder. - */ - @Generated - public TestRunClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of LoadTestingClientImpl with the provided parameters. - * - * @return an instance of LoadTestingClientImpl. - */ - @Generated - private LoadTestingClientImpl buildInnerClient() { - if (pipeline == null) { - this.pipeline = createHttpPipeline(); - } - if (serviceVersion == null) { - this.serviceVersion = LoadTestingServiceVersion.getLatest(); - } - LoadTestingClientImpl client = - new LoadTestingClientImpl( - pipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } - if (clientOptions == null) { - clientOptions = new ClientOptions(); - } - List policies = new ArrayList<>(); - String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { - policies.add(new AddHeadersPolicy(headers)); - } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(clientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of TestRunAsyncClient class. - * - * @return an instance of TestRunAsyncClient. - */ - @Generated - public TestRunAsyncClient buildAsyncClient() { - return new TestRunAsyncClient(buildInnerClient().getTestRuns()); - } - - /** - * Builds an instance of TestRunClient class. - * - * @return an instance of TestRunClient. - */ - @Generated - public TestRunClient buildClient() { - return new TestRunClient(new TestRunAsyncClient(buildInnerClient().getTestRuns())); - } -} From 8cca1c42d2ed56fa255d0bd41e30195e15616b88 Mon Sep 17 00:00:00 2001 From: Harshan B Date: Sun, 2 Oct 2022 23:45:30 +0530 Subject: [PATCH 10/18] Add simple methods without response Add doc for multipart utils Fix CODEOWNERS formatting --- .github/CODEOWNERS | 2 +- .../LoadTestAdministrationAsyncClient.java | 922 +++++++++++++++++- .../LoadTestAdministrationClient.java | 907 ++++++++++++++++- .../loadtesting/TestRunAsyncClient.java | 839 +++++++++++++--- .../developer/loadtesting/TestRunClient.java | 827 +++++++++++++--- .../implementation/util/MultipartHelper.java | 15 + .../swagger/README.md | 6 +- 7 files changed, 3158 insertions(+), 360 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index aa98bbff12bfe..5a94ba438aa32 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -90,7 +90,7 @@ /sdk/cosmos/azure-spring-data-cosmos-test/ @kushagraThapar @mbhaskar @backwind1233 @chenrujun @hui1110 @netyyyy @saragluna @stliu @yiliuTo @xinlian12 @moarychan # PRLabel: %Load Testing -/sdk/loadtestservice @Harshan01 @abranj1219 +/sdk/loadtestservice/ @Harshan01 @abranj1219 # ServiceLabel: %Device Update for IoT Hub %Service Attention /sdk/deviceupdate/ @dpokluda diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index 5d41efa984009..48914ade2e42d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -14,6 +14,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; import com.azure.developer.loadtesting.implementation.util.MultipartHelper; import java.io.IOException; @@ -100,6 +101,68 @@ public Mono> createOrUpdateAppComponentsWithResponse( return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions); } + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAppComponents(String name, BinaryData body) { + return this.serviceClient + .createOrUpdateAppComponentsWithResponseAsync(name, body, null) + .flatMap(FluxUtil::toMono); + } + /** * Delete an App Component. * @@ -117,6 +180,21 @@ public Mono> deleteAppComponentWithResponse(String name, RequestO return this.serviceClient.deleteAppComponentWithResponseAsync(name, requestOptions); } + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAppComponent(String name) { + return this.serviceClient.deleteAppComponentWithResponseAsync(name, null).flatMap(FluxUtil::toMono); + } + /** * Get App Component details by App Component name. * @@ -157,6 +235,43 @@ public Mono> getAppComponentByNameWithResponse(String name, return this.serviceClient.getAppComponentByNameWithResponseAsync(name, requestOptions); } + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAppComponentByName(String name) { + return this.serviceClient.getAppComponentByNameWithResponseAsync(name, null).flatMap(FluxUtil::toMono); + } + /** * Get App Components for a test or a test run by its name. * @@ -207,6 +322,104 @@ public Mono> getAppComponentWithResponse(RequestOptions req return this.serviceClient.getAppComponentWithResponseAsync(requestOptions); } + /** + * Get App Components for a test by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test by its name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAppComponentForTest(String testId) { + RequestOptions requestOptions = new RequestOptions().addQueryParam("testId", testId); + return this.serviceClient.getAppComponentWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get App Components for a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test run by its name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAppComponentForTestRun(String testRunId) { + RequestOptions requestOptions = new RequestOptions().addQueryParam("testRunId", testRunId); + return this.serviceClient.getAppComponentWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); + } + /** * Configure server metrics for a test or test run. * @@ -277,9 +490,9 @@ public Mono> createOrUpdateServerMetricsConfigWithResponse( } /** - * Get server metrics configuration by its name. + * Configure server metrics for a test or test run. * - *

Response Body Schema + *

Request Body Schema * *

{@code
      * {
@@ -304,51 +517,48 @@ public Mono> createOrUpdateServerMetricsConfigWithResponse(
      * }
      * }
* - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, requestOptions); - } - - /** - * Delete server metrics configuration by its name. + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
* * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param body Server metrics configuration model. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return server metrics config model on successful completion of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.deleteServerMetricsWithResponseAsync(name, requestOptions); + public Mono createOrUpdateServerMetricsConfig(String name, BinaryData body) { + return this.serviceClient + .createOrUpdateServerMetricsConfigWithResponseAsync(name, body, null) + .flatMap(FluxUtil::toMono); } /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get server metrics configuration by its name. * *

Response Body Schema * @@ -375,12 +585,138 @@ public Mono> deleteServerMetricsWithResponse(String name, Request * } * } * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful + * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, requestOptions); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getServerMetricsByName(String name) { + return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, null).flatMap(FluxUtil::toMono); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteServerMetricsWithResponseAsync(name, requestOptions); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteServerMetrics(String name) { + return this.serviceClient.deleteServerMetricsWithResponseAsync(name, null).flatMap(FluxUtil::toMono); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response} on successful * completion of {@link Mono}. */ @Generated @@ -389,6 +725,110 @@ public Mono> getServerMetricsWithResponse(RequestOptions re return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions); } + /** + * Get server metrics configuration for a test by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test by its name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getServerMetricsForTest(String testId) { + RequestOptions requestOptions = new RequestOptions().addQueryParam("testId", testId); + return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get server metrics configuration for a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test run by its name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getServerMetricsForTestRun(String testRunId) { + RequestOptions requestOptions = new RequestOptions().addQueryParam("testRunId", testRunId); + return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); + } + /** * Get all default server metrics configuration for supported resource types. * @@ -427,6 +867,69 @@ public Mono> getServerDefaultMetricsWithResponse(RequestOpt return this.serviceClient.getServerDefaultMetricsWithResponseAsync(requestOptions); } + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getServerDefaultMetrics() { + return this.serviceClient.getServerDefaultMetricsWithResponseAsync(null).flatMap(FluxUtil::toMono); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listSupportedResourceTypeWithResponseAsync(requestOptions); + } + /** * Get all supported resource types for App Components(Azure resource types). * @@ -434,24 +937,163 @@ public Mono> getServerDefaultMetricsWithResponse(RequestOpt * *
{@code
      * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listSupportedResourceType() { + return this.serviceClient.listSupportedResourceTypeWithResponseAsync(null).flatMap(FluxUtil::toMono); + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
      * }
      * }
* + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on - * successful completion of {@link Mono}. + * @return load test model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { - return this.serviceClient.listSupportedResourceTypeWithResponseAsync(requestOptions); + public Mono> createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateTestWithResponseAsync(testId, body, requestOptions); } /** @@ -581,18 +1223,15 @@ public Mono> listSupportedResourceTypeWithResponse(RequestO * * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. * @param body Load test model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response} on successful completion of {@link Mono}. + * @return load test model on successful completion of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateTestWithResponse( - String testId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateTestWithResponseAsync(testId, body, requestOptions); + public Mono createOrUpdateTest(String testId, BinaryData body) { + return this.serviceClient.createOrUpdateTestWithResponseAsync(testId, body, null).flatMap(FluxUtil::toMono); } /** @@ -612,6 +1251,21 @@ public Mono> deleteLoadTestWithResponse(String testId, RequestOpt return this.serviceClient.deleteLoadTestWithResponseAsync(testId, requestOptions); } + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLoadTest(String testId) { + return this.serviceClient.deleteLoadTestWithResponseAsync(testId, null).flatMap(FluxUtil::toMono); + } + /** * Get load test details by test name. * @@ -690,6 +1344,82 @@ public Mono> getLoadTestWithResponse(String testId, Request return this.serviceClient.getLoadTestWithResponseAsync(testId, requestOptions); } + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLoadTest(String testId) { + return this.serviceClient.getLoadTestWithResponseAsync(testId, null).flatMap(FluxUtil::toMono); + } + /** * 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 multipart/form-data. @@ -740,6 +1470,53 @@ public Mono> uploadTestFileWithResponse( return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions); } + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono uploadTestFile(String testId, String fileId, BinaryData file) { + return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, file, null).flatMap(FluxUtil::toMono); + } + /** * 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 multipart/form-data. @@ -830,6 +1607,35 @@ public Mono> getTestFileWithResponse( return this.serviceClient.getTestFileWithResponseAsync(testId, fileId, requestOptions); } + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestFile(String testId, String fileId) { + return this.serviceClient.getTestFileWithResponseAsync(testId, fileId, null).flatMap(FluxUtil::toMono); + } + /** * Delete file by the file name for a test. * @@ -849,6 +1655,22 @@ public Mono> deleteTestFileWithResponse( return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileId, requestOptions); } + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTestFile(String testId, String fileId) { + return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileId, null).flatMap(FluxUtil::toMono); + } + /** * Get all load tests by the fully qualified resource Id e.g * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index 8ca7bcd552d0b..03b9cfa23e9b8 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -94,6 +94,66 @@ public Response createOrUpdateAppComponentsWithResponse( return this.client.createOrUpdateAppComponentsWithResponse(name, body, requestOptions).block(); } + /** + * Associate an App Component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @param body App Component model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData createOrUpdateAppComponents(String name, BinaryData body) { + return this.client.createOrUpdateAppComponents(name, body).block(); + } + /** * Delete an App Component. * @@ -111,6 +171,21 @@ public Response deleteAppComponentWithResponse(String name, RequestOptions return this.client.deleteAppComponentWithResponse(name, requestOptions).block(); } + /** + * Delete an App Component. + * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Void deleteAppComponent(String name) { + return this.client.deleteAppComponent(name).block(); + } + /** * Get App Component details by App Component name. * @@ -150,6 +225,43 @@ public Response getAppComponentByNameWithResponse(String name, Reque return this.client.getAppComponentByNameWithResponse(name, requestOptions).block(); } + /** + * Get App Component details by App Component name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Component details by App Component name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getAppComponentByName(String name) { + return this.client.getAppComponentByName(name).block(); + } + /** * Get App Components for a test or a test run by its name. * @@ -199,6 +311,102 @@ public Response getAppComponentWithResponse(RequestOptions requestOp return this.client.getAppComponentWithResponse(requestOptions).block(); } + /** + * Get App Components for a test by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getAppComponentForTest(String testId) { + return this.client.getAppComponentForTest(testId).block(); + } + + /** + * Get App Components for a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Required)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return app Components for a test run by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getAppComponentForTestRun(String testRunId) { + return this.client.getAppComponentForTestRun(testRunId).block(); + } + /** * Configure server metrics for a test or test run. * @@ -269,9 +477,9 @@ public Response createOrUpdateServerMetricsConfigWithResponse( } /** - * Get server metrics configuration by its name. + * Configure server metrics for a test or test run. * - *

Response Body Schema + *

Request Body Schema * *

{@code
      * {
@@ -296,50 +504,46 @@ public Response createOrUpdateServerMetricsConfigWithResponse(
      * }
      * }
* - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { - return this.client.getServerMetricsByNameWithResponse(name, requestOptions).block(); - } - - /** - * Delete server metrics configuration by its name. + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
* * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param body Server metrics configuration model. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return server metrics config model. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { - return this.client.deleteServerMetricsWithResponse(name, requestOptions).block(); + public BinaryData createOrUpdateServerMetricsConfig(String name, BinaryData body) { + return this.client.createOrUpdateServerMetricsConfig(name, body).block(); } /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get server metrics configuration by its name. * *

Response Body Schema * @@ -366,12 +570,137 @@ public Response deleteServerMetricsWithResponse(String name, RequestOption * } * } * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name along with {@link Response}. + * @return server metrics configuration by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.client.getServerMetricsByNameWithResponse(name, requestOptions).block(); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getServerMetricsByName(String name) { + return this.client.getServerMetricsByName(name).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteServerMetricsWithResponse(name, requestOptions).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Void deleteServerMetrics(String name) { + return this.client.deleteServerMetrics(name).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -379,6 +708,108 @@ public Response getServerMetricsWithResponse(RequestOptions requestO return this.client.getServerMetricsWithResponse(requestOptions).block(); } + /** + * Get server metrics configuration for a test by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getServerMetricsForTest(String testId) { + return this.client.getServerMetricsForTest(testId).block(); + } + + /** + * Get server metrics configuration for a test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 value: String (Required)
+     *                 localizedValue: String (Required)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration for a test or test run by its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getServerMetricsForTestRun(String testRunId) { + return this.client.getServerMetricsForTestRun(testRunId).block(); + } + /** * Get all default server metrics configuration for supported resource types. * @@ -416,6 +847,67 @@ public Response getServerDefaultMetricsWithResponse(RequestOptions r return this.client.getServerDefaultMetricsWithResponse(requestOptions).block(); } + /** + * Get all default server metrics configuration for supported resource types. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     defaultMetrics (Optional): {
+     *         String (Optional): [
+     *              (Optional){
+     *                 metricnamespace: String (Optional)
+     *                 aggregation: String (Optional)
+     *                 name (Optional): {
+     *                     value: String (Optional)
+     *                     localizedValue: String (Optional)
+     *                 }
+     *                 unit: String (Optional)
+     *                 displayDescription: String (Optional)
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getServerDefaultMetrics() { + return this.client.getServerDefaultMetrics().block(); + } + + /** + * Get all supported resource types for App Components(Azure resource types). + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.client.listSupportedResourceTypeWithResponse(requestOptions).block(); + } + /** * Get all supported resource types for App Components(Azure resource types). * @@ -423,23 +915,162 @@ public Response getServerDefaultMetricsWithResponse(RequestOptions r * *
{@code
      * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData listSupportedResourceType() { + return this.client.listSupportedResourceType().block(); + } + + /** + * Create a new test or Update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
      * }
      * }
* + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. + * @return load test model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { - return this.client.listSupportedResourceTypeWithResponse(requestOptions).block(); + public Response createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateTestWithResponse(testId, body, requestOptions).block(); } /** @@ -569,18 +1200,15 @@ public Response listSupportedResourceTypeWithResponse(RequestOptions * * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. * @param body Load test model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response}. + * @return load test model. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateTestWithResponse( - String testId, BinaryData body, RequestOptions requestOptions) { - return this.client.createOrUpdateTestWithResponse(testId, body, requestOptions).block(); + public BinaryData createOrUpdateTest(String testId, BinaryData body) { + return this.client.createOrUpdateTest(testId, body).block(); } /** @@ -600,6 +1228,21 @@ public Response deleteLoadTestWithResponse(String testId, RequestOptions r return this.client.deleteLoadTestWithResponse(testId, requestOptions).block(); } + /** + * Delete a test by its name. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Void deleteLoadTest(String testId) { + return this.client.deleteLoadTest(testId).block(); + } + /** * Get load test details by test name. * @@ -678,6 +1321,82 @@ public Response getLoadTestWithResponse(String testId, RequestOption return this.client.getLoadTestWithResponse(testId, requestOptions).block(); } + /** + * Get load test details by test name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     resourceId: String (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getLoadTest(String testId) { + return this.client.getLoadTest(testId).block(); + } + /** * 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 multipart/form-data. @@ -728,6 +1447,53 @@ public Response uploadTestFileWithResponse( return this.client.uploadTestFileWithResponse(testId, fileId, file, requestOptions).block(); } + /** + * 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 multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * Flux
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file to be uploaded. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData uploadTestFileWithResponse(String testId, String fileId, BinaryData file) { + return this.client.uploadTestFile(testId, fileId, file).block(); + } + /** * 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 multipart/form-data. @@ -811,6 +1577,35 @@ public Response getTestFileWithResponse(String testId, String fileId return this.client.getTestFileWithResponse(testId, fileId, requestOptions).block(); } + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file by the file name + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getTestFile(String testId, String fileId) { + return this.client.getTestFile(testId, fileId).block(); + } + /** * Delete file by the file name for a test. * @@ -829,6 +1624,22 @@ public Response deleteTestFileWithResponse(String testId, String fileId, R return this.client.deleteTestFileWithResponse(testId, fileId, requestOptions).block(); } + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Void deleteTestFile(String testId, String fileId) { + return this.client.deleteTestFile(testId, fileId).block(); + } + /** * Get all load tests by the fully qualified resource Id e.g * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java index 51a4fd0622594..561f5e12c4b3c 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -14,6 +14,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; import com.azure.developer.loadtesting.implementation.TestRunsImpl; import reactor.core.publisher.Mono; @@ -49,6 +50,21 @@ public Mono> deleteTestRunWithResponse(String testRunId, RequestO return this.serviceClient.deleteTestRunWithResponseAsync(testRunId, requestOptions); } + /** + * Delete a test run by its name. + * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTestRun(String testRunId) { + return this.serviceClient.deleteTestRunWithResponseAsync(testRunId, null).flatMap(FluxUtil::toMono); + } + /** * Get test run details by name. * @@ -159,39 +175,7 @@ public Mono> getTestRunWithResponse(String testRunId, Reque } /** - * Get test run file by file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunFileWithResponse( - String testRunId, String fileId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions); - } - - /** - * Stop test run by name. + * Get test run details by name. * *

Response Body Schema * @@ -285,145 +269,83 @@ public Mono> getTestRunFileWithResponse( * } * } * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + * @return test run details by name on successful completion of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.stopTestRunWithResponseAsync(testRunId, requestOptions); + public Mono getTestRun(String testRunId) { + return this.serviceClient.getTestRunWithResponseAsync(testRunId, null).flatMap(FluxUtil::toMono); } /** - * Get all client metrics for a load test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
+ * Get test run file by file name. * *

Response Body Schema * *

{@code
      * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     }
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
      * }
      * }
* - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link - * Mono}. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunClientMetricsWithResponse( - String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions); + public Mono> getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions); } /** - * Get all filters that are supported for client metrics for a given load test run. + * Get test run file by file name. * *

Response Body Schema * *

{@code
      * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
      * }
      * }
* - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run along with {@link Response} - * on successful completion of {@link Mono}. + * @return test run file by file name on successful completion of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunClientMetricsFiltersWithResponse( - String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions); + public Mono getTestRunFile(String testRunId, String fileId) { + return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, null).flatMap(FluxUtil::toMono); } /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} + * Stop test run by name. * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
@@ -515,6 +437,23 @@ public Mono> getTestRunClientMetricsFiltersWithResponse(
      * }
      * }
* + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.stopTestRunWithResponseAsync(testRunId, requestOptions); + } + + /** + * Stop test run by name. + * *

Response Body Schema * *

{@code
@@ -608,19 +547,659 @@ public Mono> getTestRunClientMetricsFiltersWithResponse(
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopTestRun(String testRunId) { + return this.serviceClient.stopTestRunWithResponseAsync(testRunId, null).flatMap(FluxUtil::toMono); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link + * Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAndUpdateTestRunWithResponse( + public Mono> getTestRunClientMetricsWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createAndUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); + return this.serviceClient.getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestRunClientMetrics(String testRunId, BinaryData body) { + return this.serviceClient + .getTestRunClientMetricsWithResponseAsync(testRunId, body, null) + .flatMap(FluxUtil::toMono); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestRunClientMetricsFilters(String testRunId) { + return this.serviceClient + .getTestRunClientMetricsFiltersWithResponseAsync(testRunId, null) + .flatMap(FluxUtil::toMono); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAndUpdateTestRunWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createAndUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAndUpdateTestRun(String testRunId, BinaryData body) { + return this.serviceClient + .createAndUpdateTestRunWithResponseAsync(testRunId, body, null) + .flatMap(FluxUtil::toMono); } /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java index f70a59b252567..554e2d5413a68 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -47,6 +47,21 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions return this.client.deleteTestRunWithResponse(testRunId, requestOptions).block(); } + /** + * Delete a test run by its name. + * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return Void. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Void deleteTestRun(String testRunId) { + return this.client.deleteTestRun(testRunId).block(); + } + /** * Get test run details by name. * @@ -157,39 +172,7 @@ public Response getTestRunWithResponse(String testRunId, RequestOpti } /** - * Get test run file by file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunFileWithResponse( - String testRunId, String fileId, RequestOptions requestOptions) { - return this.client.getTestRunFileWithResponse(testRunId, fileId, requestOptions).block(); - } - - /** - * Stop test run by name. + * Get test run details by name. * *

Response Body Schema * @@ -283,143 +266,83 @@ public Response getTestRunFileWithResponse( * } * } * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response}. + * @return test run details by name. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); + public BinaryData getTestRun(String testRunId) { + return this.client.getTestRun(testRunId).block(); } /** - * Get all client metrics for a load test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
+ * Get test run file by file name. * *

Response Body Schema * *

{@code
      * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     }
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
      * }
      * }
* - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run along with {@link Response}. + * @return test run file by file name along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunClientMetricsWithResponse( - String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.client.getTestRunClientMetricsWithResponse(testRunId, body, requestOptions).block(); + public Response getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.client.getTestRunFileWithResponse(testRunId, fileId, requestOptions).block(); } /** - * Get all filters that are supported for client metrics for a given load test run. + * Get test run file by file name. * *

Response Body Schema * *

{@code
      * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
      * }
      * }
* - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. + * @return test run file by file name. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunClientMetricsFiltersWithResponse( - String testRunId, RequestOptions requestOptions) { - return this.client.getTestRunClientMetricsFiltersWithResponse(testRunId, requestOptions).block(); + public BinaryData getTestRunFile(String testRunId, String fileId) { + return this.client.getTestRunFile(testRunId, fileId).block(); } /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} + * Stop test run by name. * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
@@ -511,6 +434,23 @@ public Response getTestRunClientMetricsFiltersWithResponse(
      * }
      * }
* + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); + } + + /** + * Stop test run by name. + * *

Response Body Schema * *

{@code
@@ -604,19 +544,650 @@ public Response getTestRunClientMetricsFiltersWithResponse(
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData stopTestRun(String testRunId) { + return this.client.stopTestRun(testRunId).block(); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response}. + * @return all client metrics for a load test run along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAndUpdateTestRunWithResponse( + public Response getTestRunClientMetricsWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.client.createAndUpdateTestRunWithResponse(testRunId, body, requestOptions).block(); + return this.client.getTestRunClientMetricsWithResponse(testRunId, body, requestOptions).block(); + } + + /** + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all client metrics for a load test run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getTestRunClientMetrics(String testRunId, BinaryData body) { + return this.client.getTestRunClientMetrics(testRunId, body).block(); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.client.getTestRunClientMetricsFiltersWithResponse(testRunId, requestOptions).block(); + } + + /** + * Get all filters that are supported for client metrics for a given load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
+     * }
+     * }
+ * + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all filters that are supported for client metrics for a given load test run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getTestRunClientMetricsFiltersWithResponse(String testRunId) { + return this.client.getTestRunClientMetricsFilters(testRunId).block(); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAndUpdateTestRunWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.client.createAndUpdateTestRunWithResponse(testRunId, body, requestOptions).block(); + } + + /** + * Create and start a new test run with the given name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     testRunId: String (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     resourceId: String (Optional)
+     *     description: String (Optional)
+     *     status: String (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *     }
+     *     testResult: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Optional): {
+     *                 clientmetric: String (Optional)
+     *                 aggregate: String (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String (Optional)
+     *             }
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(0/1/2) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     vusers: Integer (Optional)
+     *     testRunStatistics (Optional): {
+     *         String (Optional): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     *     portalUrl: String (Optional)
+     *     secrets (Optional): {
+     *         String (Optional): {
+     *             value: String (Optional)
+     *             type: String (Optional)
+     *         }
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Optional)
+     *     }
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Load test run model. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData createAndUpdateTestRun(String testRunId, BinaryData body) { + return this.client.createAndUpdateTestRun(testRunId, body).block(); } /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java index 0cd7b3c81f983..c204768fd135c 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/util/MultipartHelper.java @@ -15,10 +15,25 @@ public final class MultipartHelper { private static final char LF = (char) 0x0A; private static final String NEWLINE = "" + CR + LF; + /** + * Create Multipart boundary using suffix. + * + * @param boundarySuffix Suffix to be added to multipart boundary, must be a valid URL character ^[a-z0-9_-]*$. + * @return the Multipart boundary {@link String}. + */ public static String getMultipartBoundary(String boundarySuffix) { return "----WebkitFormBoundary" + boundarySuffix; } + /** + * Delete an App Component. + * + * @param fileName Name of the file, must be a valid URL character ^[a-z0-9_-]*$. + * @param file The file as BinaryData to be used as multipart body of request. + * @param boundary The Multipart boundary used in the request body. + * @throws IOException thrown if error occurs while writing to byte stream. + * @return the Multipart request body as {@link BinaryData} encoded as UTF-8. + */ public static BinaryData createMultipartBodyFromFile(String fileName, BinaryData file, String boundary) throws IOException { ByteArrayOutputStream bodyByteStream = new ByteArrayOutputStream(); bodyByteStream.write(("--" + boundary + NEWLINE).getBytes("UTF-8")); diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index 7a723fc73cfee..6e40efea3ac39 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -2,19 +2,19 @@ ```yaml require: https://github.com/Azure/azure-rest-api-specs/blob/9401446f22177696d920cf110893a0de7452ee9e/specification/loadtestservice/data-plane/readme.md -output-folder: ../ java: true regenerate-pom: false title: LoadTestingClient security: AADToken security-scopes: https://loadtest.azure-dev.com/.default data-plane: true +generate-models: false +generate-samples: false generate-tests: false -generate-models: true artifact-id: azure-developer-loadtesting -generate-samples: false namespace: com.azure.developer.loadtesting partial-update: true +output-folder: $(azure-sdk-for-java-folder)/sdk/loadtestservice/azure-developer-loadtesting service-versions: - 2022-06-01-preview directive: From 5a9ba48be07d381844bfddb859786d0d00e750bd Mon Sep 17 00:00:00 2001 From: Harshan B Date: Sat, 8 Oct 2022 01:12:08 +0530 Subject: [PATCH 11/18] Main version_client.txt from main --- eng/versioning/version_client.txt | 307 +++++++++++++++--------------- 1 file changed, 157 insertions(+), 150 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e68a079afd4ec..0551b8915a99a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -37,19 +37,19 @@ com.azure:azure-sdk-all;1.0.0;1.0.0 com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-anomalydetector;3.0.0-beta.4;3.0.0-beta.5 -com.azure:azure-ai-formrecognizer;4.0.0-beta.6;4.0.0-beta.7 +com.azure:azure-ai-formrecognizer;4.0.0;4.1.0-beta.1 com.azure:azure-ai-formrecognizer-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-ai-personalizer;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-ai-personalizer;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-ai-documenttranslator;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-ai-metricsadvisor;1.1.6;1.2.0-beta.1 +com.azure:azure-ai-metricsadvisor;1.1.7;1.2.0-beta.1 com.azure:azure-ai-metricsadvisor-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-ai-textanalytics;5.1.12;5.2.0-beta.5 +com.azure:azure-ai-textanalytics;5.2.0;5.3.0-beta.1 com.azure:azure-ai-textanalytics-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-analytics-purview-catalog;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-analytics-purview-scanning;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-analytics-purview-administration;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-analytics-synapse-accesscontrol;1.0.0-beta.4;1.0.0-beta.5 -com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.10;1.0.0-beta.11 +com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.11;1.0.0-beta.12 com.azure:azure-analytics-synapse-spark;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.3;1.0.0-beta.4 @@ -57,203 +57,205 @@ com.azure:azure-aot-graalvm-support;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-aot-graalvm-support-netty;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-aot-graalvm-samples;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-aot-graalvm-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-communication-chat;1.3.0;1.4.0-beta.1 +com.azure:azure-communication-chat;1.3.1;1.4.0-beta.1 com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5 -com.azure:azure-communication-common;1.2.0;1.3.0-beta.2 +com.azure:azure-communication-callautomation;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-communication-common;1.2.1;1.2.2 com.azure:azure-communication-common-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-communication-sms;1.1.5;1.2.0-beta.1 -com.azure:azure-communication-identity;1.3.0;1.4.0-beta.1 -com.azure:azure-communication-phonenumbers;1.0.13;1.1.0-beta.10 +com.azure:azure-communication-sms;1.1.6;1.2.0-beta.1 +com.azure:azure-communication-identity;1.3.1;1.4.0-beta.1 +com.azure:azure-communication-phonenumbers;1.0.15;1.1.0-beta.11 com.azure:azure-communication-networktraversal;1.1.0-beta.2;1.1.0-beta.3 +com.azure:azure-communication-jobrouter;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-rooms;1.0.0-beta.2;1.0.0-beta.3 -com.azure:azure-containers-containerregistry;1.0.7;1.1.0-beta.2 +com.azure:azure-containers-containerregistry;1.0.8;1.1.0-beta.2 com.azure:azure-containers-containerregistry-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core;1.31.0;1.32.0-beta.1 -com.azure:azure-core-amqp;2.7.0;2.8.0-beta.1 +com.azure:azure-core;1.32.0;1.33.0 +com.azure:azure-core-amqp;2.7.1;2.7.2 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-experimental;1.0.0-beta.31;1.0.0-beta.32 +com.azure:azure-core-experimental;1.0.0-beta.32;1.0.0-beta.33 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.12.4;1.13.0-beta.1 -com.azure:azure-core-http-okhttp;1.11.1;1.12.0-beta.1 +com.azure:azure-core-http-netty;1.12.5;1.12.6 +com.azure:azure-core-http-okhttp;1.11.2;1.11.3 com.azure:azure-core-http-vertx;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-management;1.7.1;1.8.0-beta.1 -com.azure:azure-core-metrics-opentelemetry;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-core-management;1.8.0;1.8.1 +com.azure:azure-core-metrics-opentelemetry;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-serializer-avro-apache;1.0.0-beta.27;1.0.0-beta.28 +com.azure:azure-core-serializer-avro-apache;1.0.0-beta.28;1.0.0-beta.29 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-core-serializer-json-gson;1.1.19;1.2.0-beta.1 -com.azure:azure-core-serializer-json-jackson;1.2.20;1.3.0-beta.1 -com.azure:azure-core-test;1.11.0;1.12.0-beta.1 -com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.27;1.0.0-beta.28 -com.azure:azure-cosmos;4.34.0;4.35.0 +com.azure:azure-core-serializer-json-gson;1.1.20;1.1.21 +com.azure:azure-core-serializer-json-jackson;1.2.21;1.2.22 +com.azure:azure-core-test;1.12.0;1.12.1 +com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.28;1.0.0-beta.29 +com.azure:azure-cosmos;4.37.0;4.38.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-cosmos-dotnet-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3_2-12;1.0.0-beta.1;1.0.0-beta.1 -com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12;4.12.2;4.13.0-beta.1 -com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.12.2;4.13.0-beta.1 -com.azure:azure-cosmos-encryption;1.4.1;1.5.0 -com.azure:azure-data-appconfiguration;1.3.6;1.4.0-beta.1 +com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12;4.14.0;4.15.0-beta.1 +com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.14.0;4.15.0-beta.1 +com.azure:azure-cosmos-encryption;1.7.0;1.8.0-beta.1 +com.azure:azure-data-appconfiguration;1.3.7;1.4.0-beta.1 com.azure:azure-data-appconfiguration-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-data-schemaregistry;1.2.3;1.3.0-beta.1 -com.azure:azure-data-schemaregistry-apacheavro;1.0.3;1.1.0-beta.1 -com.azure:azure-data-tables;12.3.3;12.4.0-beta.1 +com.azure:azure-data-schemaregistry;1.2.4;1.3.0-beta.1 +com.azure:azure-data-schemaregistry-apacheavro;1.0.4;1.1.0-beta.1 +com.azure:azure-data-tables;12.3.4;12.4.0-beta.1 com.azure:azure-data-tables-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-digitaltwins-core;1.3.1;1.4.0-beta.1 +com.azure:azure-digitaltwins-core;1.3.2;1.4.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.5.4;1.6.0-beta.2 +com.azure:azure-identity;1.6.0;1.7.0-beta.2 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-iot-deviceupdate;1.0.0-beta.3;1.0.0-beta.4 +com.azure:azure-iot-deviceupdate;1.0.0;1.1.0-beta.1 com.azure:azure-iot-modelsrepository;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-json;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-json-gson;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-messaging-eventgrid;4.12.1;4.13.0-beta.1 +com.azure:azure-maps-timezone;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-maps-geolocation;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-maps-render;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-maps-route;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-maps-search;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-json;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-json-gson;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-messaging-eventgrid;4.12.2;4.13.0-beta.1 com.azure:azure-messaging-eventgrid-cloudnative-cloudevents;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-messaging-eventhubs;5.13.0;5.14.0-beta.1 -com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.15.0;1.16.0-beta.1 +com.azure:azure-messaging-eventhubs;5.13.1;5.14.0-beta.1 +com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.15.1;1.16.0-beta.1 com.azure:azure-messaging-eventhubs-checkpointstore-jedis;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs-track2-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-messaging-servicebus;7.10.1;7.11.0-beta.1 +com.azure:azure-messaging-servicebus;7.11.0;7.12.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-messaging-webpubsub;1.1.5;1.2.0-beta.1 -com.azure:azure-mixedreality-authentication;1.2.5;1.3.0-beta.1 -com.azure:azure-mixedreality-remoterendering;1.1.10;1.2.0-beta.1 -com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.5;1.0.0-beta.6 +com.azure:azure-messaging-webpubsub;1.1.6;1.2.0-beta.1 +com.azure:azure-mixedreality-authentication;1.2.6;1.3.0-beta.1 +com.azure:azure-mixedreality-remoterendering;1.1.11;1.2.0-beta.1 +com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-monitor-ingestion;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-monitor-ingestion-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-monitor-query;1.0.9;1.1.0-beta.1 +com.azure:azure-monitor-query;1.0.10;1.1.0-beta.1 com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-perf-test-parent;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-search-documents;11.4.13;11.5.0-beta.13 +com.azure:azure-search-documents;11.5.0;11.6.0-beta.2 com.azure:azure-search-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-security-attestation;1.1.5;1.2.0-beta.1 -com.azure:azure-security-confidentialledger;1.0.1;1.1.0-beta.1 -com.azure:azure-security-keyvault-administration;4.1.5;4.2.0-beta.1 -com.azure:azure-security-keyvault-certificates;4.3.5;4.4.0-beta.1 +com.azure:azure-security-attestation;1.1.6;1.2.0-beta.1 +com.azure:azure-security-confidentialledger;1.0.2;1.1.0-beta.1 +com.azure:azure-security-keyvault-administration;4.2.0;4.3.0-beta.1 +com.azure:azure-security-keyvault-certificates;4.4.0;4.5.0-beta.1 com.azure:azure-security-keyvault-jca;2.7.0;2.8.0-beta.1 com.azure:azure-security-test-keyvault-jca;1.0.0;1.0.0 -com.azure:azure-security-keyvault-keys;4.4.6;4.5.0-beta.1 -com.azure:azure-security-keyvault-secrets;4.4.6;4.5.0-beta.1 +com.azure:azure-security-keyvault-keys;4.5.0;4.6.0-beta.1 +com.azure:azure-security-keyvault-secrets;4.5.0;4.6.0-beta.1 com.azure:azure-security-keyvault-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template;1.1.1234;1.2.2-beta.1 com.azure:azure-sdk-template-two;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template-three;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-spring-data-cosmos;3.25.0;3.26.0 +com.azure:azure-spring-data-cosmos;3.28.0;3.29.0-beta.1 com.azure:azure-spring-data-cosmos-test;3.0.0-beta.1;3.0.0-beta.1 -com.azure:azure-storage-blob;12.19.0;12.20.0-beta.1 -com.azure:azure-storage-blob-batch;12.15.0;12.16.0-beta.1 +com.azure:azure-storage-blob;12.19.1;12.20.0-beta.2 +com.azure:azure-storage-blob-batch;12.15.1;12.16.0-beta.2 com.azure:azure-storage-blob-changefeed;12.0.0-beta.18;12.0.0-beta.19 -com.azure:azure-storage-blob-cryptography;12.18.0;12.19.0-beta.1 +com.azure:azure-storage-blob-cryptography;12.18.1;12.19.0-beta.2 com.azure:azure-storage-blob-nio;12.0.0-beta.19;12.0.0-beta.20 -com.azure:azure-storage-common;12.18.0;12.19.0-beta.1 -com.azure:azure-storage-file-share;12.15.0;12.16.0-beta.1 -com.azure:azure-storage-file-datalake;12.12.0;12.13.0-beta.1 -com.azure:azure-storage-internal-avro;12.4.1;12.5.0-beta.1 +com.azure:azure-storage-common;12.18.1;12.19.0-beta.2 +com.azure:azure-storage-file-share;12.15.1;12.16.0-beta.2 +com.azure:azure-storage-file-datalake;12.12.1;12.13.0-beta.2 +com.azure:azure-storage-internal-avro;12.4.2;12.5.0-beta.2 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-storage-queue;12.14.1;12.15.0-beta.1 +com.azure:azure-storage-queue;12.14.2;12.15.0-beta.2 com.azure:azure-template-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-verticals-agrifood-farming;1.0.0-beta.2;1.0.0-beta.3 +com.azure:azure-xml;1.0.0-beta.1;1.0.0-beta.2 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-email;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-developer-loadtesting;1.0.0-beta.1;1.0.0-beta.1 -com.microsoft.azure:spring-cloud-azure-appconfiguration-config-web;1.3.0;1.4.0-beta.1 -com.microsoft.azure:spring-cloud-azure-appconfiguration-config;1.3.0;1.4.0-beta.1 -com.microsoft.azure:spring-cloud-azure-feature-management-web;1.3.0;1.4.0-beta.1 -com.microsoft.azure:spring-cloud-azure-feature-management;1.3.0;1.4.0-beta.1 -com.microsoft.azure:spring-cloud-starter-azure-appconfiguration-config;1.3.0;1.4.0-beta.1 -com.azure.spring:azure-spring-cloud-appconfiguration-config-web;2.8.0;2.9.0-beta.1 -com.azure.spring:azure-spring-cloud-appconfiguration-config;2.8.0;2.9.0-beta.1 -com.azure.spring:azure-spring-cloud-feature-management-web;2.7.0;2.8.0-beta.1 -com.azure.spring:azure-spring-cloud-feature-management;2.7.0;2.8.0-beta.1 -com.azure.spring:azure-spring-cloud-starter-appconfiguration-config;2.8.0;2.9.0-beta.1 -com.azure.spring:spring-cloud-azure-dependencies;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-messaging-azure;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-messaging-azure-eventhubs;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-messaging-azure-servicebus;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-messaging-azure-storage-queue;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-integration-azure-core;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-integration-azure-eventhubs;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-integration-azure-servicebus;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-integration-azure-storage-queue;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-core;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator-autoconfigure;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-autoconfigure;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-resourcemanager;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-service;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-actuator;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-cosmos;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-eventhubs;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-servicebus-jms;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-servicebus;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-blob;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-file-share;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-queue;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-servicebus;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-servicebus;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-starter;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus;4.3.0;4.4.0-beta.1 -com.azure.spring:spring-cloud-azure-trace-sleuth;4.3.0;4.4.0-beta.1 +com.azure.spring:azure-spring-cloud-appconfiguration-config-web;2.9.0;2.10.0-beta.1 +com.azure.spring:azure-spring-cloud-appconfiguration-config;2.9.0;2.10.0-beta.1 +com.azure.spring:azure-spring-cloud-feature-management-web;2.8.0;2.9.0-beta.1 +com.azure.spring:azure-spring-cloud-feature-management;2.8.0;2.9.0-beta.1 +com.azure.spring:azure-spring-cloud-starter-appconfiguration-config;2.9.0;2.10.0-beta.1 +com.azure.spring:spring-cloud-azure-dependencies;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-messaging-azure;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-messaging-azure-eventhubs;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-messaging-azure-servicebus;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-messaging-azure-storage-queue;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-integration-azure-core;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-integration-azure-eventhubs;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-integration-azure-servicebus;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-integration-azure-storage-queue;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-core;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-actuator-autoconfigure;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-actuator;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-autoconfigure;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-resourcemanager;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-service;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-active-directory;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-actuator;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-cosmos;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-eventhubs;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-keyvault;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-servicebus-jms;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-servicebus;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-storage;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-storage-blob;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-storage-file-share;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-storage-queue;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-integration-servicebus;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter-stream-servicebus;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-starter;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus;4.4.0;4.5.0-beta.2 +com.azure.spring:spring-cloud-azure-trace-sleuth;4.4.0;4.5.0-beta.2 com.azure.spring:spring-cloud-azure-native-configuration;4.0.0-beta.1;4.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-appplatform;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-appservice;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-authorization;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-cdn;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-compute;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-containerinstance;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-containerregistry;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-containerservice;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-cosmos;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-dns;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-eventhubs;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-keyvault;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-monitor;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-msi;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-network;2.17.0;2.18.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-appplatform;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-appservice;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-authorization;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-cdn;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-compute;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-containerinstance;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-containerregistry;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-containerservice;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-cosmos;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-dns;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-eventhubs;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-keyvault;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-monitor;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-msi;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-network;2.19.0;2.20.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-privatedns;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-resources;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-redis;2.17.0;2.18.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-privatedns;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-resources;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-redis;2.19.0;2.20.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-samples;2.0.0-beta.1;2.0.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-search;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-servicebus;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-sql;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-storage;2.17.0;2.18.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.17.0;2.18.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-search;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-servicebus;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-sql;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-storage;2.19.0;2.20.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.19.0;2.20.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.1;2.0.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-mediaservices;2.1.0;2.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-mediaservices;2.2.0;2.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mysql;1.0.2;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-postgresql;1.0.2;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hdinsight;1.0.0-beta.5;1.0.0-beta.6 -com.azure.resourcemanager:azure-resourcemanager-sqlvirtualmachine;1.0.0-beta.2;1.0.0-beta.3 +com.azure.resourcemanager:azure-resourcemanager-sqlvirtualmachine;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.0.0-beta.3;1.0.0-beta.4 -com.azure.resourcemanager:azure-resourcemanager-kusto;1.0.0-beta.4;1.0.0-beta.5 +com.azure.resourcemanager:azure-resourcemanager-kusto;1.0.0-beta.5;1.0.0-beta.6 com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.1.0;1.2.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-netapp;1.0.0-beta.10;1.0.0-beta.11 +com.azure.resourcemanager:azure-resourcemanager-netapp;1.0.0-beta.11;1.0.0-beta.12 com.azure.resourcemanager:azure-resourcemanager-storagecache;1.0.0-beta.6;1.0.0-beta.7 com.azure.resourcemanager:azure-resourcemanager-redisenterprise;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridkubernetes;1.0.0-beta.2;1.0.0-beta.3 @@ -273,7 +275,7 @@ com.azure.resourcemanager:azure-resourcemanager-frontdoor;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-mixedreality;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-automation;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-resourcemover;1.0.0-beta.1;1.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-datafactory;1.0.0-beta.16;1.0.0-beta.17 +com.azure.resourcemanager:azure-resourcemanager-datafactory;1.0.0-beta.17;1.0.0-beta.18 com.azure.resourcemanager:azure-resourcemanager-advisor;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-appconfiguration;1.0.0-beta.6;1.0.0-beta.7 com.azure.resourcemanager:azure-resourcemanager-attestation;1.0.0-beta.1;1.0.0-beta.2 @@ -316,7 +318,7 @@ com.azure.resourcemanager:azure-resourcemanager-batch;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-datalakeanalytics;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-datalakestore;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-iotcentral;1.0.0;1.1.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-labservices;1.0.0-beta.2;1.0.0-beta.3 +com.azure.resourcemanager:azure-resourcemanager-labservices;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-vmwarecloudsimple;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-managedapplications;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-videoanalyzer;1.0.0-beta.5;1.0.0-beta.6 @@ -328,9 +330,9 @@ com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0 com.azure.resourcemanager:azure-resourcemanager-postgresqlflexibleserver;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.2;1.0.0-beta.3 -com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.2;1.0.0-beta.3 -com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-hybridnetwork;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-purview;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-mysqlflexibleserver;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-baremetalinfrastructure;1.0.0-beta.1;1.0.0-beta.2 @@ -343,9 +345,9 @@ com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.3;1.0.0-beta.4 +com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-dnsresolver;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-dnsresolver;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-azureadexternalidentities;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-dashboard;1.0.0-beta.2;1.0.0-beta.3 @@ -355,7 +357,7 @@ com.azure.resourcemanager:azure-resourcemanager-scvmm;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hardwaresecuritymodules;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-workloads;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-confidentialledger;1.0.0-beta.1;1.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-deviceupdate;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-machinelearning;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-education;1.0.0-beta.2;1.0.0-beta.3 @@ -365,6 +367,10 @@ com.azure.resourcemanager:azure-resourcemanager-resourceconnector;1.0.0-beta.1;1 com.azure.resourcemanager:azure-resourcemanager-fluidrelay;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-devcenter;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-connectedvmware;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-alertsmanagement;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-nginx;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-agrifood;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-devhub;1.0.0-beta.1;1.0.0-beta.2 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 @@ -376,7 +382,8 @@ com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. # In the pom, the version update tag after the version should name the unreleased package and the dependency version: # -unreleased_com.azure:azure-ai-formrecognizer;4.0.0-beta.7 +unreleased_com.azure:azure-core;1.33.0 +unreleased_com.azure:azure-ai-formrecognizer;4.0.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid From 3727efbcd16034d231ea0a68f1e96ee40c5ed8e3 Mon Sep 17 00:00:00 2001 From: Harshan B Date: Sat, 8 Oct 2022 01:13:17 +0530 Subject: [PATCH 12/18] Fix version_client.txt merge conflict --- eng/versioning/version_client.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 0551b8915a99a..228f9db3e158d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -166,6 +166,7 @@ com.azure:azure-verticals-agrifood-farming;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-xml;1.0.0-beta.1;1.0.0-beta.2 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-email;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-developer-loadtesting;1.0.0-beta.1;1.0.0-beta.1 com.azure.spring:azure-spring-cloud-appconfiguration-config-web;2.9.0;2.10.0-beta.1 com.azure.spring:azure-spring-cloud-appconfiguration-config;2.9.0;2.10.0-beta.1 com.azure.spring:azure-spring-cloud-feature-management-web;2.8.0;2.9.0-beta.1 From abe5aad6fccdb5fedb188acf954f86fc4e197bff Mon Sep 17 00:00:00 2001 From: Harshan B Date: Sun, 9 Oct 2022 19:43:18 +0530 Subject: [PATCH 13/18] Revert "Add simple methods without response" This reverts commit 8cca1c42d2ed56fa255d0bd41e30195e15616b88. --- .../LoadTestAdministrationAsyncClient.java | 950 ++---------------- .../LoadTestAdministrationClient.java | 937 ++--------------- .../loadtesting/TestRunAsyncClient.java | 837 +++------------ .../developer/loadtesting/TestRunClient.java | 825 +++------------ 4 files changed, 383 insertions(+), 3166 deletions(-) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index 48914ade2e42d..5d41efa984009 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -14,7 +14,6 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.azure.core.util.FluxUtil; import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; import com.azure.developer.loadtesting.implementation.util.MultipartHelper; import java.io.IOException; @@ -101,68 +100,6 @@ public Mono> createOrUpdateAppComponentsWithResponse( return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(name, body, requestOptions); } - /** - * Associate an App Component (Azure resource) to a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param body App Component model. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components model on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAppComponents(String name, BinaryData body) { - return this.serviceClient - .createOrUpdateAppComponentsWithResponseAsync(name, body, null) - .flatMap(FluxUtil::toMono); - } - /** * Delete an App Component. * @@ -180,21 +117,6 @@ public Mono> deleteAppComponentWithResponse(String name, RequestO return this.serviceClient.deleteAppComponentWithResponseAsync(name, requestOptions); } - /** - * Delete an App Component. - * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAppComponent(String name) { - return this.serviceClient.deleteAppComponentWithResponseAsync(name, null).flatMap(FluxUtil::toMono); - } - /** * Get App Component details by App Component name. * @@ -235,43 +157,6 @@ public Mono> getAppComponentByNameWithResponse(String name, return this.serviceClient.getAppComponentByNameWithResponseAsync(name, requestOptions); } - /** - * Get App Component details by App Component name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Component details by App Component name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAppComponentByName(String name) { - return this.serviceClient.getAppComponentByNameWithResponseAsync(name, null).flatMap(FluxUtil::toMono); - } - /** * Get App Components for a test or a test run by its name. * @@ -322,104 +207,6 @@ public Mono> getAppComponentWithResponse(RequestOptions req return this.serviceClient.getAppComponentWithResponseAsync(requestOptions); } - /** - * Get App Components for a test by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test by its name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAppComponentForTest(String testId) { - RequestOptions requestOptions = new RequestOptions().addQueryParam("testId", testId); - return this.serviceClient.getAppComponentWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Get App Components for a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test run by its name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAppComponentForTestRun(String testRunId) { - RequestOptions requestOptions = new RequestOptions().addQueryParam("testRunId", testRunId); - return this.serviceClient.getAppComponentWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); - } - /** * Configure server metrics for a test or test run. * @@ -490,32 +277,7 @@ public Mono> createOrUpdateServerMetricsConfigWithResponse( } /** - * Configure server metrics for a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
+ * Get server metrics configuration by its name. * *

Response Body Schema * @@ -543,148 +305,50 @@ public Mono> createOrUpdateServerMetricsConfigWithResponse( * } * * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, requestOptions); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics config model on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateServerMetricsConfig(String name, BinaryData body) { - return this.serviceClient - .createOrUpdateServerMetricsConfigWithResponseAsync(name, body, null) - .flatMap(FluxUtil::toMono); + public Mono> deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteServerMetricsWithResponseAsync(name, requestOptions); } /** - * Get server metrics configuration by its name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response} on successful completion of {@link - * Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, requestOptions); - } - - /** - * Get server metrics configuration by its name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServerMetricsByName(String name) { - return this.serviceClient.getServerMetricsByNameWithResponseAsync(name, null).flatMap(FluxUtil::toMono); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { - return this.serviceClient.deleteServerMetricsWithResponseAsync(name, requestOptions); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteServerMetrics(String name) { - return this.serviceClient.deleteServerMetricsWithResponseAsync(name, null).flatMap(FluxUtil::toMono); - } - - /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} * *

Response Body Schema * @@ -725,148 +389,6 @@ public Mono> getServerMetricsWithResponse(RequestOptions re return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions); } - /** - * Get server metrics configuration for a test by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test by its name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServerMetricsForTest(String testId) { - RequestOptions requestOptions = new RequestOptions().addQueryParam("testId", testId); - return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Get server metrics configuration for a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test run by its name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServerMetricsForTestRun(String testRunId) { - RequestOptions requestOptions = new RequestOptions().addQueryParam("testRunId", testRunId); - return this.serviceClient.getServerMetricsWithResponseAsync(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Get all default server metrics configuration for supported resource types. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     defaultMetrics (Optional): {
-     *         String (Optional): [
-     *              (Optional){
-     *                 metricnamespace: String (Optional)
-     *                 aggregation: String (Optional)
-     *                 name (Optional): {
-     *                     value: String (Optional)
-     *                     localizedValue: String (Optional)
-     *                 }
-     *                 unit: String (Optional)
-     *                 displayDescription: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types along with {@link Response} on - * successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getServerDefaultMetricsWithResponseAsync(requestOptions); - } - /** * Get all default server metrics configuration for supported resource types. * @@ -891,209 +413,45 @@ public Mono> getServerDefaultMetricsWithResponse(RequestOpt * } * } * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getServerDefaultMetrics() { - return this.serviceClient.getServerDefaultMetricsWithResponseAsync(null).flatMap(FluxUtil::toMono); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on - * successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { - return this.serviceClient.listSupportedResourceTypeWithResponseAsync(requestOptions); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSupportedResourceType() { - return this.serviceClient.listSupportedResourceTypeWithResponseAsync(null).flatMap(FluxUtil::toMono); - } - - /** - * Create a new test or Update an existing test. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
+ * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getServerDefaultMetricsWithResponseAsync(requestOptions); + } + + /** + * Get all supported resource types for App Components(Azure resource types). * *

Response Body Schema * *

{@code
      * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
      * }
      * }
* - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response} on successful completion of {@link Mono}. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateTestWithResponse( - String testId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateTestWithResponseAsync(testId, body, requestOptions); + public Mono> listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.serviceClient.listSupportedResourceTypeWithResponseAsync(requestOptions); } /** @@ -1223,15 +581,18 @@ public Mono> createOrUpdateTestWithResponse( * * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model on successful completion of {@link Mono}. + * @return load test model along with {@link Response} on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateTest(String testId, BinaryData body) { - return this.serviceClient.createOrUpdateTestWithResponseAsync(testId, body, null).flatMap(FluxUtil::toMono); + public Mono> createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateTestWithResponseAsync(testId, body, requestOptions); } /** @@ -1251,21 +612,6 @@ public Mono> deleteLoadTestWithResponse(String testId, RequestOpt return this.serviceClient.deleteLoadTestWithResponseAsync(testId, requestOptions); } - /** - * Delete a test by its name. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteLoadTest(String testId) { - return this.serviceClient.deleteLoadTestWithResponseAsync(testId, null).flatMap(FluxUtil::toMono); - } - /** * Get load test details by test name. * @@ -1344,82 +690,6 @@ public Mono> getLoadTestWithResponse(String testId, Request return this.serviceClient.getLoadTestWithResponseAsync(testId, requestOptions); } - /** - * Get load test details by test name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getLoadTest(String testId) { - return this.serviceClient.getLoadTestWithResponseAsync(testId, null).flatMap(FluxUtil::toMono); - } - /** * 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 multipart/form-data. @@ -1470,53 +740,6 @@ public Mono> uploadTestFileWithResponse( return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions); } - /** - * 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 multipart/form-data. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * Flux
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param file The file to be uploaded. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return fileUrl Model on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadTestFile(String testId, String fileId, BinaryData file) { - return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, file, null).flatMap(FluxUtil::toMono); - } - /** * 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 multipart/form-data. @@ -1607,35 +830,6 @@ public Mono> getTestFileWithResponse( return this.serviceClient.getTestFileWithResponseAsync(testId, fileId, requestOptions); } - /** - * Get test file by the file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTestFile(String testId, String fileId) { - return this.serviceClient.getTestFileWithResponseAsync(testId, fileId, null).flatMap(FluxUtil::toMono); - } - /** * Delete file by the file name for a test. * @@ -1655,22 +849,6 @@ public Mono> deleteTestFileWithResponse( return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileId, requestOptions); } - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTestFile(String testId, String fileId) { - return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileId, null).flatMap(FluxUtil::toMono); - } - /** * Get all load tests by the fully qualified resource Id e.g * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index 03b9cfa23e9b8..8ca7bcd552d0b 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -94,66 +94,6 @@ public Response createOrUpdateAppComponentsWithResponse( return this.client.createOrUpdateAppComponentsWithResponse(name, body, requestOptions).block(); } - /** - * Associate an App Component (Azure resource) to a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @param body App Component model. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData createOrUpdateAppComponents(String name, BinaryData body) { - return this.client.createOrUpdateAppComponents(name, body).block(); - } - /** * Delete an App Component. * @@ -171,21 +111,6 @@ public Response deleteAppComponentWithResponse(String name, RequestOptions return this.client.deleteAppComponentWithResponse(name, requestOptions).block(); } - /** - * Delete an App Component. - * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Void deleteAppComponent(String name) { - return this.client.deleteAppComponent(name).block(); - } - /** * Get App Component details by App Component name. * @@ -225,43 +150,6 @@ public Response getAppComponentByNameWithResponse(String name, Reque return this.client.getAppComponentByNameWithResponse(name, requestOptions).block(); } - /** - * Get App Component details by App Component name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Component details by App Component name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getAppComponentByName(String name) { - return this.client.getAppComponentByName(name).block(); - } - /** * Get App Components for a test or a test run by its name. * @@ -311,102 +199,6 @@ public Response getAppComponentWithResponse(RequestOptions requestOp return this.client.getAppComponentWithResponse(requestOptions).block(); } - /** - * Get App Components for a test by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test by its name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getAppComponentForTest(String testId) { - return this.client.getAppComponentForTest(testId).block(); - } - - /** - * Get App Components for a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     resourceId: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     name: String (Optional)
-     *     value (Required): {
-     *         String (Required): {
-     *             resourceId: String (Required)
-     *             resourceName: String (Required)
-     *             resourceType: String (Required)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return app Components for a test run by its name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getAppComponentForTestRun(String testRunId) { - return this.client.getAppComponentForTestRun(testRunId).block(); - } - /** * Configure server metrics for a test or test run. * @@ -477,32 +269,7 @@ public Response createOrUpdateServerMetricsConfigWithResponse( } /** - * Configure server metrics for a test or test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
+ * Get server metrics configuration by its name. * *

Response Body Schema * @@ -530,20 +297,49 @@ public Response createOrUpdateServerMetricsConfigWithResponse( * } * * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics config model. + * @return server metrics configuration by its name along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData createOrUpdateServerMetricsConfig(String name, BinaryData body) { - return this.client.createOrUpdateServerMetricsConfig(name, body).block(); + public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { + return this.client.getServerMetricsByNameWithResponse(name, requestOptions).block(); } /** - * Get server metrics configuration by its name. + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteServerMetricsWithResponse(name, requestOptions).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} * *

Response Body Schema * @@ -570,137 +366,12 @@ public BinaryData createOrUpdateServerMetricsConfig(String name, BinaryData body * } * } * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsByNameWithResponse(String name, RequestOptions requestOptions) { - return this.client.getServerMetricsByNameWithResponse(name, requestOptions).block(); - } - - /** - * Get server metrics configuration by its name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getServerMetricsByName(String name) { - return this.client.getServerMetricsByName(name).block(); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteServerMetricsWithResponse(String name, RequestOptions requestOptions) { - return this.client.deleteServerMetricsWithResponse(name, requestOptions).block(); - } - - /** - * Delete server metrics configuration by its name. - * - * @param name Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Void deleteServerMetrics(String name) { - return this.client.deleteServerMetrics(name).block(); - } - - /** - * Get server metrics configuration for a test or test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name along with {@link Response}. + * @return server metrics configuration for a test or test run by its name along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -708,145 +379,6 @@ public Response getServerMetricsWithResponse(RequestOptions requestO return this.client.getServerMetricsWithResponse(requestOptions).block(); } - /** - * Get server metrics configuration for a test by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getServerMetricsForTest(String testId) { - return this.client.getServerMetricsForTest(testId).block(); - } - - /** - * Get server metrics configuration for a test run by its name. - * - *

Query Parameters - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNo[Required, if testId is not provided] Test run Id.
testIdStringNoUnique name for load test, must be a valid URL character ^[a-z0-9_-]*$.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     name: String (Optional)
-     *     testId: String (Optional)
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Optional): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricnamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name (Required): {
-     *                 value: String (Required)
-     *                 localizedValue: String (Required)
-     *             }
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return server metrics configuration for a test or test run by its name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getServerMetricsForTestRun(String testRunId) { - return this.client.getServerMetricsForTestRun(testRunId).block(); - } - - /** - * Get all default server metrics configuration for supported resource types. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     defaultMetrics (Optional): {
-     *         String (Optional): [
-     *              (Optional){
-     *                 metricnamespace: String (Optional)
-     *                 aggregation: String (Optional)
-     *                 name (Optional): {
-     *                     value: String (Optional)
-     *                     localizedValue: String (Optional)
-     *                 }
-     *                 unit: String (Optional)
-     *                 displayDescription: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { - return this.client.getServerDefaultMetricsWithResponse(requestOptions).block(); - } - /** * Get all default server metrics configuration for supported resource types. * @@ -871,206 +403,43 @@ public Response getServerDefaultMetricsWithResponse(RequestOptions r * } * } * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all default server metrics configuration for supported resource types. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getServerDefaultMetrics() { - return this.client.getServerDefaultMetrics().block(); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { - return this.client.listSupportedResourceTypeWithResponse(requestOptions).block(); - } - - /** - * Get all supported resource types for App Components(Azure resource types). - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Optional): [
-     *         String (Optional)
-     *     ]
-     * }
-     * }
- * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData listSupportedResourceType() { - return this.client.listSupportedResourceType().block(); - } - - /** - * Create a new test or Update an existing test. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all default server metrics configuration for supported resource types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerDefaultMetricsWithResponse(RequestOptions requestOptions) { + return this.client.getServerDefaultMetricsWithResponse(requestOptions).block(); + } + + /** + * Get all supported resource types for App Components(Azure resource types). * *

Response Body Schema * *

{@code
      * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
      * }
      * }
* - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response}. + * @return all supported resource types for App Components(Azure resource types) along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateTestWithResponse( - String testId, BinaryData body, RequestOptions requestOptions) { - return this.client.createOrUpdateTestWithResponse(testId, body, requestOptions).block(); + public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return this.client.listSupportedResourceTypeWithResponse(requestOptions).block(); } /** @@ -1200,15 +569,18 @@ public Response createOrUpdateTestWithResponse( * * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. * @param body Load test model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model. + * @return load test model along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData createOrUpdateTest(String testId, BinaryData body) { - return this.client.createOrUpdateTest(testId, body).block(); + public Response createOrUpdateTestWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateTestWithResponse(testId, body, requestOptions).block(); } /** @@ -1228,21 +600,6 @@ public Response deleteLoadTestWithResponse(String testId, RequestOptions r return this.client.deleteLoadTestWithResponse(testId, requestOptions).block(); } - /** - * Delete a test by its name. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Void deleteLoadTest(String testId) { - return this.client.deleteLoadTest(testId).block(); - } - /** * Get load test details by test name. * @@ -1321,82 +678,6 @@ public Response getLoadTestWithResponse(String testId, RequestOption return this.client.getLoadTestWithResponse(testId, requestOptions).block(); } - /** - * Get load test details by test name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     resourceId: String (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     inputArtifacts (Optional): {
-     *         configUrl (Optional): {
-     *             url: String (Optional)
-     *             fileId: String (Optional)
-     *             filename: String (Optional)
-     *             fileType: String(0/1/2) (Optional)
-     *             expireTime: OffsetDateTime (Optional)
-     *             validationStatus: String (Optional)
-     *         }
-     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *         additionalUrls (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getLoadTest(String testId) { - return this.client.getLoadTest(testId).block(); - } - /** * 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 multipart/form-data. @@ -1447,53 +728,6 @@ public Response uploadTestFileWithResponse( return this.client.uploadTestFileWithResponse(testId, fileId, file, requestOptions).block(); } - /** - * 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 multipart/form-data. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeIntegerNoInteger representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * Flux
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @param file The file to be uploaded. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return fileUrl Model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData uploadTestFileWithResponse(String testId, String fileId, BinaryData file) { - return this.client.uploadTestFile(testId, fileId, file).block(); - } - /** * 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 multipart/form-data. @@ -1577,35 +811,6 @@ public Response getTestFileWithResponse(String testId, String fileId return this.client.getTestFileWithResponse(testId, fileId, requestOptions).block(); } - /** - * Get test file by the file name. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
-     * }
-     * }
- * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getTestFile(String testId, String fileId) { - return this.client.getTestFile(testId, fileId).block(); - } - /** * Delete file by the file name for a test. * @@ -1624,22 +829,6 @@ public Response deleteTestFileWithResponse(String testId, String fileId, R return this.client.deleteTestFileWithResponse(testId, fileId, requestOptions).block(); } - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Void deleteTestFile(String testId, String fileId) { - return this.client.deleteTestFile(testId, fileId).block(); - } - /** * Get all load tests by the fully qualified resource Id e.g * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java index 561f5e12c4b3c..51a4fd0622594 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -14,7 +14,6 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.azure.core.util.FluxUtil; import com.azure.developer.loadtesting.implementation.TestRunsImpl; import reactor.core.publisher.Mono; @@ -50,21 +49,6 @@ public Mono> deleteTestRunWithResponse(String testRunId, RequestO return this.serviceClient.deleteTestRunWithResponseAsync(testRunId, requestOptions); } - /** - * Delete a test run by its name. - * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTestRun(String testRunId) { - return this.serviceClient.deleteTestRunWithResponseAsync(testRunId, null).flatMap(FluxUtil::toMono); - } - /** * Get test run details by name. * @@ -175,7 +159,39 @@ public Mono> getTestRunWithResponse(String testRunId, Reque } /** - * Get test run details by name. + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions); + } + + /** + * Stop test run by name. * *

Response Body Schema * @@ -269,83 +285,145 @@ public Mono> getTestRunWithResponse(String testRunId, Reque * } * } * - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name on successful completion of {@link Mono}. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTestRun(String testRunId) { - return this.serviceClient.getTestRunWithResponseAsync(testRunId, null).flatMap(FluxUtil::toMono); + public Mono> stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.stopTestRunWithResponseAsync(testRunId, requestOptions); } /** - * Get test run file by file name. + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
* *

Response Body Schema * *

{@code
      * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
      * }
      * }
* - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link + * Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunFileWithResponse( - String testRunId, String fileId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, requestOptions); + public Mono> getTestRunClientMetricsWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions); } /** - * Get test run file by file name. + * Get all filters that are supported for client metrics for a given load test run. * *

Response Body Schema * *

{@code
      * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
      * }
      * }
* - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name on successful completion of {@link Mono}. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response} + * on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTestRunFile(String testRunId, String fileId) { - return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileId, null).flatMap(FluxUtil::toMono); + public Mono> getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions); } /** - * Stop test run by name. + * Create and start a new test run with the given name. * - *

Response Body Schema + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema * *

{@code
      * {
@@ -437,23 +515,6 @@ public Mono getTestRunFile(String testRunId, String fileId) {
      * }
      * }
* - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.stopTestRunWithResponseAsync(testRunId, requestOptions); - } - - /** - * Stop test run by name. - * *

Response Body Schema * *

{@code
@@ -547,661 +608,21 @@ public Mono> stopTestRunWithResponse(String testRunId, Requ
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stopTestRun(String testRunId) { - return this.serviceClient.stopTestRunWithResponseAsync(testRunId, null).flatMap(FluxUtil::toMono); - } - - /** - * Get all client metrics for a load test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. + * @param body Load test run model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run along with {@link Response} on successful completion of {@link - * Mono}. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunClientMetricsWithResponse( - String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.getTestRunClientMetricsWithResponseAsync(testRunId, body, requestOptions); - } - - /** - * Get all client metrics for a load test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTestRunClientMetrics(String testRunId, BinaryData body) { - return this.serviceClient - .getTestRunClientMetricsWithResponseAsync(testRunId, body, null) - .flatMap(FluxUtil::toMono); - } - - /** - * Get all filters that are supported for client metrics for a given load test run. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run along with {@link Response} - * on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunClientMetricsFiltersWithResponse( - String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunClientMetricsFiltersWithResponseAsync(testRunId, requestOptions); - } - - /** - * Get all filters that are supported for client metrics for a given load test run. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTestRunClientMetricsFilters(String testRunId) { - return this.serviceClient - .getTestRunClientMetricsFiltersWithResponseAsync(testRunId, null) - .flatMap(FluxUtil::toMono); - } - - /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAndUpdateTestRunWithResponse( + public Mono> createAndUpdateTestRunWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { return this.serviceClient.createAndUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); } - /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAndUpdateTestRun(String testRunId, BinaryData body) { - return this.serviceClient - .createAndUpdateTestRunWithResponseAsync(testRunId, body, null) - .flatMap(FluxUtil::toMono); - } - /** * Get all test runs with given filters. * diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java index 554e2d5413a68..f70a59b252567 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -47,21 +47,6 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions return this.client.deleteTestRunWithResponse(testRunId, requestOptions).block(); } - /** - * Delete a test run by its name. - * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return Void. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Void deleteTestRun(String testRunId) { - return this.client.deleteTestRun(testRunId).block(); - } - /** * Get test run details by name. * @@ -172,7 +157,39 @@ public Response getTestRunWithResponse(String testRunId, RequestOpti } /** - * Get test run details by name. + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(0/1/2) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run file by file name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.client.getTestRunFileWithResponse(testRunId, fileId, requestOptions).block(); + } + + /** + * Stop test run by name. * *

Response Body Schema * @@ -266,83 +283,143 @@ public Response getTestRunWithResponse(String testRunId, RequestOpti * } * } * - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name. + * @return load test run model along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getTestRun(String testRunId) { - return this.client.getTestRun(testRunId).block(); + public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); } /** - * Get test run file by file name. + * Get all client metrics for a load test run. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     requestSamplers (Optional): [
+     *         String (Optional)
+     *     ]
+     *     errors (Optional): [
+     *         String (Optional)
+     *     ]
+     *     percentiles (Optional): [
+     *         String (Optional)
+     *     ]
+     *     groupByInterval: String (Optional)
+     *     startTime: OffsetDateTime (Required)
+     *     endTime: OffsetDateTime (Required)
+     * }
+     * }
* *

Response Body Schema * *

{@code
      * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
+     *     testRunId: String (Optional)
+     *     timeSeries (Optional): {
+     *         activeUsers (Optional): {
+     *             String (Optional): [
+     *                  (Optional){
+     *                     timestamp: OffsetDateTime (Optional)
+     *                     value: Double (Optional)
+     *                 }
+     *             ]
+     *         }
+     *         responseTime (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         throughput (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         errors (Optional): {
+     *             String (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *     }
      * }
      * }
* - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param body Client metrics request model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response}. + * @return all client metrics for a load test run along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunFileWithResponse( - String testRunId, String fileId, RequestOptions requestOptions) { - return this.client.getTestRunFileWithResponse(testRunId, fileId, requestOptions).block(); + public Response getTestRunClientMetricsWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.client.getTestRunClientMetricsWithResponse(testRunId, body, requestOptions).block(); } /** - * Get test run file by file name. + * Get all filters that are supported for client metrics for a given load test run. * *

Response Body Schema * *

{@code
      * {
-     *     url: String (Optional)
-     *     fileId: String (Optional)
-     *     filename: String (Optional)
-     *     fileType: String(0/1/2) (Optional)
-     *     expireTime: OffsetDateTime (Optional)
-     *     validationStatus: String (Optional)
+     *     testRunId: String (Optional)
+     *     filters (Optional): {
+     *         requestSamplerValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *         errorFiltersValues (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     timeRange (Optional): {
+     *         startTime: OffsetDateTime (Optional)
+     *         endTime: OffsetDateTime (Optional)
+     *     }
      * }
      * }
* - * @param testRunId Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileId Unique identifier for test run file, must be a valid URL character ^[a-z0-9_-]*$. + * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name. + * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getTestRunFile(String testRunId, String fileId) { - return this.client.getTestRunFile(testRunId, fileId).block(); + public Response getTestRunClientMetricsFiltersWithResponse( + String testRunId, RequestOptions requestOptions) { + return this.client.getTestRunClientMetricsFiltersWithResponse(testRunId, requestOptions).block(); } /** - * Stop test run by name. + * Create and start a new test run with the given name. * - *

Response Body Schema + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Request Body Schema * *

{@code
      * {
@@ -434,23 +511,6 @@ public BinaryData getTestRunFile(String testRunId, String fileId) {
      * }
      * }
* - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); - } - - /** - * Stop test run by name. - * *

Response Body Schema * *

{@code
@@ -544,652 +604,21 @@ public Response stopTestRunWithResponse(String testRunId, RequestOpt
      * }
* * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData stopTestRun(String testRunId) { - return this.client.stopTestRun(testRunId).block(); - } - - /** - * Get all client metrics for a load test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. + * @param body Load test run model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run along with {@link Response}. + * @return load test run model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunClientMetricsWithResponse( - String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.client.getTestRunClientMetricsWithResponse(testRunId, body, requestOptions).block(); - } - - /** - * Get all client metrics for a load test run. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     requestSamplers (Optional): [
-     *         String (Optional)
-     *     ]
-     *     errors (Optional): [
-     *         String (Optional)
-     *     ]
-     *     percentiles (Optional): [
-     *         String (Optional)
-     *     ]
-     *     groupByInterval: String (Optional)
-     *     startTime: OffsetDateTime (Required)
-     *     endTime: OffsetDateTime (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     timeSeries (Optional): {
-     *         activeUsers (Optional): {
-     *             String (Optional): [
-     *                  (Optional){
-     *                     timestamp: OffsetDateTime (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *         }
-     *         responseTime (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         throughput (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         errors (Optional): {
-     *             String (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Client metrics request model. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all client metrics for a load test run. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getTestRunClientMetrics(String testRunId, BinaryData body) { - return this.client.getTestRunClientMetrics(testRunId, body).block(); - } - - /** - * Get all filters that are supported for client metrics for a given load test run. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunClientMetricsFiltersWithResponse( - String testRunId, RequestOptions requestOptions) { - return this.client.getTestRunClientMetricsFiltersWithResponse(testRunId, requestOptions).block(); - } - - /** - * Get all filters that are supported for client metrics for a given load test run. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     filters (Optional): {
-     *         requestSamplerValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *         errorFiltersValues (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     *     timeRange (Optional): {
-     *         startTime: OffsetDateTime (Optional)
-     *         endTime: OffsetDateTime (Optional)
-     *     }
-     * }
-     * }
- * - * @param testRunId Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all filters that are supported for client metrics for a given load test run. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData getTestRunClientMetricsFiltersWithResponse(String testRunId) { - return this.client.getTestRunClientMetricsFilters(testRunId).block(); - } - - /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAndUpdateTestRunWithResponse( + public Response createAndUpdateTestRunWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { return this.client.createAndUpdateTestRunWithResponse(testRunId, body, requestOptions).block(); } - /** - * Create and start a new test run with the given name. - * - *

Query Parameters - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run Id that should be rerun.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     resourceId: String (Optional)
-     *     description: String (Optional)
-     *     status: String (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     loadTestConfig (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *     }
-     *     testResult: String (Optional)
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientmetric: String (Optional)
-     *                 aggregate: String (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String (Optional)
-     *             }
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Required): {
-     *             configUrl (Optional): {
-     *                 url: String (Optional)
-     *                 fileId: String (Optional)
-     *                 filename: String (Optional)
-     *                 fileType: String(0/1/2) (Optional)
-     *                 expireTime: OffsetDateTime (Optional)
-     *                 validationStatus: String (Optional)
-     *             }
-     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
-     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
-     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
-     *             additionalUrls (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultUrl (Optional): (recursive schema, see resultUrl above)
-     *             logsUrl (Optional): (recursive schema, see logsUrl above)
-     *         }
-     *     }
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     vusers: Integer (Optional)
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     *     portalUrl: String (Optional)
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String (Optional)
-     *         }
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     * }
-     * }
- * - * @param testRunId Unique name of the load test run, must be a valid URL character ^[a-z0-9_-]*$. - * @param body Load test run model. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData createAndUpdateTestRun(String testRunId, BinaryData body) { - return this.client.createAndUpdateTestRun(testRunId, body).block(); - } - /** * Get all test runs with given filters. * From 6187a33d4223f8e0c643dc241a7e6aa7dd3f054e Mon Sep 17 00:00:00 2001 From: Harshan B Date: Tue, 11 Oct 2022 01:53:51 +0530 Subject: [PATCH 14/18] Correct casing of session records, dependencies and links --- sdk/loadtestservice/azure-developer-loadtesting/README.md | 8 ++++---- sdk/loadtestservice/azure-developer-loadtesting/pom.xml | 8 ++++---- ...AndUpdateTestRunTests.createAndUpdateTestRunDict.json} | 0 ...dUpdateTestRunTests.createAndUpdateTestRunString.json} | 0 ...eateOrUpdateTestTests.createOrUpdateTestDictDict.json} | 0 ...CreateOrUpdateTestTests.createOrUpdateTestString.json} | 0 6 files changed, 8 insertions(+), 8 deletions(-) rename sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/{CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json => CreateAndUpdateTestRunTests.createAndUpdateTestRunDict.json} (100%) rename sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/{CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json => CreateAndUpdateTestRunTests.createAndUpdateTestRunString.json} (100%) rename sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/{CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json => CreateOrUpdateTestTests.createOrUpdateTestDictDict.json} (100%) rename sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/{CreateOrUpdateTestTests.CreateOrUpdateTestString.json => CreateOrUpdateTestTests.createOrUpdateTestString.json} (100%) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index 0546d49dd3027..b594da0616d9f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -8,7 +8,7 @@ This package contains Microsoft Azure Developer LoadTesting client library. Various documentation is available to help you get started -- [Source code][source_code] + - [API reference documentation][api_reference_doc] - [Product Documentation][product_documentation] @@ -168,7 +168,7 @@ locate the root issue. View the [logging][logging] wiki for guidance about enabl ## Next steps Azure Loading Testing Java SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered. -See [Azure Load Testing samples][sample_code]. + ## Contributing @@ -181,8 +181,8 @@ For details on contributing to this repository, see the [contributing guide](htt 1. Create new Pull Request -[source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src -[sample_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples + + [api_reference_doc]: https://docs.microsoft.com/rest/api/loadtesting/ [product_documentation]: https://azure.microsoft.com/services/load-testing/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ diff --git a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml index 3af4b10f67432..deb11e3f47a7d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml +++ b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.32.0 + 1.33.0 com.azure azure-core-http-netty - 1.12.5 + 1.12.6 org.junit.jupiter @@ -66,13 +66,13 @@ com.azure azure-core-test - 1.12.0 + 1.12.1 test com.azure azure-identity - 1.6.0 + 1.6.1 test diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunDict.json similarity index 100% rename from sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunDict.json rename to sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunDict.json diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunString.json similarity index 100% rename from sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.CreateAndUpdateTestRunString.json rename to sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunString.json diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.createOrUpdateTestDictDict.json similarity index 100% rename from sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestDictDict.json rename to sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.createOrUpdateTestDictDict.json diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.createOrUpdateTestString.json similarity index 100% rename from sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.CreateOrUpdateTestString.json rename to sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestTests.createOrUpdateTestString.json From cf129023116241e885f5ee95053b76e877b8f17d Mon Sep 17 00:00:00 2001 From: Harshan B Date: Tue, 11 Oct 2022 21:06:59 +0530 Subject: [PATCH 15/18] Make autogen uploadTest API package private --- .../loadtesting/LoadTestAdministrationAsyncClient.java | 3 +-- .../developer/loadtesting/LoadTestAdministrationClient.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index 5d41efa984009..c5e6ef28aa5be 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -733,9 +733,8 @@ public Mono> getLoadTestWithResponse(String testId, Request * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadTestFileWithResponse( + Mono> uploadTestFileWithResponse( String testId, String fileId, BinaryData file, RequestOptions requestOptions) { return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileId, file, requestOptions); } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index 8ca7bcd552d0b..bb16030035693 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -721,9 +721,8 @@ public Response getLoadTestWithResponse(String testId, RequestOption * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return fileUrl Model along with {@link Response}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadTestFileWithResponse( + Response uploadTestFileWithResponse( String testId, String fileId, BinaryData file, RequestOptions requestOptions) { return this.client.uploadTestFileWithResponse(testId, fileId, file, requestOptions).block(); } From 9f7e8b6d0b256212fb7ee192cdf986bddfa0f197 Mon Sep 17 00:00:00 2001 From: Harshan B Date: Tue, 11 Oct 2022 22:37:41 +0530 Subject: [PATCH 16/18] Rename getAll API to list --- .../LoadTestAdministrationAsyncClient.java | 47 ++++++++++++++++++- .../LoadTestAdministrationClient.java | 47 ++++++++++++++++++- 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index c5e6ef28aa5be..b38dd8dfefffa 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -987,9 +987,52 @@ public PagedFlux listLoadTestSearch(RequestOptions requestOptions) { * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return all test files as paginated response with {@link PagedFlux}. */ - @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getAllTestFiles(String testId, RequestOptions requestOptions) { + PagedFlux getAllTestFiles(String testId, RequestOptions requestOptions) { + return this.serviceClient.getAllTestFilesAsync(testId, requestOptions); + } + + /** + * List all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestFiles(String testId, RequestOptions requestOptions) { return this.serviceClient.getAllTestFilesAsync(testId, requestOptions); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index bb16030035693..80bf703ae9db8 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -967,9 +967,52 @@ public PagedIterable listLoadTestSearch(RequestOptions requestOption * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return all test files as paginated response with {@link PagedIterable}. */ - @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getAllTestFiles(String testId, RequestOptions requestOptions) { + PagedIterable getAllTestFiles(String testId, RequestOptions requestOptions) { return new PagedIterable<>(this.client.getAllTestFiles(testId, requestOptions)); } + + /** + * List all test files. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
continuationTokenStringNoContinuation token to get the next page of response.
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(0/1/2) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String (Optional)
+     *         }
+     *     ]
+     *     nextLink: String (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTestFiles(testId, requestOptions)); + } } From 1f2b6c2240d04b56a5728b0fb4e0c09bb8f20e81 Mon Sep 17 00:00:00 2001 From: Harshan B Date: Tue, 11 Oct 2022 22:49:39 +0530 Subject: [PATCH 17/18] Change subclient getter method Update session-records and README.md --- sdk/loadtestservice/azure-developer-loadtesting/README.md | 6 +++--- .../developer/loadtesting/LoadTestingAsyncClient.java | 4 ++-- .../azure/developer/loadtesting/LoadTestingClient.java | 8 ++++---- .../com/azure/developer/loadtesting/ReadmeSamples.java | 6 +++--- .../loadtesting/CreateAndUpdateTestRunTests.java | 4 ++-- .../developer/loadtesting/CreateOrUpdateTestTests.java | 4 ++-- .../azure/developer/loadtesting/UploadTestFileTests.java | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index b594da0616d9f..47ae5a06efe85 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -120,7 +120,7 @@ testMap.put("environmentVariables", envVarMap); BinaryData test = BinaryData.fromObject(testMap); -Response testOutResponse = client.getLoadTestAdministration().createOrUpdateTestWithResponse("test12345", test, null); +Response testOutResponse = client.getLoadTestAdministrationClient().createOrUpdateTestWithResponse("test12345", test, null); System.out.println(testOutResponse.getValue().toString()); ``` @@ -133,7 +133,7 @@ LoadTestingClient client = new LoadTestingClientBuilder() .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); -Response fileUrlOut = client.getLoadTestAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); +Response fileUrlOut = client.getLoadTestAdministrationClient().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); System.out.println(fileUrlOut.getValue().toString()); ``` @@ -155,7 +155,7 @@ testRunMap.put("loadTestConfig", loadTestConfigMap); BinaryData testRun = BinaryData.fromObject(testRunMap); -Response testRunOut = client.getLoadTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); +Response testRunOut = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); System.out.println(testRunOut.getValue().toString()); ``` diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java index 2d32627e26307..3476b051a1a23 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingAsyncClient.java @@ -35,7 +35,7 @@ public final class LoadTestingAsyncClient { * * @return {@link LoadTestAdministrationAsyncClient} object. */ - public LoadTestAdministrationAsyncClient getLoadTestAdministration() { + public LoadTestAdministrationAsyncClient getLoadTestAdministrationAsyncClient() { return this.administration; } @@ -44,7 +44,7 @@ public LoadTestAdministrationAsyncClient getLoadTestAdministration() { * * @return {@link TestRunAsyncClient} object. */ - public TestRunAsyncClient getLoadTestRun() { + public TestRunAsyncClient getLoadTestRunAsyncClient() { return this.testRun; } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java index 76b733926196f..3b175f833813a 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClient.java @@ -25,8 +25,8 @@ public final class LoadTestingClient { * @param serviceClient the service client implementation. */ LoadTestingClient(LoadTestingAsyncClient client) { - this.administration = new LoadTestAdministrationClient(client.getLoadTestAdministration()); - this.testRun = new TestRunClient(client.getLoadTestRun()); + this.administration = new LoadTestAdministrationClient(client.getLoadTestAdministrationAsyncClient()); + this.testRun = new TestRunClient(client.getLoadTestRunAsyncClient()); } /** @@ -34,7 +34,7 @@ public final class LoadTestingClient { * * @return {@link LoadTestAdministrationClient} object. */ - public LoadTestAdministrationClient getLoadTestAdministration() { + public LoadTestAdministrationClient getLoadTestAdministrationClient() { return this.administration; } @@ -43,7 +43,7 @@ public LoadTestAdministrationClient getLoadTestAdministration() { * * @return {@link TestRunClient} object. */ - public TestRunClient getLoadTestRun() { + public TestRunClient getLoadTestRunClient() { return this.testRun; } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java index 4e54dfadb4025..eb31519e8ea4b 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -36,7 +36,7 @@ public void createTest() { BinaryData test = BinaryData.fromObject(testMap); - Response testOutResponse = client.getLoadTestAdministration().createOrUpdateTestWithResponse("test12345", test, null); + Response testOutResponse = client.getLoadTestAdministrationClient().createOrUpdateTestWithResponse("test12345", test, null); System.out.println(testOutResponse.getValue().toString()); // END: java-readme-sample-createTest } @@ -49,7 +49,7 @@ public void uploadTestFile() throws IOException { .buildClient(); BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - Response fileUrlOut = client.getLoadTestAdministration().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); + Response fileUrlOut = client.getLoadTestAdministrationClient().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); System.out.println(fileUrlOut.getValue().toString()); // END: java-readme-sample-uploadTestFile } @@ -71,7 +71,7 @@ public void runTest() { BinaryData testRun = BinaryData.fromObject(testRunMap); - Response testRunOut = client.getLoadTestRun().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); + Response testRunOut = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); System.out.println(testRunOut.getValue().toString()); // END: java-readme-sample-runTest } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java index 54bd2e735d263..4719d8f26b91d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java @@ -28,7 +28,7 @@ private Map getTestRunBodyFromDict() { public void createAndUpdateTestRunString() { BinaryData file = BinaryData.fromString(createTestRunBodyJson); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getLoadTestRun().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); + Response response = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); Assertions.assertEquals(200, response.getStatusCode()); } @@ -36,7 +36,7 @@ public void createAndUpdateTestRunString() { public void createAndUpdateTestRunDict() { BinaryData file = BinaryData.fromObject(getTestRunBodyFromDict()); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getLoadTestRun().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); + Response response = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); Assertions.assertEquals(200, response.getStatusCode()); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java index 5153d53697cf4..b20d3cddd9ee6 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestTests.java @@ -41,7 +41,7 @@ private Map getTestBodyFromDict() { public void createOrUpdateTestString() { BinaryData body = BinaryData.fromString(createTestBodyJson); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getLoadTestAdministration().createOrUpdateTestWithResponse(defaultTestId, body, requestOptions); + Response response = client.getLoadTestAdministrationClient().createOrUpdateTestWithResponse(defaultTestId, body, requestOptions); Assertions.assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); } @@ -49,7 +49,7 @@ public void createOrUpdateTestString() { public void createOrUpdateTestDictDict() { BinaryData body = BinaryData.fromObject(getTestBodyFromDict()); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getLoadTestAdministration().createOrUpdateTestWithResponse(defaultTestId, body, requestOptions); + Response response = client.getLoadTestAdministrationClient().createOrUpdateTestWithResponse(defaultTestId, body, requestOptions); Assertions.assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java index b4b9dbc00008b..bdc730ac8ce98 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/UploadTestFileTests.java @@ -20,7 +20,7 @@ public final class UploadTestFileTests extends LoadTestingClientTestBase { public void uploadTestFile() throws IOException { BinaryData file = BinaryData.fromFile(new File(fileJmxUrl.getPath()).toPath()); RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "2"); - Response response = client.getLoadTestAdministration().uploadTestFileWithResponse( + Response response = client.getLoadTestAdministrationClient().uploadTestFileWithResponse( defaultTestId, defaultFileId, fileJmxName, From 69b03995a57982fb83b21978e33313396882144a Mon Sep 17 00:00:00 2001 From: Harshan B Date: Wed, 12 Oct 2022 10:23:08 +0530 Subject: [PATCH 18/18] Final cleanup Rename test run createAndUpdate to createOrUpdate --- .../azure-developer-loadtesting/CHANGELOG.md | 10 +- .../azure-developer-loadtesting/README.md | 151 ++++++++++++++---- .../azure-developer-loadtesting/pom.xml | 6 - .../loadtesting/LoadTestingClientBuilder.java | 2 +- .../loadtesting/TestRunAsyncClient.java | 4 +- .../developer/loadtesting/TestRunClient.java | 4 +- .../implementation/TestRunsImpl.java | 14 +- .../developer/loadtesting/ReadmeSamples.java | 109 ++++++++++++- ...s.java => CreateOrUpdateTestRunTests.java} | 10 +- ...stRunTests.createOrUpdateTestRunDict.json} | 0 ...RunTests.createOrUpdateTestRunString.json} | 0 .../swagger/README.md | 4 +- 12 files changed, 248 insertions(+), 66 deletions(-) rename sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/{CreateAndUpdateTestRunTests.java => CreateOrUpdateTestRunTests.java} (81%) rename sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/{CreateAndUpdateTestRunTests.createAndUpdateTestRunDict.json => CreateOrUpdateTestRunTests.createOrUpdateTestRunDict.json} (100%) rename sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/{CreateAndUpdateTestRunTests.createAndUpdateTestRunString.json => CreateOrUpdateTestRunTests.createOrUpdateTestRunString.json} (100%) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md index fdec08a525331..c520be8dd49c1 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md @@ -2,12 +2,4 @@ ## 1.0.0-beta.1 (Unreleased) -- Azure LoadTestingClient client library for Java. This package contains Microsoft Azure LoadTestingClient client library. - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Initial preview release of Azure LoadTestingClient client library for Java. This package contains Microsoft Azure LoadTestingClient client library. diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md index 47ae5a06efe85..545fda349dd07 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -1,4 +1,4 @@ -# Azure Developer LoadTesting client library for Java +# Azure Load Testing client library for Java Azure Load Testing provides client library in Java to the user by which they can interact natively with Azure Load Testing service. Azure Load Testing is a fully managed load-testing service that enables you to generate high-scale load. The service simulates traffic for your applications, regardless of where they're hosted. Developers, testers, and quality assurance (QA) engineers can use it to optimize application performance, scalability, or capacity @@ -18,6 +18,7 @@ Various documentation is available to help you get started - [Java Development Kit (JDK)][jdk] with version 8 or above - [Azure Subscription][azure_subscription] +- Azure Load Testing resource ### Adding the package to your product @@ -45,49 +46,50 @@ In addition, Azure subscription ID can be configured via environment variable `A With above configuration, `azure` client can be authenticated by following code: -```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +```java java-readme-sample-auth +// ensure the user, service principal or managed identity used has Loadtesting Contributor role for the resource TokenCredential credential = new DefaultAzureCredentialBuilder() - .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); -TestClientBuilder testClientBuilder = new TestClientBuilder(); -TestClient testClient = testClientBuilder +// create client using DefaultAzureCredential +LoadTestingClient client = new LoadTestingClientBuilder() .credential(credential) .endpoint("") .buildClient(); +LoadTestAdministrationClient adminClient = client.getLoadTestAdministrationClient(); +TestRunClient testRunClient = client.getLoadTestRunClient(); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +## Key concepts -Authentication in this SDK is similar to Azure Management Libraries. See [Authentication][authenticate] for more options. +The following components make up the Azure Load Testing service. The Azure Load Test client library for Java allows you to interact with each of these components through the use of clients. There are two top-level clients which are the main entry points for the library -An important distinction is that Azure Management libraries use `authenticate` method to accept credential along with Azure profile, where this SDK uses `credential` method and only accept the credential parameter. +- `LoadTestingClient` -## Key concepts +- `LoadTestingAsyncClient` -The following components make up the Azure Load Testing Service. The Azure Load Test client library for Python allows you to interact with each of these components through the use of a dedicated client object. +The two clients have similar methods in them except the methods in the async client are async as well. -### Load testing resource +The top-level clients have two sub-clients -The Load testing resource is the top-level resource for your load-testing activities. This resource provides a centralized place to view and manage load tests, test results, and related artifacts. A load testing resource contains zero or more load tests. +- `LoadTestAdministration` -### Test +- `TestRun` -A test specifies the test script, and configuration settings for running a load test. You can create one or more tests in an Azure Load Testing resource. +These sub-clients are used for managing and using different components of the service. -### Test Engine +### Load Test Administration Client -A test engine is computing infrastructure that runs the Apache JMeter test script. You can scale out your load test by configuring the number of test engines. The test script runs in parallel across the specified number of test engines. +The `LoadTestAdministration` sub-clients is used to administer and configure the load tests, app components and metrics. -### Test Run +#### Test -A test run represents one execution of a load test. It collects the logs associated with running the Apache JMeter script, the load test YAML configuration, the list of app components to monitor, and the results of the test. +A test specifies the test script, and configuration settings for running a load test. You can create one or more tests in an Azure Load Testing resource. -### App Component +#### App Component When you run a load test for an Azure-hosted application, you can monitor resource metrics for the different Azure application components (server-side metrics). While the load test runs, and after completion of the test, you can monitor and analyze the resource metrics in the Azure Load Testing dashboard. -### Metrics +#### Metrics During a load test, Azure Load Testing collects metrics about the test execution. There are two types of metrics: @@ -95,6 +97,24 @@ During a load test, Azure Load Testing collects metrics about the test execution 2. Server-side metrics are available for Azure-hosted applications and provide information about your Azure application components. Metrics can be for the number of database reads, the type of HTTP responses, or container resource consumption. +### Test Run Client + +The `TestRun` sub-clients is used to start and stop test runs corresponding to a load test. A test run represents one execution of a load test. It collects the logs associated with running the Apache JMeter script, the load test YAML configuration, the list of app components to monitor, and the results of the test. + +### Data-Plane Endpoint + +Data-plane of Azure Load Testing resources is addressable using the following URL format: + +`00000000-0000-0000-0000-000000000000.aaa.cnt-prod.loadtesting.azure.com` + +The first GUID `00000000-0000-0000-0000-000000000000` is the unique identifier used for accessing the Azure Load Testing resource. This is followed by `aaa` which is the Azure region of the resource. + +The data-plane endpoint is obtained from Control Plane APIs. + +**Example:** `1234abcd-12ab-12ab-12ab-123456abcdef.eus.cnt-prod.loadtesting.azure.com` + +In the above example, `eus` represents the Azure region `East US`. + ## Examples ### Creating a Load Test @@ -105,21 +125,47 @@ LoadTestingClient client = new LoadTestingClientBuilder() .endpoint("") .buildClient(); +// construct Test object using nested String:Object Maps Map testMap = new HashMap(); testMap.put("displayName", "Sample Display Name"); testMap.put("description", "Sample Description"); +// loadTestConfig describes the number of test engines to generate load Map loadTestConfigMap = new HashMap(); loadTestConfigMap.put("engineInstances", 1); testMap.put("loadTestConfig", loadTestConfigMap); +// environmentVariables are plain-text data passed to test engines Map envVarMap = new HashMap(); envVarMap.put("a", "b"); envVarMap.put("x", "y"); testMap.put("environmentVariables", envVarMap); +// secrets are secure data sent using Azure Key Vault +Map secretMap = new HashMap(); +Map sampleSecretMap = new HashMap(); +sampleSecretMap.put("value", "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827"); +sampleSecretMap.put("type", "AKV_SECRET_URI"); +secretMap.put("sampleSecret", sampleSecretMap); +testMap.put("secrets", secretMap); + +// passFailCriteria define the conditions to conclude the test as success +Map passFailMap = new HashMap(); +Map passFailMetrics = new HashMap(); +Map samplePassFailMetric = new HashMap(); +samplePassFailMetric.put("clientmetric", "response_time_ms"); +samplePassFailMetric.put("aggregate", "percentage"); +samplePassFailMetric.put("condition", ">"); +samplePassFailMetric.put("value", "20"); +samplePassFailMetric.put("action", "continue"); +passFailMetrics.put("fefd759d-7fe8-4f83-8b6d-aeebe0f491fe", samplePassFailMetric); +passFailMap.put("passFailMetrics", passFailMetrics); +testMap.put("passFailCriteria", passFailMap); + +// convert the object Map to JSON BinaryData BinaryData test = BinaryData.fromObject(testMap); +// receive response with BinaryData content Response testOutResponse = client.getLoadTestAdministrationClient().createOrUpdateTestWithResponse("test12345", test, null); System.out.println(testOutResponse.getValue().toString()); ``` @@ -132,7 +178,10 @@ LoadTestingClient client = new LoadTestingClientBuilder() .endpoint("") .buildClient(); +// extract file contents to BinaryData BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); + +// receive response with BinaryData content Response fileUrlOut = client.getLoadTestAdministrationClient().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); System.out.println(fileUrlOut.getValue().toString()); ``` @@ -145,18 +194,67 @@ LoadTestingClient client = new LoadTestingClientBuilder() .endpoint("") .buildClient(); +// construct Test Run object using nested String:Object Maps Map testRunMap = new HashMap(); testRunMap.put("testId", "test12345"); testRunMap.put("displayName", "SDK-Created-TestRun"); -Map loadTestConfigMap = new HashMap(); -loadTestConfigMap.put("engineInstances", 2); -testRunMap.put("loadTestConfig", loadTestConfigMap); - +// convert the object Map to JSON BinaryData BinaryData testRun = BinaryData.fromObject(testRunMap); -Response testRunOut = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); +// receive response with BinaryData content +Response testRunOut = client.getLoadTestRunClient().createOrUpdateTestRunWithResponse("testrun12345", testRun, null); System.out.println(testRunOut.getValue().toString()); + +// wait for test to reach terminal state +JsonNode testRunJson = null; +String testStatus = null, startDateTime = null, endDateTime = null; +while (testStatus == null || (testStatus != "DONE" && testStatus != "CANCELLED" && testStatus != "FAILED")) { + testRunOut = client.getLoadTestRunClient().getTestRunWithResponse("testrun12345", null); + // parse JSON and read status value + try { + testRunJson = new ObjectMapper().readTree(testRunOut.getValue().toString()); + testStatus = testRunJson.get("status").asText(); + } catch (JsonProcessingException e) { + System.out.println("Error processing JSON response"); + // handle error condition + } + + // wait and check test status every 5 seconds + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + // handle interruption + } +} + +startDateTime = testRunJson.get("startDateTime").asText(); +endDateTime = testRunJson.get("endDateTime").asText(); + +// construct Test Run Client Metrics object using nested String:Object Maps +Map clientMetricsMap = new HashMap(); +List requestSamplersList = new ArrayList(); +requestSamplersList.add("Homepage"); +clientMetricsMap.put("requestSamplers", requestSamplersList); + +List errorsList = new ArrayList(); +errorsList.add("500"); +clientMetricsMap.put("errors", errorsList); + +List percentilesList = new ArrayList(); +percentilesList.add("95"); +clientMetricsMap.put("percentiles", percentilesList); + +clientMetricsMap.put("groupByInterval", "10s"); +clientMetricsMap.put("startTime", startDateTime); +clientMetricsMap.put("endTime", endDateTime); + +// convert the object Map to JSON BinaryData +BinaryData clientMetrics = BinaryData.fromObject(clientMetricsMap); + +// fetch client metrics +Response clientMetricsOut = client.getLoadTestRunClient().getTestRunClientMetricsWithResponse("testrun12345", clientMetrics, null); +System.out.println(clientMetricsOut.getValue().toString()); ``` ## Troubleshooting @@ -188,5 +286,4 @@ For details on contributing to this repository, see the [contributing guide](htt [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK diff --git a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml index deb11e3f47a7d..b780ac7de0616 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml +++ b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml @@ -75,11 +75,5 @@ 1.6.1 test
- - org.slf4j - slf4j-simple - 1.7.36 - test - diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClientBuilder.java index 4b79cf6b6844e..ab7e002018831 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClientBuilder.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingClientBuilder.java @@ -49,7 +49,7 @@ public final class LoadTestingClientBuilder private static final String SDK_VERSION = "version"; - private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + private static final String[] DEFAULT_SCOPES = new String[] {"https://cnt-prod.loadtesting.azure.com/.default"}; private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java index 51a4fd0622594..c0be6a21b527c 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -618,9 +618,9 @@ public Mono> getTestRunClientMetricsFiltersWithResponse( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAndUpdateTestRunWithResponse( + public Mono> createOrUpdateTestRunWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createAndUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); + return this.serviceClient.createOrUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); } /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java index f70a59b252567..6efc6c671ab85 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -614,9 +614,9 @@ public Response getTestRunClientMetricsFiltersWithResponse( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAndUpdateTestRunWithResponse( + public Response createOrUpdateTestRunWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.client.createAndUpdateTestRunWithResponse(testRunId, body, requestOptions).block(); + return this.client.createOrUpdateTestRunWithResponse(testRunId, body, requestOptions).block(); } /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java index 5d4b613fca96c..bd605590ef5bd 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java @@ -95,7 +95,7 @@ Mono> deleteTestRun( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createAndUpdateTestRun( + Mono> createOrUpdateTestRun( @HostParam("Endpoint") String endpoint, @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, @@ -518,12 +518,12 @@ public Response deleteTestRunWithResponse(String testRunId, RequestOptions * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAndUpdateTestRunWithResponseAsync( + public Mono> createOrUpdateTestRunWithResponseAsync( String testRunId, BinaryData body, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.createAndUpdateTestRun( + service.createOrUpdateTestRun( this.client.getEndpoint(), testRunId, this.client.getServiceVersion().getVersion(), @@ -741,10 +741,10 @@ public Mono> createAndUpdateTestRunWithResponseAsync( * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAndUpdateTestRunWithResponseAsync( + public Mono> createOrUpdateTestRunWithResponseAsync( String testRunId, BinaryData body, RequestOptions requestOptions, Context context) { final String accept = "application/json"; - return service.createAndUpdateTestRun( + return service.createOrUpdateTestRun( this.client.getEndpoint(), testRunId, this.client.getServiceVersion().getVersion(), @@ -961,9 +961,9 @@ public Mono> createAndUpdateTestRunWithResponseAsync( * @return load test run model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAndUpdateTestRunWithResponse( + public Response createOrUpdateTestRunWithResponse( String testRunId, BinaryData body, RequestOptions requestOptions) { - return createAndUpdateTestRunWithResponseAsync(testRunId, body, requestOptions).block(); + return createOrUpdateTestRunWithResponseAsync(testRunId, body, requestOptions).block(); } /** diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java index eb31519e8ea4b..da11ce5078729 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -6,14 +6,35 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import com.azure.core.credential.TokenCredential; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; public final class ReadmeSamples { + public void auth() { + // BEGIN: java-readme-sample-auth + // ensure the user, service principal or managed identity used has Loadtesting Contributor role for the resource + TokenCredential credential = new DefaultAzureCredentialBuilder() + .build(); + // create client using DefaultAzureCredential + LoadTestingClient client = new LoadTestingClientBuilder() + .credential(credential) + .endpoint("") + .buildClient(); + LoadTestAdministrationClient adminClient = client.getLoadTestAdministrationClient(); + TestRunClient testRunClient = client.getLoadTestRunClient(); + // END: java-readme-sample-auth + } + public void createTest() { // BEGIN: java-readme-sample-createTest LoadTestingClient client = new LoadTestingClientBuilder() @@ -21,21 +42,47 @@ public void createTest() { .endpoint("") .buildClient(); + // construct Test object using nested String:Object Maps Map testMap = new HashMap(); testMap.put("displayName", "Sample Display Name"); testMap.put("description", "Sample Description"); + // loadTestConfig describes the number of test engines to generate load Map loadTestConfigMap = new HashMap(); loadTestConfigMap.put("engineInstances", 1); testMap.put("loadTestConfig", loadTestConfigMap); + // environmentVariables are plain-text data passed to test engines Map envVarMap = new HashMap(); envVarMap.put("a", "b"); envVarMap.put("x", "y"); testMap.put("environmentVariables", envVarMap); + // secrets are secure data sent using Azure Key Vault + Map secretMap = new HashMap(); + Map sampleSecretMap = new HashMap(); + sampleSecretMap.put("value", "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827"); + sampleSecretMap.put("type", "AKV_SECRET_URI"); + secretMap.put("sampleSecret", sampleSecretMap); + testMap.put("secrets", secretMap); + + // passFailCriteria define the conditions to conclude the test as success + Map passFailMap = new HashMap(); + Map passFailMetrics = new HashMap(); + Map samplePassFailMetric = new HashMap(); + samplePassFailMetric.put("clientmetric", "response_time_ms"); + samplePassFailMetric.put("aggregate", "percentage"); + samplePassFailMetric.put("condition", ">"); + samplePassFailMetric.put("value", "20"); + samplePassFailMetric.put("action", "continue"); + passFailMetrics.put("fefd759d-7fe8-4f83-8b6d-aeebe0f491fe", samplePassFailMetric); + passFailMap.put("passFailMetrics", passFailMetrics); + testMap.put("passFailCriteria", passFailMap); + + // convert the object Map to JSON BinaryData BinaryData test = BinaryData.fromObject(testMap); + // receive response with BinaryData content Response testOutResponse = client.getLoadTestAdministrationClient().createOrUpdateTestWithResponse("test12345", test, null); System.out.println(testOutResponse.getValue().toString()); // END: java-readme-sample-createTest @@ -48,7 +95,10 @@ public void uploadTestFile() throws IOException { .endpoint("") .buildClient(); + // extract file contents to BinaryData BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); + + // receive response with BinaryData content Response fileUrlOut = client.getLoadTestAdministrationClient().uploadTestFileWithResponse("test12345", "file12345", "sample-file.jmx", fileData, null); System.out.println(fileUrlOut.getValue().toString()); // END: java-readme-sample-uploadTestFile @@ -61,18 +111,67 @@ public void runTest() { .endpoint("") .buildClient(); + // construct Test Run object using nested String:Object Maps Map testRunMap = new HashMap(); testRunMap.put("testId", "test12345"); testRunMap.put("displayName", "SDK-Created-TestRun"); - Map loadTestConfigMap = new HashMap(); - loadTestConfigMap.put("engineInstances", 2); - testRunMap.put("loadTestConfig", loadTestConfigMap); - + // convert the object Map to JSON BinaryData BinaryData testRun = BinaryData.fromObject(testRunMap); - Response testRunOut = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse("testrun12345", testRun, null); + // receive response with BinaryData content + Response testRunOut = client.getLoadTestRunClient().createOrUpdateTestRunWithResponse("testrun12345", testRun, null); System.out.println(testRunOut.getValue().toString()); + + // wait for test to reach terminal state + JsonNode testRunJson = null; + String testStatus = null, startDateTime = null, endDateTime = null; + while (testStatus == null || (testStatus != "DONE" && testStatus != "CANCELLED" && testStatus != "FAILED")) { + testRunOut = client.getLoadTestRunClient().getTestRunWithResponse("testrun12345", null); + // parse JSON and read status value + try { + testRunJson = new ObjectMapper().readTree(testRunOut.getValue().toString()); + testStatus = testRunJson.get("status").asText(); + } catch (JsonProcessingException e) { + System.out.println("Error processing JSON response"); + // handle error condition + } + + // wait and check test status every 5 seconds + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + // handle interruption + } + } + + startDateTime = testRunJson.get("startDateTime").asText(); + endDateTime = testRunJson.get("endDateTime").asText(); + + // construct Test Run Client Metrics object using nested String:Object Maps + Map clientMetricsMap = new HashMap(); + List requestSamplersList = new ArrayList(); + requestSamplersList.add("Homepage"); + clientMetricsMap.put("requestSamplers", requestSamplersList); + + List errorsList = new ArrayList(); + errorsList.add("500"); + clientMetricsMap.put("errors", errorsList); + + List percentilesList = new ArrayList(); + percentilesList.add("95"); + clientMetricsMap.put("percentiles", percentilesList); + + clientMetricsMap.put("groupByInterval", "10s"); + clientMetricsMap.put("startTime", startDateTime); + clientMetricsMap.put("endTime", endDateTime); + + // convert the object Map to JSON BinaryData + BinaryData clientMetrics = BinaryData.fromObject(clientMetricsMap); + + // fetch client metrics + Response clientMetricsOut = client.getLoadTestRunClient().getTestRunClientMetricsWithResponse("testrun12345", clientMetrics, null); + System.out.println(clientMetricsOut.getValue().toString()); // END: java-readme-sample-runTest } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestRunTests.java similarity index 81% rename from sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java rename to sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestRunTests.java index 4719d8f26b91d..fe6ac0c93ad4d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateAndUpdateTestRunTests.java +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/CreateOrUpdateTestRunTests.java @@ -11,7 +11,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -public final class CreateAndUpdateTestRunTests extends LoadTestingClientTestBase { +public final class CreateOrUpdateTestRunTests extends LoadTestingClientTestBase { private final String createTestRunBodyJson = "{\"testId\":\"" + defaultTestId + "\"" + ",\"description\":\"Sample Test Run\",\"displayName\":\"Java SDK Sample Test Run\"}"; @@ -25,18 +25,18 @@ private Map getTestRunBodyFromDict() { } @Test - public void createAndUpdateTestRunString() { + public void createOrUpdateTestRunString() { BinaryData file = BinaryData.fromString(createTestRunBodyJson); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); + Response response = client.getLoadTestRunClient().createOrUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); Assertions.assertEquals(200, response.getStatusCode()); } @Test - public void createAndUpdateTestRunDict() { + public void createOrUpdateTestRunDict() { BinaryData file = BinaryData.fromObject(getTestRunBodyFromDict()); RequestOptions requestOptions = new RequestOptions(); - Response response = client.getLoadTestRunClient().createAndUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); + Response response = client.getLoadTestRunClient().createOrUpdateTestRunWithResponse(defaultTestRunId, file, requestOptions); Assertions.assertEquals(200, response.getStatusCode()); } } diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunDict.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestRunTests.createOrUpdateTestRunDict.json similarity index 100% rename from sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunDict.json rename to sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestRunTests.createOrUpdateTestRunDict.json diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunString.json b/sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestRunTests.createOrUpdateTestRunString.json similarity index 100% rename from sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateAndUpdateTestRunTests.createAndUpdateTestRunString.json rename to sdk/loadtestservice/azure-developer-loadtesting/src/test/resources/session-records/CreateOrUpdateTestRunTests.createOrUpdateTestRunString.json diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index 6e40efea3ac39..e41653f0d1ce0 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -6,7 +6,7 @@ java: true regenerate-pom: false title: LoadTestingClient security: AADToken -security-scopes: https://loadtest.azure-dev.com/.default +security-scopes: https://cnt-prod.loadtesting.azure.com/.default data-plane: true generate-models: false generate-samples: false @@ -21,7 +21,7 @@ directive: - from: swagger-document where: '$.paths["/testruns/{testRunId}"].patch' transform: > - $["operationId"] = "TestRun_CreateAndUpdateTestRun"; + $["operationId"] = "TestRun_CreateOrUpdateTestRun"; - from: swagger-document where: '$.paths.*[?(@.tags=="AppComponent")]' transform: >