diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 943231007285..21cd26fd9b86 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -172,6 +172,7 @@ com.azure:azure-communication-email;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-identity-providers-core;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-identity-providers-jdbc-mysql;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-identity-providers-jdbc-postgresql;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-developer-loadtesting;1.0.0-beta.1;1.0.0-beta.1 com.azure.spring:azure-spring-cloud-appconfiguration-config-web;2.9.0;2.10.0-beta.1 com.azure.spring:azure-spring-cloud-appconfiguration-config;2.9.0;2.10.0-beta.1 com.azure.spring:azure-spring-cloud-feature-management-web;2.8.0;2.9.0-beta.1 diff --git a/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md new file mode 100644 index 000000000000..fdec08a52533 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure LoadTestingClient client library for Java. This package contains Microsoft Azure LoadTestingClient client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/loadtestservice/azure-developer-loadtesting/README.md b/sdk/loadtestservice/azure-developer-loadtesting/README.md new file mode 100644 index 000000000000..83217b56c07f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/README.md @@ -0,0 +1,63 @@ +# Azure LoadTestingClient client library for Java + +Azure LoadTestingClient client library for Java. + +This package contains Microsoft Azure LoadTestingClient client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-developer-loadtesting;current}) +```xml + + com.azure + azure-developer-loadtesting + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.developer.loadtesting.readme +``` + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/loadtestservice/azure-developer-loadtesting/pom.xml b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml new file mode 100644 index 000000000000..deb11e3f47a7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/pom.xml @@ -0,0 +1,85 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-developer-loadtesting + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for LoadTestingClient Management + This package contains Microsoft Azure LoadTestingClient client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.33.0 + + + com.azure + azure-core-http-netty + 1.12.6 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + org.mockito + mockito-core + 4.5.1 + test + + + com.azure + azure-core-test + 1.12.1 + test + + + com.azure + azure-identity + 1.6.1 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + + diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java new file mode 100644 index 000000000000..a26dc9c8df5d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/AppComponentAsyncClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.developer.loadtesting.implementation.AppComponentsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous LoadTestingClient type. */ +@ServiceClient(builder = AppComponentClientBuilder.class, isAsync = true) +public final class AppComponentAsyncClient { + @Generated private final AppComponentsImpl serviceClient; + + /** + * Initializes an instance of AppComponentAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AppComponentAsyncClient(AppComponentsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Associate an app component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Components model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateWithResponseAsync(name, body, requestOptions); + } + + /** + * Delete an app component. + * + * @param name Unique name of the app component, 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> deleteWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(name, requestOptions); + } + + /** + * Get app Component details by unique name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Component details by unique name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(name, requestOptions); + } + + /** + * Get an app component for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Components model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateWithResponse(name, body, requestOptions).block(); + } + + /** + * Delete an app component. + * + * @param name Unique name of the app component, 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 deleteWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteWithResponse(name, requestOptions).block(); + } + + /** + * Get app Component details by unique name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Component details by unique name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, RequestOptions requestOptions) { + return this.client.getWithResponse(name, requestOptions).block(); + } + + /** + * Get an app component for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 localizedValue: String (Optional)
+     *                 value: String (Optional)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateWithResponseAsync(name, body, requestOptions); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 localizedValue: String (Optional)
+     *                 value: String (Optional)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, 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 server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(name, requestOptions); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, 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> deleteWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(name, requestOptions); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 localizedValue: String (Optional)
+     *                 value: String (Optional)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateWithResponse(name, body, requestOptions).block(); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 localizedValue: String (Optional)
+     *                 value: String (Optional)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, 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 server metrics configuration by its name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, RequestOptions requestOptions) { + return this.client.getWithResponse(name, requestOptions).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, 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 deleteWithResponse(String name, RequestOptions requestOptions) { + return this.client.deleteWithResponse(name, requestOptions).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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> createOrUpdateWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateWithResponseAsync(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> deleteWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(testId, requestOptions); + } + + /** + * Get load test details by test name. + * + *

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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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> getWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(testId, requestOptions); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 list(RequestOptions requestOptions) { + return this.serviceClient.listAsync(requestOptions); + } + + /** + * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the + * given test will be overwritten. File should be provided in the request body as multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNofileType. 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)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, must contain only lower-case alphabetic, numeric, underscore or hyphen + * characters. + * @param file file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadFileWithResponse( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + return this.serviceClient.uploadFileWithResponseAsync(testId, fileId, file, requestOptions); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, 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 file by the file name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getFileWithResponseAsync(testId, fileId, 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 fileId Unique name for test file, 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> deleteFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.deleteFileWithResponseAsync(testId, fileId, requestOptions); + } + + /** + * Get all test files. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (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 getAllFiles(String testId, RequestOptions requestOptions) { + return this.serviceClient.getAllFilesAsync(testId, requestOptions); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java new file mode 100644 index 000000000000..7dd9fa89caaa --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClient.java @@ -0,0 +1,562 @@ +// Copyright (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; + +/** Initializes a new instance of the synchronous LoadTestingClient type. */ +@ServiceClient(builder = TestClientBuilder.class) +public final class TestClient { + @Generated private final TestAsyncClient client; + + /** + * Initializes an instance of TestClient class. + * + * @param client the async client. + */ + @Generated + TestClient(TestAsyncClient client) { + this.client = client; + } + + /** + * Create a new test or update an existing test. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 createOrUpdateWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateWithResponse(testId, body, requestOptions).block(); + } + + /** + * 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 deleteWithResponse(String testId, RequestOptions requestOptions) { + return this.client.deleteWithResponse(testId, requestOptions).block(); + } + + /** + * Get load test details by test name. + * + *

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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 getWithResponse(String testId, RequestOptions requestOptions) { + return this.client.getWithResponse(testId, requestOptions).block(); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 list(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.list(requestOptions)); + } + + /** + * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the + * given test will be overwritten. File should be provided in the request body as multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNofileType. 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)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, must contain only lower-case alphabetic, numeric, underscore or hyphen + * characters. + * @param file file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadFileWithResponse( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + return this.client.uploadFileWithResponse(testId, fileId, file, requestOptions).block(); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, 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 file by the file name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return this.client.getFileWithResponse(testId, fileId, requestOptions).block(); + } + + /** + * 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 fileId Unique name for test file, 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 deleteFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return this.client.deleteFileWithResponse(testId, fileId, requestOptions).block(); + } + + /** + * Get all test files. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (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 getAllFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.getAllFiles(testId, requestOptions)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java new file mode 100644 index 000000000000..6011290ee37c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestClientBuilder.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the TestClient type. */ +@ServiceClientBuilder(serviceClients = {TestClient.class, TestAsyncClient.class}) +public final class TestClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + + @Generated + private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the TestClientBuilder. */ + @Generated + public TestClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Unique name of an existing load test. + */ + @Generated private String testId; + + /** + * Sets Unique name of an existing load test. + * + * @param testId the testId value. + * @return the TestClientBuilder. + */ + @Generated + public TestClientBuilder testId(String testId) { + this.testId = testId; + return this; + } + + /* + * Service version + */ + @Generated private LoadTestingServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the TestClientBuilder. + */ + @Generated + public TestClientBuilder 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 TestClientBuilder. + */ + @Generated + public TestClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of LoadTestingClientImpl with the provided parameters. + * + * @return an instance of LoadTestingClientImpl. + */ + @Generated + private LoadTestingClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + LoadTestingServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestingClientImpl client = + new LoadTestingClientImpl( + localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), + testId, + endpoint, + localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of TestAsyncClient class. + * + * @return an instance of TestAsyncClient. + */ + @Generated + public TestAsyncClient buildAsyncClient() { + return new TestAsyncClient(buildInnerClient().getTests()); + } + + /** + * Builds an instance of TestClient class. + * + * @return an instance of TestClient. + */ + @Generated + public TestClient buildClient() { + return new TestClient(new TestAsyncClient(buildInnerClient().getTests())); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java new file mode 100644 index 000000000000..6ee076b9498f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunAsyncClient.java @@ -0,0 +1,923 @@ +// Copyright (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.developer.loadtesting.implementation.TestRunsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous LoadTestingClient type. */ +@ServiceClient(builder = TestRunClientBuilder.class, isAsync = true) +public final class TestRunAsyncClient { + @Generated private final TestRunsImpl serviceClient; + + /** + * Initializes an instance of TestRunAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + TestRunAsyncClient(TestRunsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Delete a test run by its name. + * + * @param testRunId Unique name 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> deleteWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(testRunId, requestOptions); + } + + /** + * Create and start a new test run with the given name. + * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateWithResponseAsync(testRunId, body, requestOptions); + } + + /** + * Get test run details by name. + * + *

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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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> getWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(testRunId, requestOptions); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore + * or hyphen characters. + * @param fileId Unique name for test run file, 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 file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponse( + String testRunId, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getFileWithResponseAsync(testRunId, fileId, requestOptions); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoStart 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 (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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 list(RequestOptions requestOptions) { + return this.serviceClient.listAsync(requestOptions); + } + + /** + * Stop test run by name. + * + *

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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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> stopWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.stopWithResponseAsync(testRunId, requestOptions); + } + + /** + * Lists the metric namespaces for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             metricNamespaceName: 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> metricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.metricNamespacesWithResponseAsync(testRunId, requestOptions); + } + + /** + * Lists the metric definitions for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             dimensions (Optional): [
+     *                  (Optional){
+     *                     localizedValue: String (Optional)
+     *                     value: String (Optional)
+     *                 }
+     *             ]
+     *             displayDescription: String (Optional)
+     *             name (Optional): (recursive schema, see name above)
+     *             namespace: String (Optional)
+     *             primaryAggregationType: String(Average/Count/Minimum/Maximum/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> metricDefinitionsWithResponse( + String testRunId, String metricnamespace, RequestOptions requestOptions) { + return this.serviceClient.metricDefinitionsWithResponseAsync(testRunId, metricnamespace, requestOptions); + } + + /** + * Lists the metric values for a load test run. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe list of aggregation types (comma separated) to retrieve.
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
+     * {
+     *     interval: String (Optional)
+     *     namespace: String (Optional)
+     *     timespan: String (Optional)
+     *     value (Optional): {
+     *         displayDescription: String (Optional)
+     *         id: String (Optional)
+     *         name (Optional): {
+     *             localizedValue: String (Optional)
+     *             value: String (Optional)
+     *         }
+     *         timeseries (Optional): [
+     *              (Optional){
+     *                 data (Optional): [
+     *                      (Optional){
+     *                         average: Double (Optional)
+     *                         count: Double (Optional)
+     *                         maximum: Double (Optional)
+     *                         minimum: Double (Optional)
+     *                         timeStamp: String (Optional)
+     *                         total: Double (Optional)
+     *                         percentile90: Double (Optional)
+     *                         percentile95: Double (Optional)
+     *                         percentile99: Double (Optional)
+     *                     }
+     *                 ]
+     *                 metadatavalues (Optional): [
+     *                      (Optional){
+     *                         name (Optional): (recursive schema, see name above)
+     *                         value: String (Optional)
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (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 resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. Allowed values: "Data", "Metadata". + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> metricsWithResponse( + String testRunId, + String metricname, + String metricnamespace, + String resultType, + String timespan, + RequestOptions requestOptions) { + return this.serviceClient.metricsWithResponseAsync( + testRunId, metricname, metricnamespace, resultType, timespan, requestOptions); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java new file mode 100644 index 000000000000..9ea6eebd17de --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClient.java @@ -0,0 +1,919 @@ +// Copyright (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; + +/** Initializes a new instance of the synchronous LoadTestingClient type. */ +@ServiceClient(builder = TestRunClientBuilder.class) +public final class TestRunClient { + @Generated private final TestRunAsyncClient client; + + /** + * Initializes an instance of TestRunClient class. + * + * @param client the async client. + */ + @Generated + TestRunClient(TestRunAsyncClient client) { + this.client = client; + } + + /** + * Delete a test run by its name. + * + * @param testRunId Unique name 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 deleteWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.deleteWithResponse(testRunId, requestOptions).block(); + } + + /** + * Create and start a new test run with the given name. + * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return this.client.createOrUpdateWithResponse(testRunId, body, requestOptions).block(); + } + + /** + * Get test run details by name. + * + *

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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 getWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.getWithResponse(testRunId, requestOptions).block(); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore + * or hyphen characters. + * @param fileId Unique name for test run file, 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 file by file name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse(String testRunId, String fileId, RequestOptions requestOptions) { + return this.client.getFileWithResponse(testRunId, fileId, requestOptions).block(); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoStart 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 (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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 list(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.list(requestOptions)); + } + + /** + * Stop test run by name. + * + *

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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 stopWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.stopWithResponse(testRunId, requestOptions).block(); + } + + /** + * Lists the metric namespaces for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             metricNamespaceName: 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 metricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.metricNamespacesWithResponse(testRunId, requestOptions).block(); + } + + /** + * Lists the metric definitions for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             dimensions (Optional): [
+     *                  (Optional){
+     *                     localizedValue: String (Optional)
+     *                     value: String (Optional)
+     *                 }
+     *             ]
+     *             displayDescription: String (Optional)
+     *             name (Optional): (recursive schema, see name above)
+     *             namespace: String (Optional)
+     *             primaryAggregationType: String(Average/Count/Minimum/Maximum/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 metricDefinitionsWithResponse( + String testRunId, String metricnamespace, RequestOptions requestOptions) { + return this.client.metricDefinitionsWithResponse(testRunId, metricnamespace, requestOptions).block(); + } + + /** + * Lists the metric values for a load test run. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe list of aggregation types (comma separated) to retrieve.
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
+     * {
+     *     interval: String (Optional)
+     *     namespace: String (Optional)
+     *     timespan: String (Optional)
+     *     value (Optional): {
+     *         displayDescription: String (Optional)
+     *         id: String (Optional)
+     *         name (Optional): {
+     *             localizedValue: String (Optional)
+     *             value: String (Optional)
+     *         }
+     *         timeseries (Optional): [
+     *              (Optional){
+     *                 data (Optional): [
+     *                      (Optional){
+     *                         average: Double (Optional)
+     *                         count: Double (Optional)
+     *                         maximum: Double (Optional)
+     *                         minimum: Double (Optional)
+     *                         timeStamp: String (Optional)
+     *                         total: Double (Optional)
+     *                         percentile90: Double (Optional)
+     *                         percentile95: Double (Optional)
+     *                         percentile99: Double (Optional)
+     *                     }
+     *                 ]
+     *                 metadatavalues (Optional): [
+     *                      (Optional){
+     *                         name (Optional): (recursive schema, see name above)
+     *                         value: String (Optional)
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (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 resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. Allowed values: "Data", "Metadata". + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response metricsWithResponse( + String testRunId, + String metricname, + String metricnamespace, + String resultType, + String timespan, + RequestOptions requestOptions) { + return this.client + .metricsWithResponse(testRunId, metricname, metricnamespace, resultType, timespan, requestOptions) + .block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java new file mode 100644 index 000000000000..1b8b1d01ad93 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/TestRunClientBuilder.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the TestRunClient type. */ +@ServiceClientBuilder(serviceClients = {TestRunClient.class, TestRunAsyncClient.class}) +public final class TestRunClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://loadtest.azure-dev.com/.default"}; + + @Generated + private final Map properties = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the TestRunClientBuilder. */ + @Generated + public TestRunClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public TestRunClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Unique name of an existing load test. + */ + @Generated private String testId; + + /** + * Sets Unique name of an existing load test. + * + * @param testId the testId value. + * @return the TestRunClientBuilder. + */ + @Generated + public TestRunClientBuilder testId(String testId) { + this.testId = testId; + return this; + } + + /* + * Service version + */ + @Generated private LoadTestingServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the TestRunClientBuilder. + */ + @Generated + public TestRunClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the TestRunClientBuilder. + */ + @Generated + public TestRunClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of LoadTestingClientImpl with the provided parameters. + * + * @return an instance of LoadTestingClientImpl. + */ + @Generated + private LoadTestingClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + LoadTestingServiceVersion localServiceVersion = + (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestingClientImpl client = + new LoadTestingClientImpl( + localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), + testId, + endpoint, + localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of TestRunAsyncClient class. + * + * @return an instance of TestRunAsyncClient. + */ + @Generated + public TestRunAsyncClient buildAsyncClient() { + return new TestRunAsyncClient(buildInnerClient().getTestRuns()); + } + + /** + * Builds an instance of TestRunClient class. + * + * @return an instance of TestRunClient. + */ + @Generated + public TestRunClient buildClient() { + return new TestRunClient(new TestRunAsyncClient(buildInnerClient().getTestRuns())); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java new file mode 100644 index 000000000000..154a0f42ae43 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/AppComponentsImpl.java @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AppComponents. */ +public final class AppComponentsImpl { + /** The proxy service used to perform REST calls. */ + private final AppComponentsService service; + + /** The service client containing this operation class. */ + private final LoadTestingClientImpl client; + + /** + * Initializes an instance of AppComponentsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppComponentsImpl(LoadTestingClientImpl client) { + this.service = + RestProxy.create(AppComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestingClientAppComponents to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestingClientApp") + private interface AppComponentsService { + @Patch("/app-components/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdate( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/app-components/{name}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/app-components/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get( + @HostParam("Endpoint") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/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> getByTestOrTestRun( + @HostParam("Endpoint") String endpoint, + @QueryParam("testId") String testId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + } + + /** + * Associate an app component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Components model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String name, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdate( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Associate an app component (Azure resource) to a test or test run. + * + *

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Components model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateWithResponseAsync(name, body, requestOptions).block(); + } + + /** + * Delete an app component. + * + * @param name Unique name of the app component, 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> deleteWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.delete( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete an app component. + * + * @param name Unique name of the app component, 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 deleteWithResponse(String name, RequestOptions requestOptions) { + return deleteWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get app Component details by unique name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Component details by unique name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.get( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get app Component details by unique name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     resourceId: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     name: String (Optional)
+     *     value (Required): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Required)
+     *             resourceType: String (Optional)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name of the app component, 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 app Component details by unique name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, RequestOptions requestOptions) { + return getWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get an app component for a test or a test run by its name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Request Body Schema + * + *

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

Response Body Schema + * + *

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

Request Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 localizedValue: String (Optional)
+     *                 value: String (Optional)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param body Server metrics configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return server metrics configuration model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String name, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateWithResponseAsync(name, body, requestOptions).block(); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 localizedValue: String (Optional)
+     *                 value: String (Optional)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, 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 server metrics configuration by its name along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.get( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get server metrics configuration by its name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     name: String (Optional)
+     *     testId: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Optional): {
+     *             id: String (Optional)
+     *             resourceId: String (Required)
+     *             metricnamespace: String (Required)
+     *             displayDescription: String (Optional)
+     *             name (Required): {
+     *                 localizedValue: String (Optional)
+     *                 value: String (Optional)
+     *             }
+     *             aggregation: String (Required)
+     *             unit: String (Optional)
+     *             resourceType: String (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name Unique name for server metrics, 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 server metrics configuration by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, RequestOptions requestOptions) { + return getWithResponseAsync(name, requestOptions).block(); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, 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> deleteWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.delete( + this.client.getEndpoint(), + name, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete server metrics configuration by its name. + * + * @param name Unique name for server metrics, must 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 deleteWithResponse(String name, RequestOptions requestOptions) { + return deleteWithResponseAsync(name, requestOptions).block(); + } + + /** + * Get server metrics configuration for a test or test run by its name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testRunIdStringNoRequired testRunId, if testId field is not provided
+ * + * You can add these to a request with {@link RequestOptions#addQueryParam} + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all supported resource types for adding an app component(Azure resource types) along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedResourceTypeWithResponse(RequestOptions requestOptions) { + return listSupportedResourceTypeWithResponseAsync(requestOptions).block(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java new file mode 100644 index 000000000000..7cb7af412b5d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestRunsImpl.java @@ -0,0 +1,2427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TestRuns. */ +public final class TestRunsImpl { + /** The proxy service used to perform REST calls. */ + private final TestRunsService service; + + /** The service client containing this operation class. */ + private final LoadTestingClientImpl client; + + /** + * Initializes an instance of TestRunsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestRunsImpl(LoadTestingClientImpl client) { + this.service = RestProxy.create(TestRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestingClientTestRuns to be used by the proxy service to perform + * REST calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestingClientTes") + private interface TestRunsService { + @Delete("/testruns/{testRunId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Patch("/testruns/{testRunId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdate( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData body, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testruns/{testRunId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testruns/{testRunId}/files/{fileId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testruns/sortAndFilter") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> list( + @HostParam("Endpoint") String endpoint, + @QueryParam("testId") String testId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Post("/testruns/{testRunId}:stop") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> stop( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testRuns/{testRunId}/metricNamespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> metricNamespaces( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/testRuns/{testRunId}/metricDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> metricDefinitions( + @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("/testRuns/{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> metrics( + @HostParam("Endpoint") String endpoint, + @PathParam("testRunId") String testRunId, + @QueryParam("metricname") String metricname, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("resultType") String resultType, + @QueryParam("timespan") String timespan, + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.delete( + 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 deleteWithResponse(String testRunId, RequestOptions requestOptions) { + return deleteWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Create and start a new test run with the given name. + * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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> createOrUpdateWithResponseAsync( + String testRunId, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdate( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + body, + accept, + requestOptions, + context)); + } + + /** + * Create and start a new test run with the given name. + * + *

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

Request Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 createOrUpdateWithResponse( + String testRunId, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateWithResponseAsync(testRunId, body, requestOptions).block(); + } + + /** + * Get test run details by name. + * + *

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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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> getWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.get( + 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 (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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 getWithResponse(String testRunId, RequestOptions requestOptions) { + return getWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore + * or hyphen characters. + * @param fileId Unique name for test run file, 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 file by file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponseAsync( + String testRunId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getFile( + this.client.getEndpoint(), + testRunId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get test run file by file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore + * or hyphen characters. + * @param fileId Unique name for test run file, 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 file by file name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse(String testRunId, String fileId, RequestOptions requestOptions) { + return getFileWithResponseAsync(testRunId, fileId, requestOptions).block(); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoStart 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 (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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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> listSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.list( + this.client.getEndpoint(), + this.client.getTestId(), + 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 one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoStart 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 (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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 listAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listSinglePageAsync(requestOptions), + nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all test runs with given filters. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderByStringNoSort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc.
continuationTokenStringNoContinuation token to get the next page of response
searchStringNoFilter search based on searchable fields - description, executedUser.
executionFromOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run execution time filter range.
executionToOffsetDateTimeNoStart 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 (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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 list(RequestOptions requestOptions) { + return new PagedIterable<>(listAsync(requestOptions)); + } + + /** + * Stop test run by name. + * + *

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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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> stopWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.stop( + 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 (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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 stopWithResponse(String testRunId, RequestOptions requestOptions) { + return stopWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Lists the metric namespaces for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             metricNamespaceName: 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> metricNamespacesWithResponseAsync( + String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.metricNamespaces( + this.client.getEndpoint(), + testRunId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Lists the metric namespaces for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             metricNamespaceName: 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 metricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { + return metricNamespacesWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Lists the metric definitions for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             dimensions (Optional): [
+     *                  (Optional){
+     *                     localizedValue: String (Optional)
+     *                     value: String (Optional)
+     *                 }
+     *             ]
+     *             displayDescription: String (Optional)
+     *             name (Optional): (recursive schema, see name above)
+     *             namespace: String (Optional)
+     *             primaryAggregationType: String(Average/Count/Minimum/Maximum/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> metricDefinitionsWithResponseAsync( + String testRunId, String metricnamespace, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.metricDefinitions( + this.client.getEndpoint(), + testRunId, + metricnamespace, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Lists the metric definitions for a load test run. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value (Optional): [
+     *          (Optional){
+     *             dimensions (Optional): [
+     *                  (Optional){
+     *                     localizedValue: String (Optional)
+     *                     value: String (Optional)
+     *                 }
+     *             ]
+     *             displayDescription: String (Optional)
+     *             name (Optional): (recursive schema, see name above)
+     *             namespace: String (Optional)
+     *             primaryAggregationType: String(Average/Count/Minimum/Maximum/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 metricDefinitionsWithResponse( + String testRunId, String metricnamespace, RequestOptions requestOptions) { + return metricDefinitionsWithResponseAsync(testRunId, metricnamespace, requestOptions).block(); + } + + /** + * Lists the metric values for a load test run. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe list of aggregation types (comma separated) to retrieve.
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
+     * {
+     *     interval: String (Optional)
+     *     namespace: String (Optional)
+     *     timespan: String (Optional)
+     *     value (Optional): {
+     *         displayDescription: String (Optional)
+     *         id: String (Optional)
+     *         name (Optional): {
+     *             localizedValue: String (Optional)
+     *             value: String (Optional)
+     *         }
+     *         timeseries (Optional): [
+     *              (Optional){
+     *                 data (Optional): [
+     *                      (Optional){
+     *                         average: Double (Optional)
+     *                         count: Double (Optional)
+     *                         maximum: Double (Optional)
+     *                         minimum: Double (Optional)
+     *                         timeStamp: String (Optional)
+     *                         total: Double (Optional)
+     *                         percentile90: Double (Optional)
+     *                         percentile95: Double (Optional)
+     *                         percentile99: Double (Optional)
+     *                     }
+     *                 ]
+     *                 metadatavalues (Optional): [
+     *                      (Optional){
+     *                         name (Optional): (recursive schema, see name above)
+     *                         value: String (Optional)
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (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 resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. Allowed values: "Data", "Metadata". + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> metricsWithResponseAsync( + String testRunId, + String metricname, + String metricnamespace, + String resultType, + String timespan, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.metrics( + this.client.getEndpoint(), + testRunId, + metricname, + metricnamespace, + resultType, + timespan, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Lists the metric values for a load test run. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe list of aggregation types (comma separated) to retrieve.
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
+     * {
+     *     interval: String (Optional)
+     *     namespace: String (Optional)
+     *     timespan: String (Optional)
+     *     value (Optional): {
+     *         displayDescription: String (Optional)
+     *         id: String (Optional)
+     *         name (Optional): {
+     *             localizedValue: String (Optional)
+     *             value: String (Optional)
+     *         }
+     *         timeseries (Optional): [
+     *              (Optional){
+     *                 data (Optional): [
+     *                      (Optional){
+     *                         average: Double (Optional)
+     *                         count: Double (Optional)
+     *                         maximum: Double (Optional)
+     *                         minimum: Double (Optional)
+     *                         timeStamp: String (Optional)
+     *                         total: Double (Optional)
+     *                         percentile90: Double (Optional)
+     *                         percentile95: Double (Optional)
+     *                         percentile99: Double (Optional)
+     *                     }
+     *                 ]
+     *                 metadatavalues (Optional): [
+     *                      (Optional){
+     *                         name (Optional): (recursive schema, see name above)
+     *                         value: String (Optional)
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *         unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (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 resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. Allowed values: "Data", "Metadata". + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response metricsWithResponse( + String testRunId, + String metricname, + String metricnamespace, + String resultType, + String timespan, + RequestOptions requestOptions) { + return metricsWithResponseAsync(testRunId, metricname, metricnamespace, resultType, timespan, requestOptions) + .block(); + } + + /** + * Get the next page of items. + * + *

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(stop/continue) (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)
+     *         }
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Required): {
+     *             configUrl (Optional): {
+     *                 url: String (Optional)
+     *                 fileId: String (Optional)
+     *                 filename: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 expireTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *             }
+     *             testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *             userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *             inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *             additionalUrls (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultUrl (Optional): (recursive schema, see resultUrl above)
+     *             logsUrl (Optional): (recursive schema, see logsUrl above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (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)
+     *     vusers: Integer (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     subnetId: String (Optional)
+     *     resourceId: 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 + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java new file mode 100644 index 000000000000..161828a651dc --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/TestsImpl.java @@ -0,0 +1,1730 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Tests. */ +public final class TestsImpl { + /** The proxy service used to perform REST calls. */ + private final TestsService service; + + /** The service client containing this operation class. */ + private final LoadTestingClientImpl client; + + /** + * Initializes an instance of TestsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestsImpl(LoadTestingClientImpl client) { + this.service = RestProxy.create(TestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LoadTestingClientTests to be used by the proxy service to perform + * REST calls. + */ + @Host("https://{Endpoint}") + @ServiceInterface(name = "LoadTestingClientTes") + private interface TestsService { + @Patch("/loadtests/{testId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdate( + @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("/loadtests/{testId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/sortAndFilter") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> list( + @HostParam("Endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + // @Multipart not supported by RestProxy + @Put("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @BodyParam("multipart/form-data") BinaryData file, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/loadtests/{testId}/files/{fileId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteFile( + @HostParam("Endpoint") String endpoint, + @PathParam("testId") String testId, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/loadtests/{testId}/files") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAllFiles( + @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> listNext( + @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> getAllFilesNext( + @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 (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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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> createOrUpdateWithResponseAsync( + String testId, BinaryData body, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdate( + 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 (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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 createOrUpdateWithResponse( + String testId, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateWithResponseAsync(testId, body, requestOptions).block(); + } + + /** + * 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> deleteWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.delete( + 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 deleteWithResponse(String testId, RequestOptions requestOptions) { + return deleteWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get load test details by test name. + * + *

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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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> getWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.get( + 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 (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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 getWithResponse(String testId, RequestOptions requestOptions) { + return getWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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> listSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.list( + this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 listAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listSinglePageAsync(requestOptions), + nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 list(RequestOptions requestOptions) { + return new PagedIterable<>(listAsync(requestOptions)); + } + + /** + * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the + * given test will be overwritten. File should be provided in the request body as multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNofileType. 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)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, must contain only lower-case alphabetic, numeric, underscore or hyphen + * characters. + * @param file file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadFileWithResponseAsync( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.uploadFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + file, + accept, + requestOptions, + context)); + } + + /** + * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the + * given test will be overwritten. File should be provided in the request body as multipart/form-data. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNofileType. 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)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, must contain only lower-case alphabetic, numeric, underscore or hyphen + * characters. + * @param file file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return fileUrl Model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadFileWithResponse( + String testId, String fileId, BinaryData file, RequestOptions requestOptions) { + return uploadFileWithResponseAsync(testId, fileId, file, requestOptions).block(); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, 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 file by the file name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get test file by the file name. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, 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 file by the file name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return getFileWithResponseAsync(testId, fileId, requestOptions).block(); + } + + /** + * 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 fileId Unique name for test file, 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> deleteFileWithResponseAsync( + String testId, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteFile( + this.client.getEndpoint(), + testId, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + * @param fileId Unique name for test file, 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 deleteFileWithResponse(String testId, String fileId, RequestOptions requestOptions) { + return deleteFileWithResponseAsync(testId, fileId, requestOptions).block(); + } + + /** + * Get all test files. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (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> getAllFilesSinglePageAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAllFiles( + 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. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (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 getAllFilesAsync(String testId, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> getAllFilesSinglePageAsync(testId, requestOptions), + nextLink -> getAllFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all test files. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     url: String (Optional)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (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 getAllFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(getAllFilesAsync(testId, requestOptions)); + } + + /** + * Get the next page of items. + * + *

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(stop/continue) (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)
+     *     }
+     *     loadTestConfig (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             vusers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Integer (Optional)
+     *         }
+     *     }
+     *     inputArtifacts (Optional): {
+     *         configUrl (Optional): {
+     *             url: String (Optional)
+     *             fileId: String (Optional)
+     *             filename: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             expireTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     *         }
+     *         testScriptUrl (Optional): (recursive schema, see testScriptUrl above)
+     *         userPropUrl (Optional): (recursive schema, see userPropUrl above)
+     *         inputArtifactsZipFileurl (Optional): (recursive schema, see inputArtifactsZipFileurl above)
+     *         additionalUrls (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     resourceId: 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 + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of Resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listNext(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)
+     *     fileId: String (Optional)
+     *     filename: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     expireTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED) (Optional)
+     * }
+     * }
+ * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAllFilesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getAllFilesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java new file mode 100644 index 000000000000..3e90e2fad3f8 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for LoadTestingClient. These APIs allow end users to create, view and run load + * tests using Azure Load Test Service. + */ +package com.azure.developer.loadtesting.implementation; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java new file mode 100644 index 000000000000..a56b00226ee5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for LoadTestingClient. These APIs allow end users to create, view and run load tests + * using Azure Load Test Service. + */ +package com.azure.developer.loadtesting; diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java new file mode 100644 index 000000000000..c735cba0bf71 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/java/module-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.developer.loadtesting { + requires transitive com.azure.core; + + exports com.azure.developer.loadtesting; +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties b/sdk/loadtestservice/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/main/resources/azure-developer-loadtesting.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java new file mode 100644 index 000000000000..75e13b453d91 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.developer.loadtesting.readme + // END: com.azure.developer.loadtesting.readme + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATest.java new file mode 100644 index 000000000000..1a4129ccd012 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATest.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateOrUpdateATest { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testcreateorupdate.createorupdateatest + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/sampleprovider/sampleresourcetype/sampleresourcename\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.createOrUpdateWithResponse("12345678-1234-1234-1234-123456789012", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.testcreateorupdate.createorupdateatest + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestRun.java new file mode 100644 index 000000000000..c43ccd0bf91f --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestRun.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateOrUpdateATestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testruncreateorupdate.createorupdateatestrun + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest_Run1\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"testId\":\"12345678-1234-1234-1234-123456789012\"}"); + RequestOptions requestOptions = + new RequestOptions().addQueryParam("oldTestRunId", "12345678-1234-1234-1234-123456789012"); + Response response = + testRunClient.createOrUpdateWithResponse("12316678-1234-1234-1234-122451189012", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.testruncreateorupdate.createorupdateatestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAnAppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAnAppComponent.java new file mode 100644 index 000000000000..f48e39ded838 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAnAppComponent.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateOrUpdateAnAppComponent { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentcreateorupdate.createorupdateanappcomponent + BinaryData body = + BinaryData.fromString( + "{\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\"}}}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.createOrUpdateWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentcreateorupdate.createorupdateanappcomponent + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfiguration.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfiguration.java new file mode 100644 index 000000000000..1c6680cd29ff --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfiguration.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class CreateOrUpdateServerMetricsConfiguration { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricscreateorupdate.createorupdateservermetricsconfiguration + BinaryData body = + BinaryData.fromString( + "{\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.createOrUpdateWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", body, requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricscreateorupdate.createorupdateservermetricsconfiguration + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAServerMetricsConfiguration.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAServerMetricsConfiguration.java new file mode 100644 index 000000000000..7dee62509a39 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAServerMetricsConfiguration.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteAServerMetricsConfiguration { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsdelete.deleteaservermetricsconfiguration + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.deleteWithResponse("edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsdelete.deleteaservermetricsconfiguration + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATest.java new file mode 100644 index 000000000000..825955198c55 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATest.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteATest { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testdelete.deleteatest + RequestOptions requestOptions = new RequestOptions(); + Response response = testClient.deleteWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testdelete.deleteatest + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATestFile.java new file mode 100644 index 000000000000..1431807d9e31 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATestFile.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteATestFile { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testdeletefile.deleteatestfile + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.deleteFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testdeletefile.deleteatestfile + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATestRun.java new file mode 100644 index 000000000000..d5a72430fc49 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteATestRun.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteATestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrundelete.deleteatestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.deleteWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrundelete.deleteatestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAnAppComponent.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAnAppComponent.java new file mode 100644 index 000000000000..0a35cda18b9c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/DeleteAnAppComponent.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeleteAnAppComponent { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentdelete.deleteanappcomponent + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.deleteWithResponse("ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentdelete.deleteanappcomponent + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestByAnUniqueName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestByAnUniqueName.java new file mode 100644 index 000000000000..6bc89b140a5c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestByAnUniqueName.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetATestByAnUniqueName { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testget.getatestbyanuniquename + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testget.getatestbyanuniquename + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestFileByAnUniqueName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestFileByAnUniqueName.java new file mode 100644 index 000000000000..6c6c4eeb718d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestFileByAnUniqueName.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetATestFileByAnUniqueName { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testgetfile.getatestfilebyanuniquename + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testgetfile.getatestfilebyanuniquename + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestRun.java new file mode 100644 index 000000000000..71fcf8349a0d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestRun.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetATestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunget.getatestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunget.getatestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestRunFileByAnUniqueName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestRunFileByAnUniqueName.java new file mode 100644 index 000000000000..13c936ebe4a6 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetATestRunFileByAnUniqueName.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetATestRunFileByAnUniqueName { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrungetfile.getatestrunfilebyanuniquename + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getFileWithResponse( + "12316678-1234-1234-1234-122451189012", "92345678-1234-1111-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrungetfile.getatestrunfilebyanuniquename + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllUploadedFilesToATest.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllUploadedFilesToATest.java new file mode 100644 index 000000000000..f9100d0367dc --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAllUploadedFilesToATest.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetAllUploadedFilesToATest { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testgetallfiles.getalluploadedfilestoatest + RequestOptions requestOptions = new RequestOptions().addQueryParam("continuationToken", "continuation token"); + PagedIterable response = + testClient.getAllFiles("12345678-1234-1234-1234-123456789012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testgetallfiles.getalluploadedfilestoatest + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByATestOrTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByATestOrTestRun.java new file mode 100644 index 000000000000..ea93f2685660 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByATestOrTestRun.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetAnAppComponentByATestOrTestRun { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentgetbytestortestrun.getanappcomponentbyatestortestrun + RequestOptions requestOptions = + new RequestOptions().addQueryParam("testRunId", "12316678-1234-1234-1234-122451189012"); + Response response = appComponentClient.getByTestOrTestRunWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentgetbytestortestrun.getanappcomponentbyatestortestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByAnUniqueName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByAnUniqueName.java new file mode 100644 index 000000000000..0c6296f51c1d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByAnUniqueName.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetAnAppComponentByAnUniqueName { + public static void main(String[] args) { + AppComponentClient appComponentClient = + new AppComponentClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.appcomponentget.getanappcomponentbyanuniquename + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.getWithResponse("ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + // END:com.azure.developer.loadtesting.generated.appcomponentget.getanappcomponentbyanuniquename + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetDefaultServerMetricsConfiguration.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetDefaultServerMetricsConfiguration.java new file mode 100644 index 000000000000..21871cf44c52 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetDefaultServerMetricsConfiguration.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetDefaultServerMetricsConfiguration { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetdefaultmetrics.getdefaultservermetricsconfiguration + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.getDefaultMetricsWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsgetdefaultmetrics.getdefaultservermetricsconfiguration + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetListOfSupportedResourceTypesForConfiguringServerMetrics.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetListOfSupportedResourceTypesForConfiguringServerMetrics.java new file mode 100644 index 000000000000..002af6ceb384 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetListOfSupportedResourceTypesForConfiguringServerMetrics.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetListOfSupportedResourceTypesForConfiguringServerMetrics { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricslistsupportedresourcetype.getlistofsupportedresourcetypesforconfiguringservermetrics + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.listSupportedResourceTypeWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricslistsupportedresourcetype.getlistofsupportedresourcetypesforconfiguringservermetrics + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByAnUniqueName.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByAnUniqueName.java new file mode 100644 index 000000000000..3c33d69ae15e --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsByAnUniqueName.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetServerMetricsByAnUniqueName { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsget.getservermetricsbyanuniquename + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.getWithResponse("edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsget.getservermetricsbyanuniquename + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsConfigurationByATestOrTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsConfigurationByATestOrTestRun.java new file mode 100644 index 000000000000..e9ad10237128 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/GetServerMetricsConfigurationByATestOrTestRun.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class GetServerMetricsConfigurationByATestOrTestRun { + public static void main(String[] args) { + ServerMetricsClient serverMetricsClient = + new ServerMetricsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .testId("12345678-1234-1234-1234-123456789012") + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.servermetricsgetbytestortestrun.getservermetricsconfigurationbyatestortestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.getByTestOrTestRunWithResponse(requestOptions); + // END:com.azure.developer.loadtesting.generated.servermetricsgetbytestortestrun.getservermetricsconfigurationbyatestortestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricDefinitionsForALoadTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricDefinitionsForALoadTestRun.java new file mode 100644 index 000000000000..aa48a180c89c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricDefinitionsForALoadTestRun.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsTheMetricDefinitionsForALoadTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunmetricdefinitions.liststhemetricdefinitionsforaloadtestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.metricDefinitionsWithResponse( + "12316678-1234-1234-1234-122451189012", "JMeterLoadTestRunMetrics", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunmetricdefinitions.liststhemetricdefinitionsforaloadtestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricMetadataForALoadTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricMetadataForALoadTestRun.java new file mode 100644 index 000000000000..111717e60ea6 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricMetadataForALoadTestRun.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsTheMetricMetadataForALoadTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunmetrics.liststhemetricmetadataforaloadtestrun + RequestOptions requestOptions = + new RequestOptions().addQueryParam("aggregation", "Average").addQueryParam("interval", "PT1H"); + Response response = + testRunClient.metricsWithResponse( + "12316678-1234-1234-1234-122451189012", + "ActiveThreads", + "JMeterLoadTestRunMetrics", + "Metadata", + "2022-09-24T19:00:40Z/2022-09-25T19:28:40Z", + requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunmetrics.liststhemetricmetadataforaloadtestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricNamespacesForALoadTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricNamespacesForALoadTestRun.java new file mode 100644 index 000000000000..4852c71b875d --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricNamespacesForALoadTestRun.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsTheMetricNamespacesForALoadTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunmetricnamespaces.liststhemetricnamespacesforaloadtestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.metricNamespacesWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunmetricnamespaces.liststhemetricnamespacesforaloadtestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricValuesForALoadTestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricValuesForALoadTestRun.java new file mode 100644 index 000000000000..883a63b7539a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/ListsTheMetricValuesForALoadTestRun.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class ListsTheMetricValuesForALoadTestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunmetrics.liststhemetricvaluesforaloadtestrun + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("aggregation", "Average") + .setBody( + BinaryData.fromString( + "{\"filters\":[{\"name\":\"SamplerName\",\"values\":[\"HTTP Request\"]}]}")) + .addQueryParam("interval", "PT1H"); + Response response = + testRunClient.metricsWithResponse( + "12316678-1234-1234-1234-122451189012", + "ActiveThreads", + "JMeterLoadTestRunMetrics", + "Data", + "2022-09-24T19:00:40Z/2022-09-25T19:28:40Z", + requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunmetrics.liststhemetricvaluesforaloadtestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/SearchTestRunsWithFilters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/SearchTestRunsWithFilters.java new file mode 100644 index 000000000000..39bf9d1ceec9 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/SearchTestRunsWithFilters.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class SearchTestRunsWithFilters { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .testId("12345678-1234-1234-1234-123456789012") + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunlist.searchtestrunswithfilters + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("executionFrom", "2021-12-05T16:43:48.805Z") + .addQueryParam("executionTo", "2021-12-05T16:43:48.805Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest_Run1") + .addQueryParam("status", "DONE,EXECUTING"); + PagedIterable response = testRunClient.list(requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunlist.searchtestrunswithfilters + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/SearchTestWithFilters.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/SearchTestWithFilters.java new file mode 100644 index 000000000000..5b279d9021d3 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/SearchTestWithFilters.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class SearchTestWithFilters { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testlist.searchtestwithfilters + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("lastUpdatedEndTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("lastUpdatedStartTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest"); + PagedIterable response = testClient.list(requestOptions); + // END:com.azure.developer.loadtesting.generated.testlist.searchtestwithfilters + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopATestRun.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopATestRun.java new file mode 100644 index 000000000000..6ab5590fee00 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/StopATestRun.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class StopATestRun { + public static void main(String[] args) { + TestRunClient testRunClient = + new TestRunClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testrunstop.stopatestrun + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.stopWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + // END:com.azure.developer.loadtesting.generated.testrunstop.stopatestrun + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadATestFile.java b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadATestFile.java new file mode 100644 index 000000000000..1f93f843a42c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/generated/UploadATestFile.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class UploadATestFile { + public static void main(String[] args) { + TestClient testClient = + new TestClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .buildClient(); + // BEGIN:com.azure.developer.loadtesting.generated.testuploadfile.uploadatestfile + BinaryData file = BinaryData.fromString("\"multipart-form-data\""); + RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "ADDITIONAL_ARTIFACTS"); + Response response = + testClient.uploadFileWithResponse( + "12345678-1234-1234-1234-123456789012", + "92345678-1234-1111-1234-123456789012", + file, + requestOptions); + // END:com.azure.developer.loadtesting.generated.testuploadfile.uploadatestfile + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestRunTests.java new file mode 100644 index 000000000000..d530e439e325 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestRunTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateATestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateATestRunTests() { + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest_Run1\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"testId\":\"12345678-1234-1234-1234-123456789012\"}"); + RequestOptions requestOptions = + new RequestOptions().addQueryParam("oldTestRunId", "12345678-1234-1234-1234-123456789012"); + Response response = + testRunClient.createOrUpdateWithResponse("12316678-1234-1234-1234-122451189012", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestTests.java new file mode 100644 index 000000000000..931d656d6e14 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateATestTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateATestTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateATestTests() { + BinaryData body = + BinaryData.fromString( + "{\"description\":\"sample description\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/sampleprovider/sampleresourcetype/sampleresourcename\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"value\":20}}},\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.createOrUpdateWithResponse("12345678-1234-1234-1234-123456789012", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAnAppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAnAppComponentTests.java new file mode 100644 index 000000000000..ebb58b846842 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateAnAppComponentTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateAnAppComponentTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateAnAppComponentTests() { + BinaryData body = + BinaryData.fromString( + "{\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\"}}}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.createOrUpdateWithResponse( + "ee843bd9-a6d4-4364-a45c-427a03c39fa7", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigurationTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigurationTests.java new file mode 100644 index 000000000000..36840f4b1bcf --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/CreateOrUpdateServerMetricsConfigurationTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class CreateOrUpdateServerMetricsConfigurationTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateServerMetricsConfigurationTests() { + BinaryData body = + BinaryData.fromString( + "{\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.createOrUpdateWithResponse( + "edc6e529-d009-4b99-b763-ca492e3a2823", body, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAServerMetricsConfigurationTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAServerMetricsConfigurationTests.java new file mode 100644 index 000000000000..91d708e596c9 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAServerMetricsConfigurationTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteAServerMetricsConfigurationTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testDeleteAServerMetricsConfigurationTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.deleteWithResponse("edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestFileTests.java new file mode 100644 index 000000000000..5d0426c60abf --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestFileTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteATestFileTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testDeleteATestFileTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.deleteFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestRunTests.java new file mode 100644 index 000000000000..241a762fb876 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestRunTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteATestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testDeleteATestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.deleteWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestTests.java new file mode 100644 index 000000000000..1116303942c1 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteATestTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteATestTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testDeleteATestTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = testClient.deleteWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAnAppComponentTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAnAppComponentTests.java new file mode 100644 index 000000000000..188a62b00de7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/DeleteAnAppComponentTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeleteAnAppComponentTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testDeleteAnAppComponentTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.deleteWithResponse("ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestByAnUniqueNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestByAnUniqueNameTests.java new file mode 100644 index 000000000000..cf0f1a1236ff --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestByAnUniqueNameTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetATestByAnUniqueNameTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetATestByAnUniqueNameTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getWithResponse("12345678-1234-1234-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":\"USER_PROPERTIES\",\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":0,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":null,\"value\":20}}},\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testId\":\"12345678-1234-1234-1234-123456789012\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestFileByAnUniqueNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestFileByAnUniqueNameTests.java new file mode 100644 index 000000000000..ff11077e22fa --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestFileByAnUniqueNameTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetATestFileByAnUniqueNameTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetATestFileByAnUniqueNameTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testClient.getFileWithResponse( + "12345678-1234-1234-1234-123456789012", "92345678-1234-1111-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestRunFileByAnUniqueNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestRunFileByAnUniqueNameTests.java new file mode 100644 index 000000000000..5550f64b8afb --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestRunFileByAnUniqueNameTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetATestRunFileByAnUniqueNameTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetATestRunFileByAnUniqueNameTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getFileWithResponse( + "12316678-1234-1234-1234-122451189012", "92345678-1234-1111-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestRunTests.java new file mode 100644 index 000000000000..188da86a0996 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetATestRunTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetATestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetATestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.getWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":18,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":20}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"DONE\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":\"USER_PROPERTIES\",\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":{\"expireTime\":\"2022-05-16T09:14:46.0411793+00:00\",\"fileId\":\"abb846a7-63af-4d63-bb3d-a7aa4caff55c\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"worker.log\",\"url\":\"https://dummyurl.com/logresource\",\"validationStatus\":\"\"},\"resultUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/dummyresourceresult\",\"validationStatus\":\"VALIDATION_SUCCESS\"}}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"PASSED\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":{\"Total\":{\"errorCount\":19,\"errorPct\":17,\"maxResTime\":16,\"meanResTime\":13,\"medianResTime\":10,\"minResTime\":18,\"pct1ResTime\":27,\"pct2ResTime\":20,\"pct3ResTime\":3,\"receivedKBytesPerSec\":13,\"sampleCount\":18,\"sentKBytesPerSec\":4,\"throughput\":5,\"transaction\":\"Total\"}},\"vusers\":4}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllUploadedFilesToATestTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllUploadedFilesToATestTests.java new file mode 100644 index 000000000000..394d049d4bc6 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAllUploadedFilesToATestTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetAllUploadedFilesToATestTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetAllUploadedFilesToATestTests() { + RequestOptions requestOptions = new RequestOptions().addQueryParam("continuationToken", "continuation token"); + PagedIterable response = + testClient.getAllFiles("12345678-1234-1234-1234-123456789012", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByATestOrTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByATestOrTestRunTests.java new file mode 100644 index 000000000000..2713cdd0fcf1 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByATestOrTestRunTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetAnAppComponentByATestOrTestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetAnAppComponentByATestOrTestRunTests() { + RequestOptions requestOptions = + new RequestOptions().addQueryParam("testRunId", "12316678-1234-1234-1234-122451189012"); + Response response = appComponentClient.getByTestOrTestRunWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"ee843bd9-a6d4-4364-a45c-427a03c39fa7\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceGroup\":\"samplerg\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByAnUniqueNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByAnUniqueNameTests.java new file mode 100644 index 000000000000..a2e769c19feb --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetAnAppComponentByAnUniqueNameTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetAnAppComponentByAnUniqueNameTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetAnAppComponentByAnUniqueNameTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + appComponentClient.getWithResponse("ee843bd9-a6d4-4364-a45c-427a03c39fa7", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"ee843bd9-a6d4-4364-a45c-427a03c39fa7\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"value\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\":{\"displayName\":\"Performance_LoadTest_Insights\",\"kind\":\"web\",\"resourceGroup\":\"samplerg\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceName\":\"appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetDefaultServerMetricsConfigurationTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetDefaultServerMetricsConfigurationTests.java new file mode 100644 index 000000000000..45801d63b16c --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetDefaultServerMetricsConfigurationTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetDefaultServerMetricsConfigurationTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetDefaultServerMetricsConfigurationTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.getDefaultMetricsWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"defaultMetrics\":{\"microsoft.cache/redis\":[{\"name\":{\"localizedValue\":\"Server Load\",\"value\":\"serverLoad\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Cache Latency\",\"value\":\"cacheLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Cache Hits\",\"value\":\"cachehits\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null},{\"name\":{\"localizedValue\":\"Connected Clients\",\"value\":\"connectedclients\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.cache/redis\",\"unit\":null}],\"microsoft.classiccompute/virtualmachines\":[{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classiccompute/virtualmachines\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success E2E Latency\",\"value\":\"SuccessE2ELatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success Server Latency\",\"value\":\"SuccessServerLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Used Capacity\",\"value\":\"UsedCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/blobservices\":[{\"name\":{\"localizedValue\":\"Blob Count\",\"value\":\"BlobCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Index Capacity\",\"value\":\"ContainerCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Capacity\",\"value\":\"BlobCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/blobservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/fileservices\":[{\"name\":{\"localizedValue\":\"File Capacity\",\"value\":\"FileCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"File Count\",\"value\":\"FileCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/fileservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/queueservices\":[{\"name\":{\"localizedValue\":\"Queue Count\",\"value\":\"QueueCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Queue Capacity\",\"value\":\"QueueCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/queueservices\",\"unit\":null}],\"microsoft.classicstorage/storageaccounts/tableservices\":[{\"name\":{\"localizedValue\":\"Table Count\",\"value\":\"TableCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Capacity\",\"value\":\"TableCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.classicstorage/storageaccounts/tableservices\",\"unit\":null}],\"microsoft.compute/virtualmachines\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachines\",\"unit\":null}],\"microsoft.compute/virtualmachinescalesets\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null}],\"microsoft.containerinstance/containergroups\":[{\"name\":{\"localizedValue\":\"CPU Usage\",\"value\":\"CpuUsage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerinstance/containergroups\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory Usage\",\"value\":\"MemoryUsage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerinstance/containergroups\",\"unit\":null}],\"microsoft.containerservice/managedclusters\":[{\"name\":{\"localizedValue\":\"Total number of available cpu cores in a managed cluster\",\"value\":\"kube_node_status_allocatable_cpu_cores\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Total amount of available memory in a managed cluster\",\"value\":\"kube_node_status_allocatable_memory_bytes\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Number of pods in Ready state\",\"value\":\"kube_pod_status_ready\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.containerservice/managedclusters\",\"unit\":null}],\"microsoft.dbformariadb/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformariadb/servers\",\"unit\":null}],\"microsoft.dbformysql/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbformysql/servers\",\"unit\":null}],\"microsoft.dbforpostgresql/servers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO percent\",\"value\":\"io_consumption_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/servers\",\"unit\":null}],\"microsoft.dbforpostgresql/serversv2\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/serversv2\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/serversv2\",\"unit\":null}],\"microsoft.dbforpostgresql/singleservers\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/singleservers\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory percent\",\"value\":\"memory_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.dbforpostgresql/singleservers\",\"unit\":null}],\"microsoft.documentdb/databaseaccounts\":[{\"name\":{\"localizedValue\":\"Total Requests\",\"value\":\"TotalRequests\"},\"aggregation\":\"Count\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Provisioned Throughput\",\"value\":\"ProvisionedThroughput\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Normalized RU Consumption\",\"value\":\"NormalizedRUConsumption\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.documentdb/databaseaccounts\",\"unit\":null}],\"microsoft.eventhub/clusters\":[{\"name\":{\"localizedValue\":\"CPU\",\"value\":\"CPU\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Available Memory\",\"value\":\"AvailableMemory\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Errors\",\"value\":\"ServerErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Successful Requests\",\"value\":\"SuccessfulRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"Quota Exceeded Errors\",\"value\":\"QuotaExceededErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null},{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/clusters\",\"unit\":null}],\"microsoft.eventhub/namespaces\":[{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Successful Requests\",\"value\":\"SuccessfulRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Quota Exceeded Errors\",\"value\":\"QuotaExceededErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Errors\",\"value\":\"ServerErrors\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.eventhub/namespaces\",\"unit\":null}],\"microsoft.insights/components\":[{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null},{\"name\":{\"localizedValue\":\"Failed Request\",\"value\":\"requests/failed\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null},{\"name\":{\"localizedValue\":\"Server Requests\",\"value\":\"requests/count\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.insights/components\",\"unit\":null}],\"microsoft.keyvault/vaults\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null},{\"name\":{\"localizedValue\":\"Total Service Api Hits\",\"value\":\"ServiceApiHit\"},\"aggregation\":\"Count\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null},{\"name\":{\"localizedValue\":\"Overall Service Api Latency\",\"value\":\"ServiceApiLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.keyvault/vaults\",\"unit\":null}],\"microsoft.servicebus/namespaces\":[{\"name\":{\"localizedValue\":\"ActiveConnections\",\"value\":\"ActiveConnections\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of active messages in a Queue/Topic\",\"value\":\"ActiveMessages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"CPU\",\"value\":\"NamespaceCpuUsage\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Incoming Messages\",\"value\":\"IncomingMessages\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Incoming Requests\",\"value\":\"IncomingRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of messages in a Queue/Topic\",\"value\":\"Messages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Throttled Requests\",\"value\":\"ThrottledRequests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null},{\"name\":{\"localizedValue\":\"Count of dead-lettered message\",\"value\":\"DeadletteredMessages\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.servicebus/namespaces\",\"unit\":null}],\"microsoft.servicefabricmesh/applications\":[{\"name\":{\"localizedValue\":\"CPU Credits Consumed\",\"value\":\"CPU Credits Consumed\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Read Operations/Sec\",\"value\":\"Disk Read Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Disk Write Operations/Sec\",\"value\":\"Disk Write Operations/Sec\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null},{\"name\":{\"localizedValue\":\"Percentage CPU\",\"value\":\"Percentage CPU\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.compute/virtualmachinescalesets\",\"unit\":null}],\"microsoft.sql/managedinstances\":[{\"name\":{\"localizedValue\":\"Storage space reserved\",\"value\":\"reserved_storage_mb\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO bytes written\",\"value\":\"io_bytes_written\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"Average CPU percentage\",\"value\":\"avg_cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"Storage space used\",\"value\":\"storage_space_used_mb\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null},{\"name\":{\"localizedValue\":\"IO bytes read\",\"value\":\"io_bytes_read\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/managedinstances\",\"unit\":null}],\"microsoft.sql/servers/databases\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null},{\"name\":{\"localizedValue\":\"Connection Failed\",\"value\":\"connection_failed\"},\"aggregation\":\"Maximum\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null},{\"name\":{\"localizedValue\":\"Deadlocks\",\"value\":\"deadlock\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/databases\",\"unit\":null}],\"microsoft.sql/servers/elasticpools\":[{\"name\":{\"localizedValue\":\"CPU percent\",\"value\":\"cpu_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/elasticpools\",\"unit\":null},{\"name\":{\"localizedValue\":\"Data space used percent\",\"value\":\"storage_percent\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.sql/servers/elasticpools\",\"unit\":null}],\"microsoft.storage/storageaccounts\":[{\"name\":{\"localizedValue\":\"Availability\",\"value\":\"Availability\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success E2E Latency\",\"value\":\"SuccessE2ELatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Used Capacity\",\"value\":\"UsedCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null},{\"name\":{\"localizedValue\":\"Success Server Latency\",\"value\":\"SuccessServerLatency\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts\",\"unit\":null}],\"microsoft.storage/storageaccounts/blobservices\":[{\"name\":{\"localizedValue\":\"Blob Container Count\",\"value\":\"ContainerCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Count\",\"value\":\"BlobCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Blob Capacity\",\"value\":\"BlobCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/blobservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/fileservices\":[{\"name\":{\"localizedValue\":\"File Count\",\"value\":\"FileCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"File Capacity\",\"value\":\"FileCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/fileservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/queueservices\":[{\"name\":{\"localizedValue\":\"Queue Count\",\"value\":\"QueueCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Queue Capacity\",\"value\":\"QueueCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/queueservices\",\"unit\":null}],\"microsoft.storage/storageaccounts/tableservices\":[{\"name\":{\"localizedValue\":\"Table Count\",\"value\":\"TableCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Capacity\",\"value\":\"TableCapacity\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Table Entity Count\",\"value\":\"TableEntityCount\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null},{\"name\":{\"localizedValue\":\"Transactions\",\"value\":\"Transactions\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.storage/storageaccounts/tableservices\",\"unit\":null}],\"microsoft.web/serverfarms\":[{\"name\":{\"localizedValue\":\"CPU Percentage\",\"value\":\"CpuPercentage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/serverfarms\",\"unit\":null},{\"name\":{\"localizedValue\":\"Memory Percentage\",\"value\":\"MemoryPercentage\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/serverfarms\",\"unit\":null}],\"microsoft.web/sites\":[{\"name\":{\"localizedValue\":\"Http5xx Error\",\"value\":\"Http5xx\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null},{\"name\":{\"localizedValue\":\"Requests\",\"value\":\"Requests\"},\"aggregation\":\"Total\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null},{\"name\":{\"localizedValue\":\"Response Time\",\"value\":\"HttpResponseTime\"},\"aggregation\":\"Average\",\"displayDescription\":null,\"metricnamespace\":\"microsoft.web/sites\",\"unit\":null}]}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetListOfSupportedResourceTypesForConfiguringServerMetricsTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetListOfSupportedResourceTypesForConfiguringServerMetricsTests.java new file mode 100644 index 000000000000..0e718cc55522 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetListOfSupportedResourceTypesForConfiguringServerMetricsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetListOfSupportedResourceTypesForConfiguringServerMetricsTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetListOfSupportedResourceTypesForConfiguringServerMetricsTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.listSupportedResourceTypeWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"value\":[\"microsoft.cache/redis\",\"microsoft.compute/virtualmachines\",\"microsoft.compute/virtualmachinescalesets\",\"microsoft.containerservice/managedclusters\",\"microsoft.web/sites\",\"microsoft.web/serverfarms\",\"microsoft.insights/components\",\"microsoft.servicefabricmesh/applications\",\"microsoft.web/staticsites\",\"microsoft.network/trafficmanagerprofiles\",\"microsoft.apimanagement/service\",\"microsoft.classicstorage/storageaccounts\",\"microsoft.storage/storageaccounts\",\"microsoft.storage/storageaccounts/fileservices\",\"microsoft.classicstorage/storageaccounts/fileservices\",\"microsoft.storage/storageaccounts/blobservices\",\"microsoft.classicstorage/storageaccounts/blobservices\",\"microsoft.storage/storageaccounts/tableservices\",\"microsoft.classicstorage/storageaccounts/tableservices\",\"microsoft.documentdb/databaseaccounts\",\"microsoft.sql/managedinstances\",\"microsoft.dbformariadb/servers\",\"microsoft.dbforpostgresql/servers\",\"microsoft.dbforpostgresql/serversv2\",\"microsoft.dbformysql/servers\",\"microsoft.sql/servers/databases\",\"microsoft.sql/servers/elasticpools\",\"microsoft.servicebus/namespaces\",\"microsoft.eventhub/namespaces\",\"microsoft.storage/storageaccounts/queueservices\",\"microsoft.classicstorage/storageaccounts/queueservices\",\"microsoft.eventhub/clusters\",\"microsoft.keyvault/vaults\"]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByAnUniqueNameTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByAnUniqueNameTests.java new file mode 100644 index 000000000000..81b2370d9085 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsByAnUniqueNameTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetServerMetricsByAnUniqueNameTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetServerMetricsByAnUniqueNameTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + serverMetricsClient.getWithResponse("edc6e529-d009-4b99-b763-ca492e3a2823", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"edc6e529-d009-4b99-b763-ca492e3a2823\",\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsConfigurationByATestOrTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsConfigurationByATestOrTestRunTests.java new file mode 100644 index 000000000000..197478456c16 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/GetServerMetricsConfigurationByATestOrTestRunTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class GetServerMetricsConfigurationByATestOrTestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testGetServerMetricsConfigurationByATestOrTestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = serverMetricsClient.getByTestOrTestRunWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"name\":\"edc6e529-d009-4b99-b763-ca492e3a2823\",\"metrics\":{\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\":{\"name\":{\"localizedValue\":\"Server Response Time\",\"value\":\"requests/duration\"},\"aggregation\":\"Average\",\"displayDescription\":\"sample description\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration\",\"metricnamespace\":\"microsoft.insights/components\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource\",\"resourceType\":\"microsoft.insights/components\",\"unit\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricDefinitionsForALoadTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricDefinitionsForALoadTestRunTests.java new file mode 100644 index 000000000000..79e04e758507 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricDefinitionsForALoadTestRunTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ListsTheMetricDefinitionsForALoadTestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testListsTheMetricDefinitionsForALoadTestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.metricDefinitionsWithResponse( + "12316678-1234-1234-1234-122451189012", "JMeterLoadTestRunMetrics", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"value\":[{\"name\":{\"localizedValue\":\"Number of virtual users\",\"value\":\"ActiveThreds\"},\"dimensions\":[{\"localizedValue\":\"Sampler Name\",\"value\":\"SamplerName\"},{\"localizedValue\":\"Errors\",\"value\":\"Errors\"}],\"displayDescription\":\"Virtual users\",\"metricAvailabilities\":[{\"timeGrain\":\"PT1M\"},{\"timeGrain\":\"PT5M\"}],\"namespace\":\"JMeterLoadTestRunMetrics\",\"primaryAggregationType\":\"Average\",\"supportedAggregationTypes\":[\"Average\",\"Total\"],\"unit\":\"Count\"}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricMetadataForALoadTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricMetadataForALoadTestRunTests.java new file mode 100644 index 000000000000..97189d3ca3f5 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricMetadataForALoadTestRunTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ListsTheMetricMetadataForALoadTestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testListsTheMetricMetadataForALoadTestRunTests() { + RequestOptions requestOptions = + new RequestOptions().addQueryParam("aggregation", "Average").addQueryParam("interval", "PT1H"); + Response response = + testRunClient.metricsWithResponse( + "12316678-1234-1234-1234-122451189012", + "ActiveThreads", + "JMeterLoadTestRunMetrics", + "Metadata", + "2022-09-24T19:00:40Z/2022-09-25T19:28:40Z", + requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"interval\":\"PT1H\",\"namespace\":\"JMeterLoadTestRunMetrics\",\"timespan\":\"2022-09-24T19:00:40Z/2022-09-25T19:28:40Z\",\"value\":{\"name\":{\"localizedValue\":\"Virtual Users\",\"value\":\"ActiveThreads\"},\"displayDescription\":\"Virtual Users\",\"id\":\"edf1875a-7af2-4c87-be05-02f64010244d/ActiveThreads\",\"timeseries\":[{\"metadatavalues\":[{\"name\":{\"localizedValue\":\"Sampler Name\",\"value\":\"SamplerName\"},\"value\":\"HTTP Request\"},{\"name\":{\"localizedValue\":\"Error code\",\"value\":\"Error\"},\"value\":\"429\"}]}],\"unit\":\"Count\"}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricNamespacesForALoadTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricNamespacesForALoadTestRunTests.java new file mode 100644 index 000000000000..85bfd5df71fa --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricNamespacesForALoadTestRunTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ListsTheMetricNamespacesForALoadTestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testListsTheMetricNamespacesForALoadTestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.metricNamespacesWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"value\":[{\"name\":\"JMeter Load test run metrics\",\"metricNamespaceName\":\"JMeterLoadTestRunMetrics\"}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricValuesForALoadTestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricValuesForALoadTestRunTests.java new file mode 100644 index 000000000000..69d6f4506fc7 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/ListsTheMetricValuesForALoadTestRunTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class ListsTheMetricValuesForALoadTestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testListsTheMetricValuesForALoadTestRunTests() { + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("aggregation", "Average") + .setBody( + BinaryData.fromString( + "{\"filters\":[{\"name\":\"SamplerName\",\"values\":[\"HTTP Request\"]}]}")) + .addQueryParam("interval", "PT1H"); + Response response = + testRunClient.metricsWithResponse( + "12316678-1234-1234-1234-122451189012", + "ActiveThreads", + "JMeterLoadTestRunMetrics", + "Data", + "2022-09-24T19:00:40Z/2022-09-25T19:28:40Z", + requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"interval\":\"PT1H\",\"namespace\":\"JMeterLoadTestRunMetrics\",\"timespan\":\"2022-09-24T19:00:40Z/2022-09-25T19:28:40Z\",\"value\":{\"name\":{\"localizedValue\":\"Virtual Users\",\"value\":\"ActiveThreads\"},\"displayDescription\":\"Virtual Users\",\"id\":\"edf1875a-7af2-4c87-be05-02f64010244d/ActiveThreads\",\"timeseries\":[{\"data\":[{\"average\":null,\"count\":12.790277777777778,\"maximum\":null,\"minimum\":null,\"percentile90\":null,\"percentile95\":null,\"percentile99\":null,\"timeStamp\":\"9/24/2022 7:00:00 PM\",\"total\":null},{\"average\":null,\"count\":21.7725,\"maximum\":null,\"minimum\":null,\"percentile90\":null,\"percentile95\":null,\"percentile99\":null,\"timeStamp\":\"9/24/2022 8:00:00 PM\",\"total\":null},{\"average\":null,\"count\":21.77888888888889,\"maximum\":null,\"minimum\":null,\"percentile90\":null,\"percentile95\":null,\"percentile99\":null,\"timeStamp\":\"9/24/2022 9:00:00 PM\",\"total\":null},{\"average\":null,\"count\":19.93777777777778,\"maximum\":null,\"minimum\":null,\"percentile90\":null,\"percentile95\":null,\"percentile99\":null,\"timeStamp\":\"9/24/2022 10:00:00 PM\",\"total\":null}],\"metadatavalues\":[{\"name\":{\"localizedValue\":\"Sampler Name\",\"value\":\"SamplerName\"},\"value\":\"HTTP Request\"}]}],\"unit\":\"Count\"}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestingClientTestBase.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestingClientTestBase.java new file mode 100644 index 000000000000..ba2562bfcb40 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/LoadTestingClientTestBase.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.util.Configuration; +import com.azure.developer.loadtesting.AppComponentClient; +import com.azure.developer.loadtesting.AppComponentClientBuilder; +import com.azure.developer.loadtesting.ServerMetricsClient; +import com.azure.developer.loadtesting.ServerMetricsClientBuilder; +import com.azure.developer.loadtesting.TestClient; +import com.azure.developer.loadtesting.TestClientBuilder; +import com.azure.developer.loadtesting.TestRunClient; +import com.azure.developer.loadtesting.TestRunClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class LoadTestingClientTestBase extends TestBase { + protected AppComponentClient appComponentClient; + + protected ServerMetricsClient serverMetricsClient; + + protected TestClient testClient; + + protected TestRunClient testRunClient; + + @Override + protected void beforeTest() { + AppComponentClientBuilder appComponentClientbuilder = + new AppComponentClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + appComponentClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + appComponentClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + appComponentClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + appComponentClient = appComponentClientbuilder.buildClient(); + + ServerMetricsClientBuilder serverMetricsClientbuilder = + new ServerMetricsClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + serverMetricsClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + serverMetricsClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + serverMetricsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + serverMetricsClient = serverMetricsClientbuilder.buildClient(); + + TestClientBuilder testClientbuilder = + new TestClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + testClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + testClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + testClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + testClient = testClientbuilder.buildClient(); + + TestRunClientBuilder testRunClientbuilder = + new TestRunClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + testRunClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + testRunClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + testRunClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + testRunClient = testRunClientbuilder.buildClient(); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SearchTestRunsWithFiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SearchTestRunsWithFiltersTests.java new file mode 100644 index 000000000000..06af86c58f20 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SearchTestRunsWithFiltersTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class SearchTestRunsWithFiltersTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testSearchTestRunsWithFiltersTests() { + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("executionFrom", "2021-12-05T16:43:48.805Z") + .addQueryParam("executionTo", "2021-12-05T16:43:48.805Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest_Run1") + .addQueryParam("status", "DONE,EXECUTING"); + PagedIterable response = testRunClient.list(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":18,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":10}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"DONE\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":\"USER_PROPERTIES\",\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":{\"expireTime\":\"2022-05-16T09:14:46.0411793+00:00\",\"fileId\":\"abb846a7-63af-4d63-bb3d-a7aa4caff55c\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"worker.log\",\"url\":\"https://dummyurl.com/logresource\",\"validationStatus\":\"\"},\"resultUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/dummyresourceresult\",\"validationStatus\":\"VALIDATION_SUCCESS\"}}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"PASSED\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":{\"Total\":{\"errorCount\":19,\"errorPct\":17,\"maxResTime\":16,\"meanResTime\":13,\"medianResTime\":10,\"minResTime\":18,\"pct1ResTime\":27,\"pct2ResTime\":20,\"pct3ResTime\":3,\"receivedKBytesPerSec\":13,\"sampleCount\":18,\"sentKBytesPerSec\":4,\"throughput\":5,\"transaction\":\"Total\"}},\"vusers\":4}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SearchTestWithFiltersTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SearchTestWithFiltersTests.java new file mode 100644 index 000000000000..c11ad4cf238a --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/SearchTestWithFiltersTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class SearchTestWithFiltersTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testSearchTestWithFiltersTests() { + RequestOptions requestOptions = + new RequestOptions() + .addQueryParam("continuationToken", "continuation token") + .addQueryParam("lastUpdatedEndTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("lastUpdatedStartTime", "2021-12-05T16:43:46.797Z") + .addQueryParam("maxPageSize", "30") + .addQueryParam("orderBy", "executedDateTime") + .addQueryParam("search", "Performance_LoadTest"); + PagedIterable response = testClient.list(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":\"USER_PROPERTIES\",\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"keyvaultReferenceIdentityId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1\",\"keyvaultReferenceIdentityType\":\"UserAssigned\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"pfmetric1\":{\"action\":\"continue\",\"actualValue\":10,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":\"passed\",\"value\":20}}},\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testId\":\"12345678-1234-1234-1234-123456789012\"}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopATestRunTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopATestRunTests.java new file mode 100644 index 000000000000..dd47935256be --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/StopATestRunTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class StopATestRunTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testStopATestRunTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + testRunClient.stopWithResponse("12316678-1234-1234-1234-122451189012", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"sample description\",\"createdBy\":\"elon-musk@microsoft.com\",\"createdDateTime\":\"2021-12-05T16:43:46.072Z\",\"displayName\":\"Performance_LoadTest_Run1\",\"duration\":null,\"endDateTime\":\"2021-12-05T16:43:48.125Z\",\"environmentVariables\":{\"envvar1\":\"sampletext\"},\"executedDateTime\":\"2021-12-05T16:43:48.125Z\",\"lastModifiedBy\":\"elon-musk@microsoft.com\",\"lastModifiedDateTime\":\"2021-12-05T16:43:46.072Z\",\"loadTestConfig\":{\"engineInstances\":6,\"splitAllCSVs\":true},\"passFailCriteria\":{\"passFailMetrics\":{\"pfmetric1\":{\"action\":\"continue\",\"actualValue\":0,\"aggregate\":\"percentage\",\"clientmetric\":\"response_time_ms\",\"condition\":\">\",\"result\":null,\"value\":20}}},\"portalUrl\":\"https://portal.azure.com/dummyresource\",\"resourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename\",\"secrets\":{\"secret1\":{\"type\":\"AKV_SECRET_URI\",\"value\":\"https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827\"}},\"startDateTime\":\"2021-12-05T16:43:48.125Z\",\"status\":\"CANCELLING\",\"subnetId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0\",\"testArtifacts\":{\"inputArtifacts\":{\"additionalUrls\":[],\"configUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"config.yaml\",\"url\":\"https://dummyurl.com/configresource\",\"validationStatus\":\"\"},\"inputArtifactsZipFileurl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789012\",\"fileType\":\"ADDITIONAL_ARTIFACTS\",\"filename\":\"inputartifacts.zip\",\"url\":\"https://dummyurl.com/inputartifactzipresource\",\"validationStatus\":\"\"},\"testScriptUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789011\",\"fileType\":\"JMX_FILE\",\"filename\":\"sample.jmx\",\"url\":\"https://dummyurl.com/testscriptresource\",\"validationStatus\":\"VALIDATION_SUCCESS\"},\"userPropUrl\":{\"expireTime\":\"2021-12-05T16:43:46.072Z\",\"fileId\":\"92345678-1234-1111-1234-123456789013\",\"fileType\":\"USER_PROPERTIES\",\"filename\":\"user.properties\",\"url\":\"https://dummyurl.com/userpropresource\",\"validationStatus\":\"\"}},\"outputArtifacts\":{\"logsUrl\":null,\"resultUrl\":null}},\"testId\":\"12345678-1234-1234-1234-123456789012\",\"testResult\":\"NOT_APPLICABLE\",\"testRunId\":\"12316678-1234-1234-1234-122451189012\",\"testRunStatistics\":null,\"vusers\":null}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadATestFileTests.java b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadATestFileTests.java new file mode 100644 index 000000000000..cefa8de59d03 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/generated/UploadATestFileTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.developer.loadtesting.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class UploadATestFileTests extends LoadTestingClientTestBase { + @Test + @Disabled + public void testUploadATestFileTests() { + BinaryData file = BinaryData.fromString("\"multipart-form-data\""); + RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "ADDITIONAL_ARTIFACTS"); + Response response = + testClient.uploadFileWithResponse( + "12345678-1234-1234-1234-123456789012", + "92345678-1234-1111-1234-123456789012", + file, + requestOptions); + Assertions.assertEquals(201, response.getStatusCode()); + } +} diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md new file mode 100644 index 000000000000..2033008fcd26 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -0,0 +1,17 @@ +## Generate autorest code + +```yaml +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/loadtestservice/data-plane/readme.md +output-folder: ../ +java: true +regenerate-pom: false +title: LoadTestingClient +security: AADToken +security-scopes: https://loadtest.azure-dev.com/.default +data-plane: true +generate-tests: true +generate-samples: true +namespace: com.azure.developer.loadtesting +service-versions: +- '2022-11-01' +``` diff --git a/sdk/loadtestservice/ci.yml b/sdk/loadtestservice/ci.yml index f7709c4f9d6e..ec330d59b6ca 100644 --- a/sdk/loadtestservice/ci.yml +++ b/sdk/loadtestservice/ci.yml @@ -38,3 +38,6 @@ extends: - name: azure-resourcemanager-loadtestservice groupId: com.azure.resourcemanager safeName: azureresourcemanagerloadtestservice + - name: azure-developer-loadtesting + groupId: com.azure + safeName: azuredeveloperloadtesting diff --git a/sdk/loadtestservice/pom.xml b/sdk/loadtestservice/pom.xml index 01ce9807f535..a29aa2a98337 100644 --- a/sdk/loadtestservice/pom.xml +++ b/sdk/loadtestservice/pom.xml @@ -10,6 +10,7 @@ 1.0.0 - azure-resourcemanager-loadtestservice + azure-developer-loadtesting + azure-resourcemanager-loadtestservice