diff --git a/sdk/loadtesting/azure-developer-loadtesting/CHANGELOG.md b/sdk/loadtesting/azure-developer-loadtesting/CHANGELOG.md deleted file mode 100644 index 0f94332cbc99..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/CHANGELOG.md +++ /dev/null @@ -1,264 +0,0 @@ -# Release History - -## 1.1.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.21 (2025-02-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.54.1` to version `1.55.2`. -- Upgraded `azure-core-http-netty` from `1.15.7` to version `1.15.10`. - -## 1.0.20 (2025-01-20) - -### Other Changes - -- Add NOT_VALIDATED to the list of terminal states for the file validation poller. - - -## 1.0.19 (2024-12-04) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.53.0` to version `1.54.1`. -- Upgraded `azure-core-http-netty` from `1.15.5` to version `1.15.7`. - - -## 1.0.18 (2024-10-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.4` to version `1.15.5`. -- Upgraded `azure-core` from `1.52.0` to version `1.53.0`. - - -## 1.0.17 (2024-09-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.51.0` to version `1.52.0`. -- Upgraded `azure-core-http-netty` from `1.15.3` to version `1.15.4`. - - -## 1.0.16 (2024-08-24) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.2` to version `1.15.3`. -- Upgraded `azure-core` from `1.50.0` to version `1.51.0`. - - -## 1.0.15 (2024-07-26) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`. -- Upgraded `azure-core` from `1.49.1` to version `1.50.0`. - - -## 1.0.14 (2024-06-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.0` to version `1.15.1`. -- Upgraded `azure-core` from `1.49.0` to version `1.49.1`. - - -## 1.0.13 (2024-05-28) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.48.0` to version `1.49.0`. -- Upgraded `azure-core-http-netty` from `1.14.2` to version `1.15.0`. - - -## 1.0.12 (2024-04-23) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. -- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. - - -## 1.0.11 (2024-03-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - - -## 1.0.10 (2024-02-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.11` to version `1.14.0`. -- Upgraded `azure-core` from `1.45.1` to version `1.46.0`. - - -## 1.0.9 (2023-12-04) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.10` to version `1.13.11`. -- Upgraded `azure-core` from `1.45.0` to version `1.45.1`. - - -## 1.0.8 (2023-11-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.44.1` to version `1.45.0`. -- Upgraded `azure-core-http-netty` from `1.13.9` to version `1.13.10`. - - -## 1.0.7 (2023-10-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.43.0` to version `1.44.1`. -- Upgraded `azure-core-http-netty` from `1.13.7` to version `1.13.9`. - - -## 1.0.6 (2023-09-22) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.42.0` to version `1.43.0`. -- Upgraded `azure-core-http-netty` from `1.13.6` to version `1.13.7`. - - -## 1.0.5 (2023-08-18) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.41.0` to version `1.42.0`. -- Upgraded `azure-core-http-netty` from `1.13.5` to version `1.13.6`. - -## 1.0.4 (2023-07-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.40.0` to version `1.41.0`. -- Upgraded `azure-core-http-netty` from `1.13.4` to version `1.13.5`. - -## 1.0.3 (2023-06-21) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.39.0` to version `1.40.0`. -- Upgraded `azure-core-http-netty` from `1.13.3` to version `1.13.4`. - -## 1.0.2 (2023-05-22) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.38.0` to version `1.39.0`. -- Upgraded `azure-core-http-netty` from `1.13.2` to version `1.13.3`. - -## 1.0.1 (2023-04-24) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.37.0` to version `1.38.0`. -- Upgraded `azure-core-http-netty` from `1.13.1` to version `1.13.2`. - -## 1.0.0 (2023-03-07) - -- First stable release of Azure Load Testing client library for Java - -### Breaking Changes - -- Reintroduce two client builders - `LoadTestAdministrationClientBuilder` and `LoadTestRunClientBuilder` -- Rename `metricname` parameter to `metricName` in `LoadTestRunClient.listMetrics` -- Rename `LoadTestRunClient.listMetricDefinitionsWithResponse` to `LoadTestRunClient.getMetricDefinitionsWithResponse` -- Rename `LoadTestRunClient.listMetricNamespacesWithResponse` to `LoadTestRunClient.getMetricNamespacesWithResponse` - -### Other Changes - -- Updated samples and test cases - -## 1.0.0-beta.2 (2023-01-22) - -- Second preview release of Azure Load Testing client library for Java. - -### Features Added - -- Added sync and async versions of `LoadTestRunClient.listMetricNamespacesWithResponse` -- Added sync and async versions of `LoadTestRunClient.listMetricDefinitionsWithResponse` -- Added sync and async versions of `LoadTestRunClient.listMetrics` -- Added sync and async versions of `LoadTestRunClient.listMetricDimensionValues` -- Added sync and async versions of `LoadTestRunClient.createOrUpdateAppComponentWithResponse` -- Added sync and async versions of `LoadTestRunClient.getAppComponentsWithResponse` -- Added sync and async versions of `LoadTestRunClient.createOrUpdateServerMetricsConfigWithResponse` -- Added sync and async versions of `LoadTestRunClient.getServerMetricsConfigWithResponse` -- Added sync and async versions of `LoadTestAdministrationClient.beginUploadTestFile` and `LoadTestRunClient.beginTestRun` Long-Running operation - -### Breaking Changes - -- There is a single builder which builds `LoadTestAdministration` and `LoadTestRun` clients, rather than a client which provides them via accessor methods previously -- Added metric namespaces and metric dimensions -- File upload now uses `application/octet-stream` instead of `multipart/form-data` -- File upload now uses file name as primary identifier instead of `fileId` -- Removed sync and async versions of `LoadTestAdministrationClient.ListSupportedResourceType` -- Removed sync and async versions of `LoadTestAdministrationClient.DeleteAppComponent` and `LoadTestAdministrationClient.DeleteAppComponentByName` -- Removed sync and async versions of `LoadTestAdministrationClient.DeleteServerMetrics` and `LoadTestAdministrationClient.DeleteServerMetricsByName` -- Removed sync and async versions of `TestRunClient.GetTestRunClientMetrics` and `TestRunClient.GetTestRunClientMetricsFilters` -- Removed sync and async versions of `TestRunClient.GetServerDefaultMetrics` - -### Other Changes - -- README updated -- Added samples and test cases - -## 1.0.0-beta.1 (2022-10-22) - -- Initial preview release of Azure Load Testing client library for Java with single top-level `LoadTesting` client, and `LoadTestAdministration` and `TestRun` subclients. diff --git a/sdk/loadtesting/azure-developer-loadtesting/README.md b/sdk/loadtesting/azure-developer-loadtesting/README.md deleted file mode 100644 index 376f58fa0f32..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/README.md +++ /dev/null @@ -1,333 +0,0 @@ -# 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 - -This package contains Microsoft Azure Developer LoadTesting client library. - -## Documentation - -Various documentation is available to help you get started - -- [Source code][source_code] -- [API reference documentation][api_reference_doc] -- [Product Documentation][product_documentation] - -## Getting started - -### Prerequisites - -- [Java Development Kit (JDK)][jdk] with version 8 or above -- [Azure Subscription][azure_subscription] -- Azure Load Testing resource - -### Adding the package to your product - -[//]: # ({x-version-update-start;com.azure:azure-developer-loadtesting;current}) -```xml - - com.azure - azure-developer-loadtesting - 1.0.20 - -``` -[//]: # ({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 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 -LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); -LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); - -RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); -adminClient.listTests(reqOpts); - -reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); -testRunClient.listTestRuns(reqOpts); -``` - -## Key concepts - -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 - -- `LoadTestingClient` - -- `LoadTestingAsyncClient` - -The two clients have similar methods in them except the methods in the async client are async as well. - -The top-level clients have two sub-clients - -- `LoadTestAdministration` - -- `TestRun` - -These sub-clients are used for managing and using different components of the service. - -### Load Test Administration Client - -The `LoadTestAdministration` sub-clients is used to administer and configure the load tests, app components and metrics. - -#### 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 - -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. - -### 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 - -```java java-readme-sample-createTest -LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .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("loadTestConfiguration", 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 = adminClient.createOrUpdateTestWithResponse("test12345", test, null); -System.out.println(testOutResponse.getValue().toString()); -``` - -### Uploading .jmx file to a Load Test - -```java java-readme-sample-uploadTestFile -LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - -// extract file contents to BinaryData -BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - -// receive response with BinaryData content -PollResponse fileUrlOut = adminClient.beginUploadTestFile("test12345", "sample-file.jmx", fileData, null) - .waitForCompletion(Duration.ofMinutes(2)); -System.out.println(fileUrlOut.getValue().toString()); -``` - -### Running a Load Test - -```java java-readme-sample-runTest -LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .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"); - -// convert the object Map to JSON BinaryData -BinaryData testRun = BinaryData.fromObject(testRunMap); - -// start test with poller -SyncPoller poller = testRunClient.beginTestRun("testrun12345", testRun, null); -Duration pollInterval = Duration.ofSeconds(5); -poller = poller.setPollInterval(pollInterval); - -// wait for test to reach terminal state -Map jsonTree = null; -String testStatus; -PollResponse pollResponse = poller.poll(); -while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // wait and check test status every 5 seconds - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); -} - -poller.waitForCompletion(); -BinaryData testRunBinary = poller.getFinalResult(); - -try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); -} catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition -} - -String startDateTime = jsonTree.get("startDateTime").toString(); -String endDateTime = jsonTree.get("endDateTime").toString(); -OffsetDateTime startOffsetDateTime = OffsetDateTime.parse(startDateTime); -OffsetDateTime endOffsetDateTime = OffsetDateTime.parse(endDateTime); - -// get list of all metric namespaces and pick the first one -Response metricNamespacesOut = testRunClient.getMetricNamespacesWithResponse("testrun12345", null); -String metricNamespace = null; -// parse JSON and read first value -try (JsonReader jsonReader = JsonProviders.createReader(metricNamespacesOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - Map namespaceMap = (Map) metricNamespaces.get(0); - metricNamespace = namespaceMap.get("name").toString(); -} catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition -} - -// get list of all metric definitions and pick the first one -Response metricDefinitionsOut = testRunClient.getMetricDefinitionsWithResponse("testrun12345", metricNamespace, null); -String metricName = null; -// parse JSON and read first value -try (JsonReader jsonReader = JsonProviders.createReader(metricDefinitionsOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - Map definitionMap = (Map) metricDefinitions.get(0); - Map nameMap = (Map) definitionMap.get("name"); - metricName = nameMap.get("value").toString(); -} catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition -} - -// fetch client metrics using metric namespace and metric name -PagedIterable clientMetricsOut = testRunClient.listMetrics("testrun12345", metricName, metricNamespace, startDateTime + '/' + endDateTime, null); -clientMetricsOut.forEach((clientMetric) -> { - System.out.println(clientMetric.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). - -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 - - -[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://learn.microsoft.com/rest/api/loadtesting/ -[product_documentation]: https://azure.microsoft.com/services/load-testing/ -[jdk]: https://learn.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 -[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK diff --git a/sdk/loadtesting/azure-developer-loadtesting/assets.json b/sdk/loadtesting/azure-developer-loadtesting/assets.json deleted file mode 100644 index 034976ee2d23..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/loadtesting/azure-developer-loadtesting", - "Tag": "java/loadtesting/azure-developer-loadtesting_c9288cb1d7" -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/checkstyle-suppressions.xml b/sdk/loadtesting/azure-developer-loadtesting/checkstyle-suppressions.xml deleted file mode 100644 index ff9216216935..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/checkstyle-suppressions.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/sdk/loadtesting/azure-developer-loadtesting/pom.xml b/sdk/loadtesting/azure-developer-loadtesting/pom.xml deleted file mode 100644 index 8c883af4fd1d..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.azure - azure-developer-loadtesting - 1.1.0-beta.1 - jar - - Microsoft Azure SDK for Load Testing - This package contains Microsoft Azure Load Testing 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 - - checkstyle-suppressions.xml - false - spotbugs-exclude.xml - - - - com.azure - azure-core - 1.55.2 - - - com.azure - azure-core-http-netty - 1.15.10 - - - com.azure - azure-core-test - 1.27.0-beta.7 - test - - - com.azure - azure-identity - 1.15.3 - test - - - diff --git a/sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml b/sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml deleted file mode 100644 index 36fd7768cc86..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java deleted file mode 100644 index 7a6f4d47dc96..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ /dev/null @@ -1,840 +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.PagedFlux; -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.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; -import java.time.Duration; -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 ClientLogger LOGGER = new ClientLogger(LoadTestAdministrationAsyncClient.class); - - @Generated - private final LoadTestAdministrationsImpl serviceClient; - - /** - * Initializes an instance of LoadTestAdministrationAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - LoadTestAdministrationAsyncClient(LoadTestAdministrationsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric 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 test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(testId, body, requestOptions); - } - - /** - * Uploads file and polls the validation status of the uploaded file. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param fileUploadRequestOptions The options to configure the file upload HTTP request before HTTP client sends - * it. - * @throws ResourceNotFoundException when a test with {@code testId} doesn't exist. - * @return A {@link PollerFlux} to poll on and retrieve the file info with validation status. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginUploadTestFile(String testId, String fileName, BinaryData body, - RequestOptions fileUploadRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (fileUploadRequestOptions != null) { - defaultRequestOptions.setContext(fileUploadRequestOptions.getContext()); - } - return new PollerFlux<>(Duration.ofSeconds(2), - (context) -> uploadTestFileWithResponse(testId, fileName, body, fileUploadRequestOptions) - .flatMap(FluxUtil::toMono) - .flatMap(fileBinaryData -> PollingUtils - .getPollResponseMono(() -> PollingUtils.getValidationStatus(fileBinaryData))) - .flatMap(fileValidationPollResp -> Mono.just(fileValidationPollResp.getValue())), - (context) -> getTestFileWithResponse(testId, fileName, defaultRequestOptions).flatMap(FluxUtil::toMono) - .flatMap(fileBinaryData -> PollingUtils - .getPollResponseMono(() -> PollingUtils.getValidationStatus(fileBinaryData))), - (activationResponse, context) -> Mono - .error(LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"))), - (context) -> getTestFileWithResponse(testId, fileName, defaultRequestOptions).flatMap(FluxUtil::toMono)); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestFiles(String testId, RequestOptions requestOptions) { - return this.serviceClient.listTestFilesAsync(testId, requestOptions); - } - - /** - * Create a new test or update an existing test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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 the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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> deleteTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.deleteTestWithResponseAsync(testId, requestOptions); - } - - /** - * Get load test details by test name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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> getTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getTestWithResponseAsync(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 the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 listTests(RequestOptions requestOptions) { - return this.serviceClient.listTestsAsync(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 application/octet-stream. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", "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)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> uploadTestFileWithResponse(String testId, String fileName, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileName, body, requestOptions); - } - - /** - * Get test file by the file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - return this.serviceClient.getTestFileWithResponseAsync(testId, fileName, requestOptions); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileName, requestOptions); - } - - /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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 test app component along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(testId, body, requestOptions); - } - - /** - * Get associated app component (collection of azure resources) for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response} - * on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentsWithResponseAsync(testId, requestOptions); - } - - /** - * List server metrics configuration for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsConfigWithResponseAsync(testId, requestOptions); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java deleted file mode 100644 index 55fdab103fbd..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ /dev/null @@ -1,831 +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.PagedIterable; -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.logging.ClientLogger; -import com.azure.core.util.polling.SyncPoller; -import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; -import java.time.Duration; - -/** - * Initializes a new instance of the synchronous LoadTestingClient type. - */ -@ServiceClient(builder = LoadTestAdministrationClientBuilder.class) -public final class LoadTestAdministrationClient { - - private static final ClientLogger LOGGER = new ClientLogger(LoadTestAdministrationClient.class); - - @Generated - private final LoadTestAdministrationsImpl serviceClient; - - /** - * Initializes an instance of LoadTestAdministrationClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - LoadTestAdministrationClient(LoadTestAdministrationsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric 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 test server metrics configuration along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponse(testId, body, requestOptions); - } - - /** - * Uploads file and polls the validation status of the uploaded file. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param fileUploadRequestOptions The options to configure the file upload HTTP request before HTTP client sends - * it. - * @throws ResourceNotFoundException when a test with {@code testId} doesn't exist. - * @return A {@link SyncPoller} to poll on and retrieve the file info with validation status. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginUploadTestFile(String testId, String fileName, BinaryData body, - RequestOptions fileUploadRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (fileUploadRequestOptions != null) { - defaultRequestOptions.setContext(fileUploadRequestOptions.getContext()); - } - return SyncPoller.createPoller(Duration.ofSeconds(2), - (context) -> PollingUtils.getValidationStatus( - uploadTestFileWithResponse(testId, fileName, body, fileUploadRequestOptions).getValue()), - (context) -> PollingUtils - .getValidationStatus(getTestFileWithResponse(testId, fileName, defaultRequestOptions).getValue()), - (activationResponse, context) -> { - throw LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported")); - }, (context) -> getTestFileWithResponse(testId, fileName, defaultRequestOptions).getValue()); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTestFiles(String testId, RequestOptions requestOptions) { - return this.serviceClient.listTestFiles(testId, requestOptions); - } - - /** - * Create a new test or update an existing test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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.serviceClient.createOrUpdateTestWithResponse(testId, body, requestOptions); - } - - /** - * Delete a test by its name. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 deleteTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.deleteTestWithResponse(testId, requestOptions); - } - - /** - * Get load test details by test name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 getTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getTestWithResponse(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 the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 listTests(RequestOptions requestOptions) { - return this.serviceClient.listTests(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 application/octet-stream. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", "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)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response uploadTestFileWithResponse(String testId, String fileName, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.uploadTestFileWithResponse(testId, fileName, body, requestOptions); - } - - /** - * Get test file by the file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, RequestOptions requestOptions) { - return this.serviceClient.getTestFileWithResponse(testId, fileName, requestOptions); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, RequestOptions requestOptions) { - return this.serviceClient.deleteTestFileWithResponse(testId, fileName, requestOptions); - } - - /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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 test app component along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponse(testId, body, requestOptions); - } - - /** - * Get associated app component (collection of azure resources) for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentsWithResponse(testId, requestOptions); - } - - /** - * List server metrics configuration for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsConfigWithResponse(testId, requestOptions); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java deleted file mode 100644 index 03c74af38b25..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java +++ /dev/null @@ -1,334 +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.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.logging.ClientLogger; -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.Objects; - -/** - * 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://cnt-prod.loadtesting.azure.com/.default" }; - - @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) { - if (this.pipeline != null && pipeline == null) { - LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); - } - 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) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - 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() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestingServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); - LoadTestingClientImpl client = new LoadTestingClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); - if (headers != null) { - policies.add(new AddHeadersPolicy(headers)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(localHttpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .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(buildInnerClient().getLoadTestAdministrations()); - } - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - - private static final ClientLogger LOGGER = new ClientLogger(LoadTestAdministrationClientBuilder.class); - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunAsyncClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunAsyncClient.java deleted file mode 100644 index bfafcd59881b..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunAsyncClient.java +++ /dev/null @@ -1,1238 +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.HttpHeaderName; -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.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.developer.loadtesting.implementation.LoadTestRunsImpl; -import java.time.Duration; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous LoadTestingClient type. - */ -@ServiceClient(builder = LoadTestRunClientBuilder.class, isAsync = true) -public final class LoadTestRunAsyncClient { - - @Generated - private final LoadTestRunsImpl serviceClient; - - /** - * Initializes an instance of LoadTestRunAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - LoadTestRunAsyncClient(LoadTestRunsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Configure server metrics for a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric 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 test run server metrics configuration along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(testRunId, body, requestOptions); - } - - /** - * Starts a test run and polls the status of the test run. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. - * @param testRunRequestOptions The options to configure the file upload HTTP request before HTTP client sends it. - * @throws ResourceNotFoundException when a test with {@code testRunId} doesn't exist. - * @return A {@link PollerFlux} to poll on and retrieve the test run - * status(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE). - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginTestRun(String testRunId, BinaryData body, - RequestOptions testRunRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (testRunRequestOptions != null) { - defaultRequestOptions.setContext(testRunRequestOptions.getContext()); - } - return new PollerFlux<>(Duration.ofSeconds(5), - (context) -> createOrUpdateTestRunWithResponse(testRunId, body, testRunRequestOptions) - .flatMap(FluxUtil::toMono), - (context) -> getTestRunWithResponse(testRunId, defaultRequestOptions).flatMap(FluxUtil::toMono) - .flatMap(testRunBinary -> PollingUtils - .getPollResponseMono(() -> PollingUtils.getTestRunStatus(testRunBinary))), - (activationResponse, context) -> stopTestRunWithResponse(testRunId, defaultRequestOptions) - .flatMap(FluxUtil::toMono), - (context) -> getTestRunWithResponse(testRunId, defaultRequestOptions).flatMap(FluxUtil::toMono)); - } - - /** - * Associate an app component (collection of azure resources) to a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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 test run app component along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(testRunId, body, requestOptions); - } - - /** - * List the metric values for a load test run. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * - *

-     * {@code
-     * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

- * Response Body Schema - * - *

-     * {@code
-     * {
-     *     value (Optional): [
-     *          (Optional){
-     *             data (Optional): [
-     *                  (Optional){
-     *                     timestamp: String (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *             dimensionValues (Optional): [
-     *                  (Optional){
-     *                     name: String (Optional)
-     *                     value: String (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetrics(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - if (requestOptions == null) { - requestOptions = new RequestOptions(); - } - // Content-Type header required even though body can be null - requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "application/json"); - return this.serviceClient.listMetricsAsync(testRunId, metricName, metricNamespace, timespan, requestOptions); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricDimensionValues(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - return this.serviceClient.listMetricDimensionValuesAsync(testRunId, name, metricName, metricNamespace, timespan, - requestOptions); - } - - /** - * Get associated app component (collection of azure resources) for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentsWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentsWithResponseAsync(testRunId, requestOptions); - } - - /** - * List server metrics configuration for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsConfigWithResponse(String testRunId, - RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsConfigWithResponseAsync(testRunId, requestOptions); - } - - /** - * Create and start a new test run with the given name. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this is provided, the test will run with the JMX file, - * configuration and app components from the existing test run. You can override the configuration values for new - * test run in the request body.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * - *

-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

- * Response Body Schema - * - *

-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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) - Mono> createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); - } - - /** - * Get test run details by name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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); - } - - /** - * Delete a test run by its name. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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); - } - - /** - * Get test run file by file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileName, requestOptions); - } - - /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 listTestRuns(RequestOptions requestOptions) { - return this.serviceClient.listTestRunsAsync(requestOptions); - } - - /** - * Stop test run by name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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); - } - - /** - * List the metric namespaces for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getMetricNamespacesWithResponseAsync(testRunId, requestOptions); - } - - /** - * List the metric definitions for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             dimensions (Optional): [
-     *                  (Optional){
-     *                     description: String (Optional)
-     *                     name: String (Optional)
-     *                 }
-     *             ]
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *             namespace: String (Optional)
-     *             primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional)
-     *             supportedAggregationTypes (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
-     *             metricAvailabilities (Optional): [
-     *                  (Optional){
-     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric definitions along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, - RequestOptions requestOptions) { - return this.serviceClient.getMetricDefinitionsWithResponseAsync(testRunId, metricNamespace, requestOptions); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClient.java deleted file mode 100644 index 64358eff94b3..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClient.java +++ /dev/null @@ -1,1242 +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.HttpHeaderName; -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; -import com.azure.core.util.polling.SyncPoller; -import com.azure.developer.loadtesting.implementation.LoadTestRunsImpl; -import java.time.Duration; - -/** - * Initializes a new instance of the synchronous LoadTestingClient type. - */ -@ServiceClient(builder = LoadTestRunClientBuilder.class) -public final class LoadTestRunClient { - - @Generated - private final LoadTestRunsImpl serviceClient; - - /** - * Initializes an instance of LoadTestRunClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - LoadTestRunClient(LoadTestRunsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Configure server metrics for a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric 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 test run server metrics configuration along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponse(testRunId, body, requestOptions); - } - - /** - * Starts a test run and polls the status of the test run. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. - * @param testRunRequestOptions The options to configure the file upload HTTP request before HTTP client sends it. - * @throws ResourceNotFoundException when a test with {@code testRunId} doesn't exist. - * @return A {@link SyncPoller} to poll on and retrieve the test run - * status(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE). - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginTestRun(String testRunId, BinaryData body, - RequestOptions testRunRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (testRunRequestOptions != null) { - defaultRequestOptions.setContext(testRunRequestOptions.getContext()); - } - return SyncPoller.createPoller(Duration.ofSeconds(5), - (context) -> PollingUtils - .getTestRunStatus(createOrUpdateTestRunWithResponse(testRunId, body, testRunRequestOptions).getValue()), - (context) -> PollingUtils - .getTestRunStatus(getTestRunWithResponse(testRunId, defaultRequestOptions).getValue()), - (activationResponse, context) -> stopTestRunWithResponse(testRunId, defaultRequestOptions).getValue(), - (context) -> getTestRunWithResponse(testRunId, defaultRequestOptions).getValue()); - } - - /** - * Associate an app component (collection of azure resources) to a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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 test run app component along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponse(testRunId, body, requestOptions); - } - - /** - * List the metric values for a load test run. - *

- * Query Parameters - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Header Parameters - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

- * Request Body Schema - *

- * - *
-     * {@code
-     * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

- * Response Body Schema - *

- * - *
-     * {@code
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - if (requestOptions == null) { - requestOptions = new RequestOptions(); - } - // Content-Type header required even though body can be null - requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "application/json"); - return this.serviceClient.listMetrics(testRunId, metricName, metricNamespace, timespan, requestOptions); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - return this.serviceClient.listMetricDimensionValues(testRunId, name, metricName, metricNamespace, timespan, - requestOptions); - } - - /** - * Get associated app component (collection of azure resources) for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentsWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentsWithResponse(testRunId, requestOptions); - } - - /** - * List server metrics configuration for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsConfigWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsConfigWithResponse(testRunId, requestOptions); - } - - /** - * Create and start a new test run with the given name. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this is provided, the test will run with the JMX file, - * configuration and app components from the existing test run. You can override the configuration values for new - * test run in the request body.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * - *

-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

- * Response Body Schema - * - *

-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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) - Response createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateTestRunWithResponse(testRunId, body, requestOptions); - } - - /** - * Get test run details by name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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.serviceClient.getTestRunWithResponse(testRunId, requestOptions); - } - - /** - * Delete a test run by its name. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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.serviceClient.deleteTestRunWithResponse(testRunId, requestOptions); - } - - /** - * Get test run file by file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - return this.serviceClient.getTestRunFileWithResponse(testRunId, fileName, requestOptions); - } - - /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 listTestRuns(RequestOptions requestOptions) { - return this.serviceClient.listTestRuns(requestOptions); - } - - /** - * Stop test run by name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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.serviceClient.stopTestRunWithResponse(testRunId, requestOptions); - } - - /** - * List the metric namespaces for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getMetricNamespacesWithResponse(testRunId, requestOptions); - } - - /** - * List the metric definitions for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             dimensions (Optional): [
-     *                  (Optional){
-     *                     description: String (Optional)
-     *                     name: String (Optional)
-     *                 }
-     *             ]
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *             namespace: String (Optional)
-     *             primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional)
-     *             supportedAggregationTypes (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
-     *             metricAvailabilities (Optional): [
-     *                  (Optional){
-     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric definitions along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, - RequestOptions requestOptions) { - return this.serviceClient.getMetricDefinitionsWithResponse(testRunId, metricNamespace, requestOptions); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java deleted file mode 100644 index 8eef8080f17f..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java +++ /dev/null @@ -1,334 +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.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.logging.ClientLogger; -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.Objects; - -/** - * A builder for creating a new instance of the LoadTestRunClient type. - */ -@ServiceClientBuilder(serviceClients = { LoadTestRunClient.class, LoadTestRunAsyncClient.class }) -public final class LoadTestRunClientBuilder - 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://cnt-prod.loadtesting.azure.com/.default" }; - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the LoadTestRunClientBuilder. - */ - @Generated - public LoadTestRunClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public LoadTestRunClientBuilder pipeline(HttpPipeline pipeline) { - if (this.pipeline != null && pipeline == null) { - LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); - } - this.pipeline = pipeline; - return this; - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public LoadTestRunClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public LoadTestRunClientBuilder 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 LoadTestRunClientBuilder 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 LoadTestRunClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public LoadTestRunClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - 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 LoadTestRunClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public LoadTestRunClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public LoadTestRunClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * Service version - */ - @Generated - private LoadTestingServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the LoadTestRunClientBuilder. - */ - @Generated - public LoadTestRunClientBuilder 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 LoadTestRunClientBuilder. - */ - @Generated - public LoadTestRunClientBuilder 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() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestingServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); - LoadTestingClientImpl client = new LoadTestingClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); - return client; - } - - @Generated - private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); - if (headers != null) { - policies.add(new AddHeadersPolicy(headers)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(localHttpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of LoadTestRunAsyncClient class. - * - * @return an instance of LoadTestRunAsyncClient. - */ - @Generated - public LoadTestRunAsyncClient buildAsyncClient() { - return new LoadTestRunAsyncClient(buildInnerClient().getLoadTestRuns()); - } - - /** - * Builds an instance of LoadTestRunClient class. - * - * @return an instance of LoadTestRunClient. - */ - @Generated - public LoadTestRunClient buildClient() { - return new LoadTestRunClient(buildInnerClient().getLoadTestRuns()); - } - - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - - private static final ClientLogger LOGGER = new ClientLogger(LoadTestRunClientBuilder.class); - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java deleted file mode 100644 index 277cd8cc2f90..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java +++ /dev/null @@ -1,40 +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.util.ServiceVersion; - -/** - * Service version of LoadTestingClient. - */ -public enum LoadTestingServiceVersion implements ServiceVersion { - /** - * Enum value 2022-11-01. - */ - V2022_11_01("2022-11-01"); - - private final String version; - - LoadTestingServiceVersion(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 LoadTestingServiceVersion}. - */ - public static LoadTestingServiceVersion getLatest() { - return V2022_11_01; - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/PollingUtils.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/PollingUtils.java deleted file mode 100644 index 39ab7f76248d..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/PollingUtils.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.developer.loadtesting; - -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.Callable; - -final class PollingUtils { - static Mono> getPollResponseMono(Callable> pollOperation) { - try { - return Mono.just(pollOperation.call()); - } catch (Exception e) { - return Mono.error(e); - } - } - - static PollResponse getValidationStatus(BinaryData fileBinary) throws RuntimeException { - String validationStatus, fileType; - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - validationStatus = jsonTree.get("validationStatus").toString(); - } catch (IOException e) { - throw new RuntimeException("Encountered exception while retrieving validation status", e); - } - - LongRunningOperationStatus lroStatus; - - switch (validationStatus) { - case "VALIDATION_NOT_REQUIRED": - case "VALIDATION_SUCCESS": - lroStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - - break; - - case "VALIDATION_FAILURE": - lroStatus = LongRunningOperationStatus.FAILED; - - break; - - case "VALIDATION_INITIATED": - lroStatus = LongRunningOperationStatus.IN_PROGRESS; - - break; - - case "NOT_VALIDATED": - lroStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - - break; - - default: - lroStatus = LongRunningOperationStatus.NOT_STARTED; - - break; - } - - return new PollResponse<>(lroStatus, fileBinary); - } - - static PollResponse getTestRunStatus(BinaryData testRunBinary) throws RuntimeException { - String status; - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - status = jsonTree.get("status").toString(); - } catch (IOException e) { - throw new RuntimeException("Encountered exception while retrieving test run status", e); - } - - LongRunningOperationStatus lroStatus; - - switch (status) { - case "NOTSTARTED": - lroStatus = LongRunningOperationStatus.NOT_STARTED; - - break; - - case "DONE": - lroStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - - break; - - case "FAILED": - lroStatus = LongRunningOperationStatus.FAILED; - - break; - - case "CANCELLED": - lroStatus = LongRunningOperationStatus.USER_CANCELLED; - - break; - - default: - lroStatus = LongRunningOperationStatus.IN_PROGRESS; - - break; - } - - return new PollResponse<>(lroStatus, testRunBinary); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java deleted file mode 100644 index 66fecbd19792..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java +++ /dev/null @@ -1,2509 +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 com.azure.core.util.UrlBuilder; -import com.azure.developer.loadtesting.LoadTestingServiceVersion; -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; - } - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public LoadTestingServiceVersion getServiceVersion() { - return client.getServiceVersion(); - } - - /** - * 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") - public interface LoadTestAdministrationsService { - @Patch("/tests/{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, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/tests/{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) - Response createOrUpdateTestSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/tests/{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> deleteTest(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/tests/{testId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteTestSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{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> getTest(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTests(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestsSync(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/tests/{testId}/files/{fileName}") - @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("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/octet-stream") BinaryData body, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response uploadTestFileSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/octet-stream") BinaryData body, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/files/{fileName}") - @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("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestFileSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @PathParam("fileName") String fileName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/tests/{testId}/files/{fileName}") - @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("fileName") String fileName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteTestFileSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @PathParam("fileName") String fileName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{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> listTestFiles(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{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) - Response listTestFilesSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/app-components") - @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("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/app-components") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateAppComponentsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/app-components") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAppComponents(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/app-components") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAppComponentsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/server-metrics-config") - @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("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/server-metrics-config") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateServerMetricsConfigSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/server-metrics-config") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getServerMetricsConfig(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/server-metrics-config") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getServerMetricsConfigSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @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> listTestsNext(@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) - Response listTestsNextSync(@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> listTestFilesNext(@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) - Response listTestFilesNextSync(@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
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Create a new test or update an existing test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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) { - final String accept = "application/json"; - return service.createOrUpdateTestSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Delete a test by its name. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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> deleteTestWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteTest(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Delete a test by its name. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 deleteTestWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteTestSync(this.client.getEndpoint(), testId, this.client.getServiceVersion().getVersion(), - accept, requestOptions, Context.NONE); - } - - /** - * Get load test details by test name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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> getTestWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTest(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get load test details by test name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 getTestWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getTestSync(this.client.getEndpoint(), testId, this.client.getServiceVersion().getVersion(), - accept, requestOptions, Context.NONE); - } - - /** - * 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 the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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) - private Mono> listTestsSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listTests(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 the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 listTestsAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsSinglePageAsync(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsNextSinglePageAsync(nextLink, requestOptionsLocal); - }); - } - - /** - * 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 the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestsSinglePage(RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listTestsSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return 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 the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 listTests(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsSinglePage(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsNextSinglePage(nextLink, requestOptionsLocal); - }); - } - - /** - * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the - * given test will be overwritten. File should be provided in the request body as application/octet-stream. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", - * "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)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadTestFileWithResponseAsync(String testId, String fileName, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadTestFile(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), body, 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 application/octet-stream. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", - * "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)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadTestFileWithResponse(String testId, String fileName, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.uploadTestFileSync(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Get test file by the file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTestFile(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get test file by the file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getTestFileSync(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteTestFile(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteTestFileSync(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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) - private Mono> listTestFilesSinglePageAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listTestFiles(this.client.getEndpoint(), testId, - 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 test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 listTestFilesAsync(String testId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listTestFilesSinglePageAsync(testId, requestOptions), - nextLink -> listTestFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestFilesSinglePage(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listTestFilesSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listTestFilesSinglePage(testId, requestOptions), - nextLink -> listTestFilesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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 test app component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponseAsync(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateAppComponents(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @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 test app component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateAppComponentsSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Get associated app component (collection of azure resources) for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentsWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAppComponents(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get associated app component (collection of azure resources) for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAppComponentsSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric 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 test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponseAsync(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateServerMetricsConfig(this.client.getEndpoint(), - testId, this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric 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 test server metrics configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateServerMetricsConfigSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * List server metrics configuration for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsConfigWithResponseAsync(String testId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getServerMetricsConfig(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * List server metrics configuration for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getServerMetricsConfigSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of tests along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listTestsNext(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
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of tests along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listTestsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return 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
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of files along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestFilesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listTestFilesNext(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
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of files along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestFilesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listTestFilesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return 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/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunsImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunsImpl.java deleted file mode 100644 index f585a0d8af1f..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunsImpl.java +++ /dev/null @@ -1,3754 +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.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.HttpHeaderName; -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 com.azure.core.util.UrlBuilder; -import com.azure.developer.loadtesting.LoadTestingServiceVersion; -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 LoadTestRuns. - */ -public final class LoadTestRunsImpl { - /** - * The proxy service used to perform REST calls. - */ - private final LoadTestRunsService service; - - /** - * The service client containing this operation class. - */ - private final LoadTestingClientImpl client; - - /** - * Initializes an instance of LoadTestRunsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadTestRunsImpl(LoadTestingClientImpl client) { - this.service - = RestProxy.create(LoadTestRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public LoadTestingServiceVersion getServiceVersion() { - return client.getServiceVersion(); - } - - /** - * The interface defining all the services for LoadTestingClientLoadTestRuns to be used by the proxy service to - * perform REST calls. - */ - @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestingClientLoa") - public interface LoadTestRunsService { - @Patch("/test-runs/{testRunId}") - @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> createOrUpdateTestRun(@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); - - @Patch("/test-runs/{testRunId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateTestRunSync(@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("/test-runs/{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("/test-runs/{testRunId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestRunSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/test-runs/{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); - - @Delete("/test-runs/{testRunId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteTestRunSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/files/{fileName}") - @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("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/files/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestRunFileSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTestRuns(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestRunsSync(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/test-runs/{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("/test-runs/{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) - Response stopTestRunSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/metric-namespaces") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMetricNamespaces(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/metric-namespaces") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMetricNamespacesSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/metric-definitions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMetricDefinitions(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/metric-definitions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMetricDefinitionsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/test-runs/{testRunId}/metrics") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMetrics(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricname") String metricName, - @QueryParam("metricNamespace") String metricNamespace, @QueryParam("timespan") String timespan, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Post("/test-runs/{testRunId}/metrics") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listMetricsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricname") String metricName, - @QueryParam("metricNamespace") String metricNamespace, @QueryParam("timespan") String timespan, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/metric-dimensions/{name}/values") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMetricDimensionValues(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @PathParam("name") String name, - @QueryParam("metricname") String metricName, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("timespan") String timespan, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/metric-dimensions/{name}/values") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listMetricDimensionValuesSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @PathParam("name") String name, - @QueryParam("metricname") String metricName, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("timespan") String timespan, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/test-runs/{testRunId}/app-components") - @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("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/test-runs/{testRunId}/app-components") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateAppComponentsSync(@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("/test-runs/{testRunId}/app-components") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAppComponents(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/app-components") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAppComponentsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/test-runs/{testRunId}/server-metrics-config") - @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("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/test-runs/{testRunId}/server-metrics-config") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateServerMetricsConfigSync(@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("/test-runs/{testRunId}/server-metrics-config") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getServerMetricsConfig(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/server-metrics-config") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getServerMetricsConfigSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @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> listTestRunsNext(@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) - Response listTestRunsNextSync(@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> listMetricsNext(@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) - Response listMetricsNextSync(@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> listMetricDimensionValuesNext( - @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) - Response listMetricDimensionValuesNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Create and start a new test run with the given name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this - * is provided, the test will run with the JMX file, configuration and app components from the existing test run. - * You can override the configuration values for new test run in the request body.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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> createOrUpdateTestRunWithResponseAsync(String testRunId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateTestRun(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 identifier that should be rerun, if this - * is provided, the test will run with the JMX file, configuration and app components from the existing test run. - * You can override the configuration values for new test run in the request body.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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 createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Get test run details by name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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) { - final String accept = "application/json"; - return service.getTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Delete a test run by its name. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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) { - final String accept = "application/json"; - return service.deleteTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Get test run file by file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTestRunFile(this.client.getEndpoint(), testRunId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get test run file by file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 fileName, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getTestRunFileSync(this.client.getEndpoint(), testRunId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestRunsSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listTestRuns(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 test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestRunsAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsSinglePageAsync(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsNextSinglePageAsync(nextLink, requestOptionsLocal); - }); - } - - /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestRunsSinglePage(RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listTestRunsSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: 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 listTestRuns(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsSinglePage(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsNextSinglePage(nextLink, requestOptionsLocal); - }); - } - - /** - * Stop test run by name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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) { - final String accept = "application/json"; - return service.stopTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * List the metric namespaces for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMetricNamespacesWithResponseAsync(String testRunId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMetricNamespaces(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * List the metric namespaces for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getMetricNamespacesSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * List the metric definitions for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             dimensions (Optional): [
-     *                  (Optional){
-     *                     description: String (Optional)
-     *                     name: String (Optional)
-     *                 }
-     *             ]
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *             namespace: String (Optional)
-     *             primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional)
-     *             supportedAggregationTypes (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
-     *             metricAvailabilities (Optional): [
-     *                  (Optional){
-     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric definitions along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMetricDefinitionsWithResponseAsync(String testRunId, String metricNamespace, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMetricDefinitions(this.client.getEndpoint(), testRunId, - metricNamespace, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * List the metric definitions for a load test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             dimensions (Optional): [
-     *                  (Optional){
-     *                     description: String (Optional)
-     *                     name: String (Optional)
-     *                 }
-     *             ]
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *             namespace: String (Optional)
-     *             primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional)
-     *             supportedAggregationTypes (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
-     *             metricAvailabilities (Optional): [
-     *                  (Optional){
-     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric definitions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getMetricDefinitionsSync(this.client.getEndpoint(), testRunId, metricNamespace, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * List the metric values for a load test run. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync(String testRunId, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { - requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); - } - }); - return FluxUtil - .withContext( - context -> service.listMetrics(this.client.getEndpoint(), testRunId, metricName, metricNamespace, - timespan, this.client.getServiceVersion().getVersion(), accept, requestOptionsLocal, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * List the metric values for a load test run. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(testRunId, metricName, metricNamespace, timespan, requestOptions), - nextLink -> listMetricsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * List the metric values for a load test run. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricsSinglePage(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { - requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); - } - }); - Response res - = service.listMetricsSync(this.client.getEndpoint(), testRunId, metricName, metricNamespace, timespan, - this.client.getServiceVersion().getVersion(), accept, requestOptionsLocal, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * List the metric values for a load test run. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>( - () -> listMetricsSinglePage(testRunId, metricName, metricNamespace, timespan, requestOptions), - nextLink -> listMetricsNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDimensionValuesSinglePageAsync(String testRunId, String name, - String metricName, String metricNamespace, String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricDimensionValues(this.client.getEndpoint(), testRunId, name, - metricName, metricNamespace, timespan, 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)); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricDimensionValuesAsync(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listMetricDimensionValuesSinglePageAsync(testRunId, name, metricName, metricNamespace, timespan, - requestOptions), - nextLink -> listMetricDimensionValuesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricDimensionValuesSinglePage(String testRunId, String name, - String metricName, String metricNamespace, String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listMetricDimensionValuesSync(this.client.getEndpoint(), testRunId, name, - metricName, metricNamespace, timespan, this.client.getServiceVersion().getVersion(), accept, requestOptions, - Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>( - () -> listMetricDimensionValuesSinglePage(testRunId, name, metricName, metricNamespace, timespan, - requestOptions), - nextLink -> listMetricDimensionValuesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Associate an app component (collection of azure resources) to a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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 test run app component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponseAsync(String testRunId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateAppComponents(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Associate an app component (collection of azure resources) to a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @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 test run app component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateAppComponentsSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Get associated app component (collection of azure resources) for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentsWithResponseAsync(String testRunId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAppComponents(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get associated app component (collection of azure resources) for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testRunId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentsWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAppComponentsSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Configure server metrics for a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric 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 test run server metrics configuration along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponseAsync(String testRunId, - BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateServerMetricsConfig(this.client.getEndpoint(), - testRunId, this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Configure server metrics for a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric 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 test run server metrics configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateServerMetricsConfigSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * List server metrics configuration for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsConfigWithResponseAsync(String testRunId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getServerMetricsConfig(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * List server metrics configuration for the given test run. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 server metrics configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsConfigWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getServerMetricsConfigSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of test runs along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestRunsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listTestRunsNext(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
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             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)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of test runs along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestRunsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listTestRunsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return 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
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listMetricsNext(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
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the 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 to a metrics query along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listMetricsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return 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
-     * String
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDimensionValuesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricDimensionValuesNext(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
-     * String
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricDimensionValuesNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listMetricDimensionValuesNextSync(nextLink, this.client.getEndpoint(), - accept, requestOptions, Context.NONE); - return 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/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java deleted file mode 100644 index a391923f7629..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.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; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -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.LoadTestingServiceVersion; - -/** - * 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; - - /** - * 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 LoadTestingServiceVersion serviceVersion; - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public LoadTestingServiceVersion 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 LoadTestAdministrationsImpl object to access its operations. - */ - private final LoadTestAdministrationsImpl loadTestAdministrations; - - /** - * Gets the LoadTestAdministrationsImpl object to access its operations. - * - * @return the LoadTestAdministrationsImpl object. - */ - public LoadTestAdministrationsImpl getLoadTestAdministrations() { - return this.loadTestAdministrations; - } - - /** - * The LoadTestRunsImpl object to access its operations. - */ - private final LoadTestRunsImpl loadTestRuns; - - /** - * Gets the LoadTestRunsImpl object to access its operations. - * - * @return the LoadTestRunsImpl object. - */ - public LoadTestRunsImpl getLoadTestRuns() { - return this.loadTestRuns; - } - - /** - * Initializes an instance of LoadTestingClient client. - * - * @param endpoint URL to perform data plane API operations on the resource. - * @param serviceVersion Service version. - */ - public LoadTestingClientImpl(String endpoint, LoadTestingServiceVersion serviceVersion) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - } - - /** - * 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 LoadTestingClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestingServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - } - - /** - * 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 LoadTestingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - LoadTestingServiceVersion serviceVersion) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.serviceVersion = serviceVersion; - this.loadTestAdministrations = new LoadTestAdministrationsImpl(this); - this.loadTestRuns = new LoadTestRunsImpl(this); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java deleted file mode 100644 index 918f9c45b17b..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java +++ /dev/null @@ -1,8 +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 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/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java deleted file mode 100644 index 009f697b6870..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java +++ /dev/null @@ -1,8 +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 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/loadtesting/azure-developer-loadtesting/src/main/java/module-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/module-info.java deleted file mode 100644 index 2c7ca0c94217..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/module-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// 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; - requires com.azure.json; - - exports com.azure.developer.loadtesting; -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties b/sdk/loadtesting/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties deleted file mode 100644 index ca812989b4f2..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/README.md b/sdk/loadtesting/azure-developer-loadtesting/src/samples/README.md deleted file mode 100644 index 2c0b655fa8c4..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/README.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -page_type: sample -languages: - - java -products: - - azure - - azure-load-testing -urlFragment: developer-loadtesting-samples ---- - -# Azure Developer Loadtesting Samples client library for Java - -This document explains samples and how to use them. - -## Examples - - Following section document various examples. - -### Hello World Samples - -* [HelloWorld.java][sample_helloWorld] - Contains samples for following scenarios: - * Authenticate client - * Create Load Test - * Upload Test File - * Create and start Test Run, and get metrics - -### List Operations Samples - -* [ListOperations.java][sample_list] and [ListOperationsAsync.java][sample_listAsync] - Contains samples for following scenarios: - * List Load Tests - * List Test Runs - * List Load Test files - -### Long Running Operations Samples - -* [LongRunningOperations.java][sample_longRunning] and [LongRunningOperationsAsync.java][sample_longRunningAsync] - Contains samples for following scenarios: - * Upload and validate Load Test file - * Start and monitor Test Run - -## Troubleshooting - -### General - -Load Testing clients raise exceptions. For example, if you try to get a load test or test run resource after it is deleted a `404` error is returned, indicating resource not found. In the following snippet, the error is handled gracefully by catching the exception and displaying additional information about the error. - -```java -try { - testRunClient.getTestRunWithResponse("FAKE_TEST_RUN_ID", null); -} catch (ResourceNotFoundException e) { - System.out.println(e.getMessage()); -} -``` - - -[sample_helloWorld]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java -[sample_list]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java -[sample_listAsync]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java -[sample_longRunning]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java -[sample_longRunningAsync]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java deleted file mode 100644 index f5b8484ac39c..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Sample demonstrates how to create and successfully run a test. - */ -@SuppressWarnings("unchecked") -public final class HelloWorld { - /** - * Authenticates with the load testing resource and shows how to list tests, test files and test runs for a given - * resource. - * - * @param args Unused. Arguments to the program. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test - * resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when listing files. - */ - public static void main(String[] args) { - // Initialize the clients - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - // Constants and parameters - final String testId = "6758667a-a57c-47e5-9cef-9b1f1432daca"; - final String testRunId = "f758667a-c5ac-269a-dce1-5c1f14f2d142"; - final String testFileName = "test-script.jmx"; - final String testFilePath = "C:/path/to/file/sample-script.jmx"; - - /* - * BEGIN: Create test - */ - // 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("loadTestConfiguration", 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 = adminClient.createOrUpdateTestWithResponse(testId, test, null); - - System.out.println(testOutResponse.getValue().toString()); - /* - * END: Create test - */ - - /* - * BEGIN: Upload test file - */ - // extract file contents to BinaryData - BinaryData fileData = BinaryData.fromFile(new File(testFilePath).toPath()); - - // receive response with BinaryData content - // NOTE: file name should be passed as input argument `testFileName`. File name in local path is ignored - PollResponse fileUrlOut = adminClient.beginUploadTestFile(testId, testFileName, fileData, null) - .waitForCompletion(Duration.ofMinutes(2)); - - System.out.println(fileUrlOut.getValue().toString()); - /* - * END: Upload test file - */ - - /* - * BEGIN: Start test run - */ - // construct Test Run object using nested String:Object Maps - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", testId); - testRunMap.put("displayName", "SDK-Created-TestRun"); - - // convert the object Map to JSON BinaryData - BinaryData testRun = BinaryData.fromObject(testRunMap); - - // receive response with BinaryData content - SyncPoller testRunPoller = testRunClient.beginTestRun(testRunId, testRun, null); - - System.out.println(testRunPoller.poll().getValue().toString()); - /* - * END: Start test run - */ - - /* - * BEGIN: Stop test run - */ - try { - Thread.sleep(10 * 1000); - } catch (InterruptedException e) { - // handle interruption - } - - Response stoppedTestRunOut = testRunClient.stopTestRunWithResponse(testRunId, null); - - System.out.println(stoppedTestRunOut.getValue().toString()); - /* - * END: Stop test run - */ - - /* - * BEGIN: List metrics - */ - // wait for test to reach terminal state - PollResponse testRunOut = testRunPoller.poll(); - String testStatus = null, startDateTime = null, endDateTime = null; - - while (!testRunOut.getStatus().isComplete()) { - testRunOut = testRunPoller.poll(); - - // parse JSON and read status value - try (JsonReader jsonReader = JsonProviders.createReader(testRunOut.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Status of test run: " + testStatus); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // wait and check test status every 5 seconds - try { - Thread.sleep(5 * 1000); - } catch (InterruptedException e) { - // handle interruption - } - } - - try (JsonReader jsonReader = JsonProviders.createReader(testRunPoller.getFinalResult().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - startDateTime = jsonTree.get("startDateTime").toString(); - endDateTime = jsonTree.get("endDateTime").toString(); - System.out.println("Status of test run: " + testStatus); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // get list of all metric namespaces and pick the first one - Response metricNamespacesOut = testRunClient.getMetricNamespacesWithResponse(testRunId, null); - String metricNamespace = null; - - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricNamespacesOut.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - List> metricNamespaces = (List>) jsonTree.get("value"); - metricNamespace = metricNamespaces.get(0).get("metricNamespaceName").toString(); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // get list of all metric definitions and pick the first one - Response metricDefinitionsOut = testRunClient.getMetricDefinitionsWithResponse(testRunId, metricNamespace, null); - String metricName = null; - - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricDefinitionsOut.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - List metricDefinitions = (List) jsonTree.get("value"); - Map firstMetricDefinition = (Map) metricDefinitions.get(0); - Map name = (Map) firstMetricDefinition.get("name"); - metricName = name.get("value").toString(); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // fetch client metrics using metric namespace and metric name - PagedIterable clientMetricsOut = testRunClient.listMetrics(testRunId, metricName, metricNamespace, startDateTime + '/' + endDateTime, null); - - clientMetricsOut.forEach((clientMetric) -> { - System.out.println(clientMetric.toString()); - }); - /* - * END: List metrics - */ - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java deleted file mode 100644 index 8a32237de35b..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.IOException; -import java.util.Map; - -/** - * Sample demonstrates how to list tests, test files and test runs for a given resource. - */ -public final class ListOperations { - /** - * Authenticates with the load testing resource and shows how to list tests, test files and test runs - * for a given resource. - * - * @param args Unused. Arguments to the program. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when listing files. - */ - public static void main(String[] args) { - listTests(); - listTestRuns(); - listTestFiles(); - } - - public static void listTests() { - // BEGIN: java-listOperations-sample-listTests - LoadTestAdministrationClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); - - PagedIterable tests = client.listTests(reqOpts); - - tests.forEach(testBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s", testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperations-sample-listTests - } - - public static void listTestRuns() { - // BEGIN: java-listOperations-sample-listTestRuns - LoadTestRunClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("search", "scenario1") - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); - - PagedIterable testRuns = client.listTestRuns(reqOpts); - - testRuns.forEach(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testRunId = jsonTree.get("testRunId").toString(); - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s\t%s", testRunId, testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperations-sample-listTestRuns - } - - public static void listTestFiles() { - // BEGIN: java-listOperations-sample-listTestFiles - LoadTestAdministrationClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - PagedIterable files = client.listTestFiles(inputTestId, null); - - files.forEach(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String blobUrl = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - System.out.println(String.format("%s\t%s\t%s", fileName, fileType, blobUrl)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperations-sample-listTestFiles - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java deleted file mode 100644 index 604f2013cb30..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.IOException; -import java.util.Map; - -/** - * Sample demonstrates how to list tests, test files and test runs for a given resource. - */ -public final class ListOperationsAsync { - /** - * Authenticates with the load testing resource and shows how to list tests, test files and test runs - * for a given resource. - * - * @param args Unused. Arguments to the program. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when listing files. - */ - public static void main(String[] args) { - listTests(); - listTestRuns(); - listTestFiles(); - } - - public static void listTests() { - // BEGIN: java-listOperationsAsync-sample-listTests - LoadTestAdministrationAsyncClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); - - PagedFlux tests = client.listTests(reqOpts); - - tests.subscribe(testBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s", testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperationsAsync-sample-listTests - } - - public static void listTestRuns() { - // BEGIN: java-listOperationsAsync-sample-listTestRuns - LoadTestRunAsyncClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("search", "scenario1") - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); - - PagedFlux testRuns = client.listTestRuns(reqOpts); - - testRuns.subscribe(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testRunId = jsonTree.get("testRunId").toString(); - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s\t%s", testRunId, testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperationsAsync-sample-listTestRuns - } - - public static void listTestFiles() { - // BEGIN: java-listOperationsAsync-sample-listTestFiles - LoadTestAdministrationAsyncClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - - PagedFlux files = client.listTestFiles(inputTestId, null); - - files.subscribe(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String blobUrl = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - System.out.println(String.format("%s\t%s\t%s", fileName, fileType, blobUrl)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperationsAsync-sample-listTestFiles - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java deleted file mode 100644 index bd5c0ba29cde..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.Map; - -/** - * Sample demonstrates how to upload and validate a test file, and running a test run. - * - * Authenticates with the load testing resource and shows how to upload and validate a test file, and running a test run - * in a given resource. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when uploading file. - */ -public final class LongRunningOperations { - public void beginUploadTestFile() { - // BEGIN: java-longRunningOperations-sample-beginUploadTestFile - LoadTestAdministrationClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - String inputFileName = "input-test-file.jmx"; - BinaryData fileData = BinaryData.fromFile(new File("C:/fakepath/input-file.jmx").toPath()); - /* Note: file name passed as input argument is used, over the name in local file path */ - - Duration pollInterval = Duration.ofSeconds(1); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("fileType", "JMX_FILE"); - - SyncPoller poller = client.beginUploadTestFile(inputTestId, inputFileName, fileData, reqOpts); - poller = poller.setPollInterval(pollInterval); - - PollResponse pollResponse = poller.poll(); - - while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println("Validation Status: " + validationStatus); - } catch (IOException e) { - e.printStackTrace(); - } - - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); - } - - poller.waitForCompletion(); - - BinaryData fileBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String url = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println(String.format("%s\t%s\t%s\t%s", fileName, fileType, url, validationStatus)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperations-sample-beginUploadTestFile - } - - public void beginTestRun() { - // BEGIN: java-longRunningOperations-sample-beginTestRun - LoadTestRunClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - String inputTestRunId = "12345678-1234-1234-1234-123456789abc"; - String inputTestId = "87654321-1234-1234-1234-123456789abc"; - - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", inputTestId); - testRunMap.put("displayName", "Sample Test Run"); - testRunMap.put("description", "Java SDK Sample Test Run"); - - Duration pollInterval = Duration.ofSeconds(5); - - BinaryData inputTestRunBinary = BinaryData.fromObject(testRunMap); - - SyncPoller poller = client.beginTestRun(inputTestRunId, inputTestRunBinary, null); - poller = poller.setPollInterval(pollInterval); - - PollResponse pollResponse = poller.poll(); - - while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - BinaryData testRunBinary = pollResponse.getValue(); - - System.out.println("Test Run all info: " + testRunBinary.toString()); - - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); - } - - poller.waitForCompletion(); - BinaryData testRunBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String testRunId = jsonTree.get("testRunId").toString(); - String status = jsonTree.get("status").toString(); - System.out.println(String.format("%s\t%s\t%s", testId, testRunId, status)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperations-sample-beginTestRun - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java deleted file mode 100644 index f3b01b173a7d..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.PollerFlux; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.Map; - -/** - * Sample demonstrates how to upload and validat a test file, and running a test run. - * - * Authenticates with the load testing resource and shows how to upload and validat a test file, and running a test run - * in a given resource. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when uploading file. - */ -public final class LongRunningOperationsAsync { - public void beginUploadTestFile() { - // BEGIN: java-longRunningOperationsAsync-sample-beginUploadTestFile - LoadTestAdministrationAsyncClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - String inputFileName = "input-test-file.jmx"; - BinaryData fileData = BinaryData.fromFile(new File("C:/fakepath/input-file.jmx").toPath()); - /* Note: file name passed as input argument is used, over the name in local file path */ - - Duration pollInterval = Duration.ofSeconds(1); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("fileType", "JMX_FILE"); - - PollerFlux poller = client.beginUploadTestFile(inputTestId, inputFileName, fileData, reqOpts); - poller = poller.setPollInterval(pollInterval); - - poller.subscribe(pollResponse -> { - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println("Validation Status: " + validationStatus); - } catch (IOException e) { - e.printStackTrace(); - } - }); - - AsyncPollResponse pollResponse = poller.blockLast(); - BinaryData fileBinary = pollResponse.getFinalResult().block(); - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String url = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println(String.format("%s\t%s\t%s\t%s", fileName, fileType, url, validationStatus)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperationsAsync-sample-beginUploadTestFile - } - - public void beginTestRun() { - // BEGIN: java-longRunningOperationsAsync-sample-beginTestRun - LoadTestRunAsyncClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - String inputTestRunId = "12345678-1234-1234-1234-123456789abc"; - String inputTestId = "87654321-1234-1234-1234-123456789abc"; - - Map testRunMap = new HashMap(); - testRunMap.put("testId", inputTestId); - testRunMap.put("displayName", "Sample Test Run"); - testRunMap.put("description", "Java SDK Sample Test Run"); - - Duration pollInterval = Duration.ofSeconds(5); - - BinaryData inputTestRunBinary = BinaryData.fromObject(testRunMap); - - PollerFlux poller = client.beginTestRun(inputTestRunId, inputTestRunBinary, null); - poller = poller.setPollInterval(pollInterval); - - poller.subscribe(pollResponse -> { - BinaryData testRunBinary = pollResponse.getValue(); - System.out.println("Test Run all info: " + testRunBinary.toString()); - }); - - AsyncPollResponse pollResponse = poller.blockLast(); - BinaryData testRunBinary = pollResponse.getFinalResult().block(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String testRunId = jsonTree.get("testRunId").toString(); - String status = jsonTree.get("status").toString(); - System.out.println(String.format("%s\t%s\t%s", testId, testRunId, status)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperationsAsync-sample-beginTestRun - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java deleted file mode 100644 index 9eb37551d645..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.credential.TokenCredential; -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; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@SuppressWarnings("unchecked") -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 - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); - LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); - adminClient.listTests(reqOpts); - - reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); - testRunClient.listTestRuns(reqOpts); - // END: java-readme-sample-auth - } - - public void createTest() { - // BEGIN: java-readme-sample-createTest - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .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("loadTestConfiguration", 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 = adminClient.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 - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - // extract file contents to BinaryData - BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - - // receive response with BinaryData content - PollResponse fileUrlOut = adminClient.beginUploadTestFile("test12345", "sample-file.jmx", fileData, null) - .waitForCompletion(Duration.ofMinutes(2)); - System.out.println(fileUrlOut.getValue().toString()); - // END: java-readme-sample-uploadTestFile - } - - public void runTest() { - // BEGIN: java-readme-sample-runTest - LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .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"); - - // convert the object Map to JSON BinaryData - BinaryData testRun = BinaryData.fromObject(testRunMap); - - // start test with poller - SyncPoller poller = testRunClient.beginTestRun("testrun12345", testRun, null); - Duration pollInterval = Duration.ofSeconds(5); - poller = poller.setPollInterval(pollInterval); - - // wait for test to reach terminal state - Map jsonTree = null; - String testStatus; - PollResponse pollResponse = poller.poll(); - while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // wait and check test status every 5 seconds - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); - } - - poller.waitForCompletion(); - BinaryData testRunBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - String startDateTime = jsonTree.get("startDateTime").toString(); - String endDateTime = jsonTree.get("endDateTime").toString(); - OffsetDateTime startOffsetDateTime = OffsetDateTime.parse(startDateTime); - OffsetDateTime endOffsetDateTime = OffsetDateTime.parse(endDateTime); - - // get list of all metric namespaces and pick the first one - Response metricNamespacesOut = testRunClient.getMetricNamespacesWithResponse("testrun12345", null); - String metricNamespace = null; - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricNamespacesOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - Map namespaceMap = (Map) metricNamespaces.get(0); - metricNamespace = namespaceMap.get("name").toString(); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // get list of all metric definitions and pick the first one - Response metricDefinitionsOut = testRunClient.getMetricDefinitionsWithResponse("testrun12345", metricNamespace, null); - String metricName = null; - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricDefinitionsOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - Map definitionMap = (Map) metricDefinitions.get(0); - Map nameMap = (Map) definitionMap.get("name"); - metricName = nameMap.get("value").toString(); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // fetch client metrics using metric namespace and metric name - PagedIterable clientMetricsOut = testRunClient.listMetrics("testrun12345", metricName, metricNamespace, startDateTime + '/' + endDateTime, null); - clientMetricsOut.forEach((clientMetric) -> { - System.out.println(clientMetric.toString()); - }); - // END: java-readme-sample-runTest - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncTests.java deleted file mode 100644 index 1cee507f058f..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncTests.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -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.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestAdministrationAsyncTests extends LoadTestingClientTestBase { - - // Helpers - - private Map getTestBodyFromDict() { - Map testMap = new HashMap<>(); - testMap.put("displayName", "Java SDK Sample Test Async"); - testMap.put("description", "Sample Test Async"); - - Map loadTestConfigMap = new HashMap<>(); - loadTestConfigMap.put("engineInstances", 1); - testMap.put("loadTestConfiguration", 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; - } - - private BinaryData getFileBodyFromResource(String fileName) { - URL url = LoadTestAdministrationAsyncTests.class.getClassLoader().getResource(fileName); - - return BinaryData.fromFile(new File(url.getPath()).toPath()); - } - - // Puts and Patches - - @Test - @Order(1) - public void createOrUpdateTest() { - BinaryData body = BinaryData.fromObject(getTestBodyFromDict()); - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().createOrUpdateTestWithResponse(newTestIdAsync, body, null); - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - @Test - @Order(2) - public void beginUploadTestFileAdditionalFiles() { - BinaryData file = getFileBodyFromResource(uploadCsvFileName); - RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "ADDITIONAL_ARTIFACTS"); - PollerFlux poller = getLoadTestAdministrationAsyncClient() - .beginUploadTestFile(newTestIdAsync, uploadCsvFileName, file, requestOptions); - poller = setPlaybackPollerFluxPollInterval(poller); - - StepVerifier.create(poller.last()) - .assertNext(pollResponse -> assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - pollResponse.getStatus())) - .verifyComplete(); - } - - @Test - @Order(3) - public void beginUploadTestFileTestScript() { - BinaryData file = getFileBodyFromResource(uploadJmxFileName); - RequestOptions fileUploadRequestOptions = new RequestOptions().addQueryParam("fileType", "JMX_FILE"); - PollerFlux poller = getLoadTestAdministrationAsyncClient() - .beginUploadTestFile(newTestIdAsync, uploadJmxFileName, file, fileUploadRequestOptions); - poller = setPlaybackPollerFluxPollInterval(poller); - - StepVerifier.create(poller.takeUntil(pollResponse -> pollResponse.getStatus().isComplete()) - .last() - .flatMap(AsyncPollResponse::getFinalResult)).assertNext(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals("VALIDATION_SUCCESS", jsonTree.get("validationStatus")); - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - }).verifyComplete(); - } - - @Test - @Order(4) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Mono> monoResponse = getLoadTestAdministrationAsyncClient() - .createOrUpdateAppComponentsWithResponse(newTestIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - @Test - @Order(5) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Mono> monoResponse = getLoadTestAdministrationAsyncClient() - .createOrUpdateServerMetricsConfigWithResponse(newTestIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - // Gets - - @Test - @Order(6) - public void getTestFile() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getTestFileWithResponse(newTestIdAsync, uploadJmxFileName, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - }).verifyComplete(); - } - - @Test - @Order(7) - public void getTest() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getTestWithResponse(newTestIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestIdAsync, jsonTree.get("testId")); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - - assertEquals(200, response.getStatusCode()); - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(8) - public void getAppComponents() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getAppComponentsWithResponse(newTestIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading app components", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(9) - public void getServerMetricsConfig() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getServerMetricsConfigWithResponse(newTestIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading server metrics", e); - } - }).verifyComplete(); - } - - // Lists - - @Test - @Order(10) - public void listTestFiles() { - PagedFlux response = getLoadTestAdministrationAsyncClient().listTestFiles(newTestIdAsync, null); - - StepVerifier.create(response).expectNextMatches(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }).thenConsumeWhile(fileBinary -> true).verifyComplete(); - } - - @Test - @Order(11) - public void listTests() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("orderBy", "lastModifiedDateTime desc"); - PagedFlux response = getLoadTestAdministrationAsyncClient().listTests(reqOpts); - - StepVerifier.create(response).expectNextMatches(testBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - return newTestIdAsync.equals(jsonTree.get("testId")); - } catch (IOException e) { - return false; - } - }).thenConsumeWhile(fileBinary -> true).verifyComplete(); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestFile() { - StepVerifier - .create(getLoadTestAdministrationAsyncClient().deleteTestFileWithResponse(newTestIdAsync, uploadCsvFileName, - null)) - .expectNextCount(1) - .verifyComplete(); - StepVerifier - .create(getLoadTestAdministrationAsyncClient().deleteTestFileWithResponse(newTestIdAsync, uploadJmxFileName, - null)) - .expectNextCount(1) - .verifyComplete(); - } - - @Test - @Order(13) - public void deleteTest() { - StepVerifier.create(getLoadTestAdministrationAsyncClient().deleteTestWithResponse(newTestIdAsync, null)) - .expectNextCount(1) - .verifyComplete(); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationTests.java deleted file mode 100644 index 3c54af35f56a..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationTests.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -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; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestAdministrationTests extends LoadTestingClientTestBase { - - // Helpers - - 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("loadTestConfiguration", 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; - } - - private BinaryData getFileBodyFromResource(String fileName) { - URL url = LoadTestAdministrationTests.class.getClassLoader().getResource(fileName); - - return BinaryData.fromFile(new File(url.getPath()).toPath()); - } - - // Puts and Patches - - @Test - @Order(1) - public void createOrUpdateTest() { - BinaryData body = BinaryData.fromObject(getTestBodyFromDict()); - Response response - = getLoadTestAdministrationClient().createOrUpdateTestWithResponse(newTestId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - @Test - @Order(2) - public void beginUploadTestFileAdditionalFiles() { - BinaryData file = getFileBodyFromResource(uploadCsvFileName); - RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "ADDITIONAL_ARTIFACTS"); - PollResponse response - = getLoadTestAdministrationClient().beginUploadTestFile(newTestId, uploadCsvFileName, file, requestOptions) - .poll(); - - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.getStatus()); - } - - @Test - @Order(3) - public void beginUploadTestFileTestScript() { - BinaryData file = getFileBodyFromResource(uploadJmxFileName); - RequestOptions fileUploadRequestOptions = new RequestOptions().addQueryParam("fileType", "JMX_FILE"); - SyncPoller poller = getLoadTestAdministrationClient().beginUploadTestFile(newTestId, - uploadJmxFileName, file, fileUploadRequestOptions); - poller = setPlaybackSyncPollerPollInterval(poller); - PollResponse response = poller.waitForCompletion(); - BinaryData fileBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals("VALIDATION_SUCCESS", jsonTree.get("validationStatus")); - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - - assertNotNull(response.getValue()); - } - - @Test - @Order(4) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Response response - = getLoadTestAdministrationClient().createOrUpdateAppComponentsWithResponse(newTestId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - @Test - @Order(5) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Response response - = getLoadTestAdministrationClient().createOrUpdateServerMetricsConfigWithResponse(newTestId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - // Gets - - @Test - @Order(6) - public void getTestFile() { - Response response - = getLoadTestAdministrationClient().getTestFileWithResponse(newTestId, uploadJmxFileName, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - } - - @Test - @Order(7) - public void getTest() { - Response response = getLoadTestAdministrationClient().getTestWithResponse(newTestId, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestId, jsonTree.get("testId")); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - } - - @SuppressWarnings("unchecked") - @Test - @Order(8) - public void getAppComponents() { - Response response = getLoadTestAdministrationClient().getAppComponentsWithResponse(newTestId, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - } - - @SuppressWarnings("unchecked") - @Test - @Order(9) - public void getServerMetricsConfig() { - Response response - = getLoadTestAdministrationClient().getServerMetricsConfigWithResponse(newTestId, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - } - - // Lists - - @Test - @Order(10) - public void listTestFiles() { - PagedIterable response = getLoadTestAdministrationClient().listTestFiles(newTestId, null); - boolean found = response.stream().anyMatch((fileBinary) -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }); - - assertTrue(found); - } - - @Test - @Order(11) - public void listTests() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("orderBy", "lastModifiedDateTime desc"); - PagedIterable response = getLoadTestAdministrationClient().listTests(reqOpts); - boolean found = response.stream().anyMatch((testBinary) -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - return newTestId.equals(jsonTree.get("testId")); - } catch (IOException e) { - return false; - } - }); - - assertTrue(found); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestFile() { - assertDoesNotThrow(() -> { - getLoadTestAdministrationClient().deleteTestFileWithResponse(newTestId, uploadCsvFileName, null); - }); - assertDoesNotThrow(() -> { - getLoadTestAdministrationClient().deleteTestFileWithResponse(newTestId, uploadJmxFileName, null); - }); - } - - @Test - @Order(13) - public void deleteTest() { - assertDoesNotThrow(() -> { - getLoadTestAdministrationClient().deleteTestWithResponse(newTestId, null); - }); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunAsyncTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunAsyncTests.java deleted file mode 100644 index 8480172c3925..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunAsyncTests.java +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -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.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.PollerFlux; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestRunAsyncTests extends LoadTestingClientTestBase { - - // Helpers - - private Map getTestRunBodyFromDict(String testId) { - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", testId); - testRunMap.put("displayName", "Java SDK Sample Test Run Async"); - testRunMap.put("description", "Sample Test Run Async"); - - return testRunMap; - } - - // Puts and Patches - - @Test - @Order(1) - public void beginTestRun() { - BinaryData body = BinaryData.fromObject(getTestRunBodyFromDict(existingTestId)); - PollerFlux poller - = getLoadTestRunAsyncClient().beginTestRun(newTestRunIdAsync, body, null); - poller = setPlaybackPollerFluxPollInterval(poller); - StepVerifier.create(poller.takeUntil(pollResponse -> pollResponse.getStatus().isComplete()) - .last() - .flatMap(AsyncPollResponse::getFinalResult)).assertNext(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunIdAsync, jsonTree.get("testRunId")); - assertEquals("DONE", jsonTree.get("status")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - }).verifyComplete(); - } - - @Test - @Order(2) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Mono> monoResponse - = getLoadTestRunAsyncClient().createOrUpdateAppComponentsWithResponse(newTestRunIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - @Test - @Order(3) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Mono> monoResponse - = getLoadTestRunAsyncClient().createOrUpdateServerMetricsConfigWithResponse(newTestRunIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - // Gets - - @Test - @Order(4) - public void getTestRunFile() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getTestRunFileWithResponse(newTestRunIdAsync, uploadJmxFileName, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test run file data", e); - } - }).verifyComplete(); - } - - @Test - @Order(5) - public void getTestRun() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getTestRunWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunIdAsync, jsonTree.get("testRunId")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - - assertEquals(200, response.getStatusCode()); - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(6) - public void getAppComponents() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getAppComponentsWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading app components", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(7) - public void getServerMetricsConfig() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getServerMetricsConfigWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading server metrics", e); - } - }).verifyComplete(); - } - - @SuppressWarnings({ "WriteOnlyObject", "unchecked" }) - @Test - @Order(8) - public void listMetricNamespaces() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getMetricNamespacesWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricNamespaces.forEach(namespace -> { - Map namespaceMap = (Map) namespace; - - if (namespaceMap.get("name").equals("LoadTestRunMetrics")) { - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric namespaces", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(9) - public void listMetricDefinitions() { - Mono> monoResponse = getLoadTestRunAsyncClient() - .getMetricDefinitionsWithResponse(newTestRunIdAsync, "LoadTestRunMetrics", null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricDefinitions.forEach(definition -> { - Map definitionMap = (Map) definition; - - if (definitionMap.get("namespace").equals("LoadTestRunMetrics") - && definitionMap.get("name") != null - && definitionMap.containsKey("dimensions")) { - - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric definitions", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(10) - public void listMetrics() { - Mono monoBoolean - = getLoadTestRunAsyncClient().getTestRunWithResponse(newTestRunIdAsync, null).flatMap(response -> { - String startDateTime = "", endDateTime = ""; - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - startDateTime = jsonTree.get("startDateTime").toString(); - endDateTime = jsonTree.get("endDateTime").toString(); - } catch (IOException e) { - fail("Encountered exception while reading metrics data", e); - } - - String timespan = startDateTime + "/" + endDateTime; - PagedFlux metricsResponse = getLoadTestRunAsyncClient().listMetrics(newTestRunIdAsync, - "VirtualUsers", "LoadTestRunMetrics", timespan, null); - - return metricsResponse.any(metricsBinary -> { - AtomicBoolean found = new AtomicBoolean(false); - - try (JsonReader jsonReader = JsonProviders.createReader(metricsBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - if (jsonTree.containsKey("data")) { - List data = (List) jsonTree.get("data"); - - data.forEach(metric -> { - Map metricMap = (Map) metric; - - if (metricMap.containsKey("value")) { - found.set(true); - } - }); - } - } catch (IOException e) { - // no-op - } - - return found.get(); - }); - }); - - StepVerifier.create(monoBoolean).expectNext(true).thenConsumeWhile(ignored -> true).verifyComplete(); - } - - // Lists - - @Test - @Order(11) - public void listTestRuns() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("testId", existingTestId); - PagedFlux response = getLoadTestRunAsyncClient().listTestRuns(reqOpts); - - StepVerifier.create(response).expectNextMatches(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunIdAsync, jsonTree.get("testRunId")); - assertEquals(existingTestId, jsonTree.get("testId")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }).thenConsumeWhile(testRunBinary -> true).verifyComplete(); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestRun() { - StepVerifier.create(getLoadTestRunAsyncClient().deleteTestRunWithResponse(newTestRunIdAsync, null)) - .expectNextCount(1) - .verifyComplete(); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunTests.java deleted file mode 100644 index 04b509441de6..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunTests.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -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; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; - -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@SuppressWarnings("unchecked") -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestRunTests extends LoadTestingClientTestBase { - - // Helpers - - private Map getTestRunBodyFromDict(String testId) { - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", testId); - testRunMap.put("displayName", "Java SDK Sample Test Run"); - testRunMap.put("description", "Sample Test Run"); - - return testRunMap; - } - - // Puts and Patches - - @Test - @Order(1) - public void beginTestRun() { - BinaryData body = BinaryData.fromObject(getTestRunBodyFromDict(existingTestId)); - SyncPoller poller = getLoadTestRunClient().beginTestRun(newTestRunId, body, null); - poller = setPlaybackSyncPollerPollInterval(poller); - PollResponse response = poller.waitForCompletion(); - BinaryData testRunBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunId, jsonTree.get("testRunId")); - assertEquals("DONE", jsonTree.get("status")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - - assertNotNull(response.getValue()); - } - - @Test - @Order(2) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Response response - = getLoadTestRunClient().createOrUpdateAppComponentsWithResponse(newTestRunId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - @Test - @Order(3) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Response response - = getLoadTestRunClient().createOrUpdateServerMetricsConfigWithResponse(newTestRunId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - // Gets - - @Test - @Order(4) - public void getTestRunFile() { - Response response - = getLoadTestRunClient().getTestRunFileWithResponse(newTestRunId, uploadJmxFileName, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test run file data", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @Test - @Order(5) - public void getTestRun() { - Response response = getLoadTestRunClient().getTestRunWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunId, jsonTree.get("testRunId")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @SuppressWarnings("unchecked") - @Test - @Order(6) - public void getAppComponents() { - Response response = getLoadTestRunClient().getAppComponentsWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading app components", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @SuppressWarnings("unchecked") - @Test - @Order(7) - public void getServerMetricsConfig() { - Response response = getLoadTestRunClient().getServerMetricsConfigWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading server metrics", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @SuppressWarnings("unchecked") - @Test - @Order(8) - public void listMetricNamespaces() { - Response response = getLoadTestRunClient().getMetricNamespacesWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricNamespaces.forEach(namespace -> { - Map namespaceMap = (Map) namespace; - - if (namespaceMap.get("name").equals("LoadTestRunMetrics")) { - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric namespaces", e); - } - } - - @Test - @Order(9) - public void listMetricDefinitions() { - Response response - = getLoadTestRunClient().getMetricDefinitionsWithResponse(newTestRunId, "LoadTestRunMetrics", null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricDefinitions.forEach(definition -> { - Map definitionMap = (Map) definition; - - if (definitionMap.get("namespace").equals("LoadTestRunMetrics") - && definitionMap.get("name") != null - && definitionMap.containsKey("dimensions")) { - - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric definitions", e); - } - } - - @Test - @Order(10) - public void listMetrics() { - String startDateTime = "", endDateTime = ""; - Response response = getLoadTestRunClient().getTestRunWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - startDateTime = jsonTree.get("startDateTime").toString(); - endDateTime = jsonTree.get("endDateTime").toString(); - } catch (IOException e) { - fail("Encountered exception while reading metrics data", e); - } - - String timespan = startDateTime + "/" + endDateTime; - PagedIterable metricsResponse - = getLoadTestRunClient().listMetrics(newTestRunId, "VirtualUsers", "LoadTestRunMetrics", timespan, null); - boolean valid = metricsResponse.stream().anyMatch(metricsBinary -> { - AtomicBoolean found = new AtomicBoolean(false); - - try (JsonReader jsonReader = JsonProviders.createReader(metricsBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - if (jsonTree.containsKey("data")) { - List data = (List) jsonTree.get("data"); - - data.forEach(metric -> { - Map metricMap = (Map) metric; - - if (metricMap.containsKey("value")) { - found.set(true); - } - }); - } - } catch (IOException e) { - // no-op - } - - return found.get(); - }); - - assertTrue(valid); - } - - // Lists - - @Test - @Order(11) - public void listTestRuns() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("testId", existingTestId); - PagedIterable response = getLoadTestRunClient().listTestRuns(reqOpts); - boolean found = response.stream().anyMatch(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunId, jsonTree.get("testRunId")); - assertEquals(existingTestId, jsonTree.get("testId")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }); - - assertTrue(found); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestRun() { - assertDoesNotThrow(() -> { - getLoadTestRunClient().deleteTestRunWithResponse(newTestRunId, null); - }); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java deleted file mode 100644 index 25e01492f9a6..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java +++ /dev/null @@ -1,254 +0,0 @@ -// 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.credential.TokenCredential; -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.TestMode; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.http.AssertingHttpClientBuilder; -import com.azure.core.test.models.TestProxyRequestMatcher; -import com.azure.core.test.models.TestProxyRequestMatcher.TestProxyRequestMatcherType; -import com.azure.core.test.models.TestProxySanitizer; -import com.azure.core.test.models.TestProxySanitizerType; -import com.azure.core.test.utils.MockTokenCredential; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.identity.AzureCliCredentialBuilder; -import com.azure.identity.AzureDeveloperCliCredentialBuilder; -import com.azure.identity.AzurePipelinesCredentialBuilder; -import com.azure.identity.AzurePowerShellCredentialBuilder; -import com.azure.identity.ChainedTokenCredentialBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.identity.EnvironmentCredentialBuilder; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -class LoadTestingClientTestBase extends TestProxyTestBase { - private static final String URL_REGEX = "(?<=http:\\/\\/|https:\\/\\/)([^\\/?]+)"; - private final String defaultEndpoint = "REDACTED.eastus.cnt-prod.loadtesting.azure.com"; - - protected final String existingTestId - = Configuration.getGlobalConfiguration().get("EXISTING_TEST_ID", "11111111-1234-1234-1234-123456789012"); - protected final String newTestId - = Configuration.getGlobalConfiguration().get("NEW_TEST_ID", "22222222-1234-1234-1234-123456789012"); - protected final String newTestIdAsync - = Configuration.getGlobalConfiguration().get("NEW_TEST_ID", "22223333-1234-1234-1234-123456789012"); - protected final String newTestRunId - = Configuration.getGlobalConfiguration().get("NEW_TEST_RUN_ID", "33333333-1234-1234-1234-123456789012"); - protected final String newTestRunIdAsync - = Configuration.getGlobalConfiguration().get("NEW_TEST_RUN_ID_2", "44444444-1234-1234-1234-123456789012"); - protected final String uploadJmxFileName - = Configuration.getGlobalConfiguration().get("UPLOAD_JMX_FILE_NAME", "sample-JMX-file.jmx"); - protected final String uploadCsvFileName - = Configuration.getGlobalConfiguration().get("UPLOAD_CSV_FILE_NAME", "additional-data.csv"); - protected final String defaultAppComponentResourceId = Configuration.getGlobalConfiguration() - .get("APP_COMPONENT_RESOURCE_ID", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource"); - protected final String defaultServerMetricId = Configuration.getGlobalConfiguration() - .get("SERVER_METRIC_ID", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration"); - - @Override - protected void beforeTest() { - if (getTestMode() != TestMode.LIVE) { - List sanitizers = new ArrayList<>(); - sanitizers.add(new TestProxySanitizer("Location", - "https://[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", - "https://REDACTED", TestProxySanitizerType.HEADER)); - sanitizers.add(new TestProxySanitizer(URL_REGEX, "REDACTED", TestProxySanitizerType.BODY_REGEX)); - interceptorManager.addSanitizers(sanitizers); - // Remove `operation-location`, `id` and `name` sanitizers from the list of common sanitizers. - interceptorManager.removeSanitizers("AZSDK2030", "AZSDK3430", "AZSDK3493"); - } - - if (getTestMode() == TestMode.PLAYBACK) { - List matchers = new ArrayList<>(); - matchers.add(new TestProxyRequestMatcher(TestProxyRequestMatcherType.BODILESS)); - interceptorManager.addMatchers(matchers); - } - } - - // Helpers - - protected LoadTestAdministrationClient getLoadTestAdministrationClient() { - return getLoadTestAdministrationClientBuilder(false).buildClient(); - } - - protected LoadTestAdministrationAsyncClient getLoadTestAdministrationAsyncClient() { - return getLoadTestAdministrationClientBuilder(true).buildAsyncClient(); - } - - protected LoadTestRunClient getLoadTestRunClient() { - return getLoadTestRunClientBuilder(false).buildClient(); - } - - protected LoadTestRunAsyncClient getLoadTestRunAsyncClient() { - return getLoadTestRunClientBuilder(true).buildAsyncClient(); - } - - protected Map getAppComponentBodyFromDict() { - Map appCompMap = new HashMap(); - Map compsMap = new HashMap(); - Map compMap = new HashMap(); - compMap.put("resourceId", defaultAppComponentResourceId); - compMap.put("resourceType", "microsoft.insights/components"); - compMap.put("resourceName", "appcomponentresource"); - compMap.put("displayName", "Performance_LoadTest_Insights"); - compMap.put("kind", "web"); - - compsMap.put(defaultAppComponentResourceId, compMap); - appCompMap.put("components", compsMap); - - return appCompMap; - } - - protected Map getServerMetricsBodyFromDict() { - Map serverMetricsMap = new HashMap(); - Map metricsMap = new HashMap(); - Map metricMap = new HashMap(); - metricMap.put("resourceId", defaultAppComponentResourceId); - metricMap.put("metricNamespace", "microsoft.insights/components"); - metricMap.put("name", "requests/duration"); - metricMap.put("aggregation", "Average"); - metricMap.put("resourceType", "microsoft.insights/components"); - - metricsMap.put(defaultServerMetricId, metricMap); - serverMetricsMap.put("metrics", metricsMap); - - return serverMetricsMap; - } - - private TokenCredential getTokenCredential() { - String authorityHost = Configuration.getGlobalConfiguration().get("AUTHORITY_HOST"); - - switch (getTestMode()) { - case RECORD: - DefaultAzureCredentialBuilder defaultAzureCredentialBuilder = new DefaultAzureCredentialBuilder(); - - if (authorityHost != null && !authorityHost.isEmpty()) { - defaultAzureCredentialBuilder.authorityHost(authorityHost); - } - - return defaultAzureCredentialBuilder.build(); - - case LIVE: - Configuration config = Configuration.getGlobalConfiguration(); - EnvironmentCredentialBuilder environmentCredentialBuilder = new EnvironmentCredentialBuilder(); - - if (authorityHost != null && !authorityHost.isEmpty()) { - environmentCredentialBuilder.authorityHost(authorityHost); - } - - ChainedTokenCredentialBuilder chainedTokenCredentialBuilder - = new ChainedTokenCredentialBuilder().addLast(environmentCredentialBuilder.build()) - .addLast(new AzureCliCredentialBuilder().build()) - .addLast(new AzureDeveloperCliCredentialBuilder().build()) - .addLast(new AzurePowerShellCredentialBuilder().build()); - - String serviceConnectionId = config.get("AZURESUBSCRIPTION_SERVICE_CONNECTION_ID"); - String clientId = config.get("AZURESUBSCRIPTION_CLIENT_ID"); - String tenantId = config.get("AZURESUBSCRIPTION_TENANT_ID"); - String systemAccessToken = config.get("SYSTEM_ACCESSTOKEN"); - - if (!CoreUtils.isNullOrEmpty(serviceConnectionId) - && !CoreUtils.isNullOrEmpty(clientId) - && !CoreUtils.isNullOrEmpty(tenantId) - && !CoreUtils.isNullOrEmpty(systemAccessToken)) { - - chainedTokenCredentialBuilder - .addLast(new AzurePipelinesCredentialBuilder().systemAccessToken(systemAccessToken) - .clientId(clientId) - .tenantId(tenantId) - .serviceConnectionId(serviceConnectionId) - .build()); - } - - return chainedTokenCredentialBuilder.build(); - - default: - // On PLAYBACK mode - return new MockTokenCredential(); - } - } - - private HttpClient buildAsyncAssertingClient(HttpClient httpClient) { - return new AssertingHttpClientBuilder(httpClient).assertAsync().build(); - } - - private HttpClient buildSyncAssertingClient(HttpClient httpClient) { - return new AssertingHttpClientBuilder(httpClient).assertSync().build(); - } - - private HttpClient getTestModeHttpClient() { - HttpClient httpClient; - if (getTestMode() == TestMode.PLAYBACK) { - httpClient = interceptorManager.getPlaybackClient(); - } else { - httpClient = HttpClient.createDefault(); - } - return httpClient; - } - - private LoadTestAdministrationClientBuilder getLoadTestAdministrationClientBuilder(boolean async) { - HttpClient httpClient = getTestModeHttpClient(); - - if (async) { - httpClient = buildAsyncAssertingClient(httpClient); - } else { - httpClient = buildSyncAssertingClient(httpClient); - } - - LoadTestAdministrationClientBuilder loadTestAdministrationClientBuilder - = new LoadTestAdministrationClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", defaultEndpoint)) - .httpClient(httpClient) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - - if (getTestMode() == TestMode.PLAYBACK) { - loadTestAdministrationClientBuilder.credential(new MockTokenCredential()); - } else if (getTestMode() == TestMode.RECORD) { - loadTestAdministrationClientBuilder.addPolicy(interceptorManager.getRecordPolicy()) - .credential(getTokenCredential()); - } else if (getTestMode() == TestMode.LIVE) { - loadTestAdministrationClientBuilder.credential(getTokenCredential()); - } - - return loadTestAdministrationClientBuilder; - } - - private LoadTestRunClientBuilder getLoadTestRunClientBuilder(boolean async) { - HttpClient httpClient = getTestModeHttpClient(); - - if (async) { - httpClient = buildAsyncAssertingClient(httpClient); - } else { - httpClient = buildSyncAssertingClient(httpClient); - } - - LoadTestRunClientBuilder loadTestRunClientBuilder = new LoadTestRunClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", defaultEndpoint)) - .httpClient(httpClient) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - - if (getTestMode() == TestMode.PLAYBACK) { - loadTestRunClientBuilder - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - loadTestRunClientBuilder.addPolicy(interceptorManager.getRecordPolicy()).credential(getTokenCredential()); - } else if (getTestMode() == TestMode.LIVE) { - loadTestRunClientBuilder.credential(getTokenCredential()); - } - - return loadTestRunClientBuilder; - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/additional-data.csv b/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/additional-data.csv deleted file mode 100644 index 96dbf5b98a39..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/additional-data.csv +++ /dev/null @@ -1,2 +0,0 @@ -a,b,c,d -1,2,3,4 diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx b/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx deleted file mode 100644 index 52feae899c0d..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - 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/loadtesting/azure-developer-loadtesting/swagger/autorest.md b/sdk/loadtesting/azure-developer-loadtesting/swagger/autorest.md deleted file mode 100644 index 3ff6e86a9580..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/swagger/autorest.md +++ /dev/null @@ -1,58 +0,0 @@ -# Azure Load Test Service for Java - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Load Test Service. - ---- -## Getting Started -To build the SDKs for Load Test Service, simply [Install Autorest](https://aka.ms/autorest) and in this folder, run: - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` - -### Setup -```ps -npm install -g autorest -``` - -### Generation - -```ps -cd -autorest -``` - -### Configuration - -```yaml -use: '@autorest/java@4.1.42' -output-folder: ../ -java: true -input-file: https://github.com/Azure/azure-rest-api-specs/blob/3e27c70e7c02c07b458bc0e94716c3d82d3fdd19/specification/loadtestservice/data-plane/Microsoft.LoadTestService/stable/2022-11-01/loadtestservice.json -title: LoadTestingClient -namespace: com.azure.developer.loadtesting -artifact-id: azure-developer-loadtesting -enable-sync-stack: true -generate-builder-per-client: true -data-plane: true -security: AADToken -security-scopes: https://cnt-prod.loadtesting.azure.com/.default -partial-update: true -service-versions: -- '2022-11-01' -directive: -- rename-operation: - from: LoadTestRun_ListMetricNamespaces - to: LoadTestRun_GetMetricNamespaces -- rename-operation: - from: LoadTestRun_ListMetricDefinitions - to: LoadTestRun_GetMetricDefinitions -- where-operation: LoadTestRun_ListMetrics - transform: $['parameters'][3]['x-ms-client-name'] = 'metricName' -- where-operation: LoadTestRun_ListMetricDimensionValues - transform: $['parameters'][3]['x-ms-client-name'] = 'metricName' -``` diff --git a/sdk/loadtesting/azure-developer-loadtesting/tsp-location.yaml b/sdk/loadtesting/azure-developer-loadtesting/tsp-location.yaml new file mode 100644 index 000000000000..c61bc597ada5 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/loadtestservice/LoadTestService +commit: 1e3132c2f308fd63ab800ce351d34851ada174fe +repo: Azure/azure-rest-api-specs +additionalDirectories: