diff --git a/sdk/loadtestservice/azure-developer-loadtesting/_meta.json b/sdk/loadtestservice/azure-developer-loadtesting/_meta.json new file mode 100644 index 000000000000..1b70694084f8 --- /dev/null +++ b/sdk/loadtestservice/azure-developer-loadtesting/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "9b4365f3dac7e48df969752be43cad87ae35a26b", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest": "3.9.2", + "use": [ + "@autorest/python@6.1.11", + "@autorest/modelerfour@4.24.3" + ], + "autorest_command": "autorest README.md --use=@autorest/python@6.1.11 --use=@autorest/modelerfour@4.24.3 --version=3.9.2", + "readme": "specification/loadtestservice/data-plane/readme.md" +} \ No newline at end of file diff --git a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_client.py b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_client.py index 676075e18dab..7b7430f7ae1f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_client.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_client.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core import PipelineClient from azure.core.rest import HttpRequest, HttpResponse @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials import TokenCredential @@ -38,14 +36,20 @@ class LoadTestingClient: # pylint: disable=client-accepts-api-version-keyword :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :param test_id: Unique name of an existing load test. Default value is None. + :type test_id: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: + def __init__( + self, endpoint: str, credential: "TokenCredential", test_id: Optional[str] = None, **kwargs: Any + ) -> None: _endpoint = "https://{Endpoint}" - self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + self._config = LoadTestingClientConfiguration( + endpoint=endpoint, credential=credential, test_id=test_id, **kwargs + ) self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs) self._serialize = Serializer() diff --git a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_configuration.py b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_configuration.py index b2f16c2f9d6a..ba0f63b8273f 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_configuration.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -28,14 +28,18 @@ class LoadTestingClientConfiguration(Configuration): # pylint: disable=too-many :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :param test_id: Unique name of an existing load test. Default value is None. + :type test_id: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: + def __init__( + self, endpoint: str, credential: "TokenCredential", test_id: Optional[str] = None, **kwargs: Any + ) -> None: super(LoadTestingClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-06-01-preview") # type: str + api_version = kwargs.pop("api_version", "2022-11-01") # type: str if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") @@ -44,6 +48,7 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) self.endpoint = endpoint self.credential = credential + self.test_id = test_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://loadtest.azure-dev.com/.default"]) kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION)) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_serialization.py b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_serialization.py index 648f84cc4e65..7c1dedb5133d 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_serialization.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/_serialization.py @@ -1505,7 +1505,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): try: return self(target_obj, data, content_type=content_type) except: - _LOGGER.warning( + _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None diff --git a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_client.py b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_client.py index 8f4d04365a6f..8f91d15e3116 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_client.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_client.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING from azure.core import AsyncPipelineClient from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -18,8 +18,6 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Dict - from azure.core.credentials_async import AsyncTokenCredential @@ -38,14 +36,20 @@ class LoadTestingClient: # pylint: disable=client-accepts-api-version-keyword :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :param test_id: Unique name of an existing load test. Default value is None. + :type test_id: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + def __init__( + self, endpoint: str, credential: "AsyncTokenCredential", test_id: Optional[str] = None, **kwargs: Any + ) -> None: _endpoint = "https://{Endpoint}" - self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + self._config = LoadTestingClientConfiguration( + endpoint=endpoint, credential=credential, test_id=test_id, **kwargs + ) self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs) self._serialize = Serializer() diff --git a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_configuration.py b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_configuration.py index dab13661a1c0..2227e29629ea 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_configuration.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/_configuration.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -28,14 +28,18 @@ class LoadTestingClientConfiguration(Configuration): # pylint: disable=too-many :type endpoint: str :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :param test_id: Unique name of an existing load test. Default value is None. + :type test_id: str + :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + def __init__( + self, endpoint: str, credential: "AsyncTokenCredential", test_id: Optional[str] = None, **kwargs: Any + ) -> None: super(LoadTestingClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-06-01-preview") # type: str + api_version = kwargs.pop("api_version", "2022-11-01") # type: str if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") @@ -44,6 +48,7 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: self.endpoint = endpoint self.credential = credential + self.test_id = test_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://loadtest.azure-dev.com/.default"]) kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION)) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/operations/_operations.py b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/operations/_operations.py index 8b45a4badcdf..0cd287b5a228 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/operations/_operations.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/aio/operations/_operations.py @@ -8,47 +8,52 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from ...operations._operations import ( - build_app_component_create_or_update_app_components_request, - build_app_component_delete_app_components_request, - build_app_component_get_app_component_by_name_request, - build_app_component_get_app_component_request, - build_server_metrics_create_or_update_server_metrics_config_request, - build_server_metrics_delete_server_metrics_config_request, - build_server_metrics_get_server_default_metrics_config_request, - build_server_metrics_get_server_metrics_config_by_name_request, - build_server_metrics_get_server_metrics_config_request, - build_server_metrics_list_supported_resource_types_request, - build_test_create_or_update_test_request, - build_test_delete_load_test_request, - build_test_delete_test_file_request, - build_test_get_load_test_request, - build_test_get_test_file_request, - build_test_list_load_test_search_request, - build_test_list_test_files_request, - build_test_run_create_or_update_test_request, - build_test_run_delete_test_run_request, - build_test_run_get_test_run_client_metrics_filters_request, - build_test_run_get_test_run_client_metrics_request, - build_test_run_get_test_run_file_request, - build_test_run_get_test_run_request, - build_test_run_list_test_runs_request, - build_test_run_stop_test_run_request, + build_app_component_create_or_update_request, + build_app_component_delete_request, + build_app_component_get_by_test_or_test_run_request, + build_app_component_get_request, + build_server_metrics_create_or_update_request, + build_server_metrics_delete_request, + build_server_metrics_get_by_test_or_test_run_request, + build_server_metrics_get_default_metrics_request, + build_server_metrics_get_request, + build_server_metrics_list_supported_resource_type_request, + build_test_create_or_update_request, + build_test_delete_file_request, + build_test_delete_request, + build_test_get_all_files_request, + build_test_get_file_request, + build_test_get_request, + build_test_list_request, + build_test_run_create_or_update_request, + build_test_run_delete_request, + build_test_run_get_file_request, + build_test_run_get_request, + build_test_run_list_request, + build_test_run_metric_definitions_request, + build_test_run_metric_namespaces_request, + build_test_run_metrics_request, + build_test_run_stop_request, ) from .._vendor import raise_if_not_implemented @@ -79,15 +84,15 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def create_or_update_app_components( + async def create_or_update( self, name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Associate an App Component (Azure resource) to a test or test run. + """Associate an app component (Azure resource) to a test or test run. - Associate an App Component (Azure resource) to a test or test run. + Associate an app component (Azure resource) to a test or test run. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :param body: App Component model. Required. :type body: JSON @@ -105,16 +110,18 @@ async def create_or_update_app_components( body = { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -122,25 +129,27 @@ async def create_or_update_app_components( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } # response body for status code(s): 200, 201 response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -148,22 +157,22 @@ async def create_or_update_app_components( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ @overload - async def create_or_update_app_components( + async def create_or_update( self, name: str, body: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Associate an App Component (Azure resource) to a test or test run. + """Associate an app component (Azure resource) to a test or test run. - Associate an App Component (Azure resource) to a test or test run. + Associate an app component (Azure resource) to a test or test run. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :param body: App Component model. Required. :type body: IO @@ -181,16 +190,18 @@ async def create_or_update_app_components( response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -198,20 +209,20 @@ async def create_or_update_app_components( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ @distributed_trace_async - async def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Associate an App Component (Azure resource) to a test or test run. + async def create_or_update(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + """Associate an app component (Azure resource) to a test or test run. - Associate an App Component (Azure resource) to a test or test run. + Associate an app component (Azure resource) to a test or test run. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :param body: App Component model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -229,16 +240,18 @@ async def create_or_update_app_components(self, name: str, body: Union[JSON, IO] response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -246,12 +259,17 @@ async def create_or_update_app_components(self, name: str, body: Union[JSON, IO] "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -268,7 +286,7 @@ async def create_or_update_app_components(self, name: str, body: Union[JSON, IO] else: _json = body - request = build_app_component_create_or_update_app_components_request( + request = build_app_component_create_or_update_request( name=name, content_type=content_type, api_version=self._config.api_version, @@ -310,21 +328,24 @@ async def create_or_update_app_components(self, name: str, body: Union[JSON, IO] return cast(JSON, deserialized) @distributed_trace_async - async def delete_app_components( # pylint: disable=inconsistent-return-statements - self, name: str, **kwargs: Any - ) -> None: - """Delete an App Component. + async def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete an app component. - Delete an App Component. + Delete an app component. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -332,7 +353,7 @@ async def delete_app_components( # pylint: disable=inconsistent-return-statemen cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_app_component_delete_app_components_request( + request = build_app_component_delete_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -357,13 +378,13 @@ async def delete_app_components( # pylint: disable=inconsistent-return-statemen return cls(pipeline_response, None, {}) @distributed_trace_async - async def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: - """Get App Component details by App Component name. + async def get(self, name: str, **kwargs: Any) -> JSON: + """Get app Component details by unique name. - Get App Component details by App Component name. + Get app Component details by unique name. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :return: JSON object :rtype: JSON @@ -376,16 +397,18 @@ async def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -393,12 +416,17 @@ async def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -406,7 +434,7 @@ async def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_app_component_get_app_component_by_name_request( + request = build_app_component_get_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -438,18 +466,14 @@ async def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace_async - async def get_app_component( - self, *, test_run_id: Optional[str] = None, test_id: Optional[str] = None, **kwargs: Any - ) -> JSON: - """Get App Components for a test or a test run by its name. + async def get_by_test_or_test_run(self, *, test_run_id: Optional[str] = None, **kwargs: Any) -> JSON: + """Get an app component for a test or a test run by its name. - Get App Components for a test or a test run by its name. + Get an app component for a test or a test run by its name. - :keyword test_run_id: [Required, if testId is not provided] Test run Id. Default value is None. + :keyword test_run_id: Required testRunId, if testId field is not provided. Default value is + None. :paramtype test_run_id: str - :keyword test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Default value is None. - :paramtype test_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -461,16 +485,18 @@ async def get_app_component( response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -478,12 +504,17 @@ async def get_app_component( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -491,9 +522,9 @@ async def get_app_component( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_app_component_get_app_component_request( + request = build_app_component_get_by_test_or_test_run_request( test_run_id=test_run_id, - test_id=test_id, + test_id=self._config.test_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -542,15 +573,15 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - async def create_or_update_server_metrics_config( + async def create_or_update( self, name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: """Configure server metrics for a test or test run. Configure server metrics for a test or test run. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :param body: Server metrics configuration model. Required. :type body: JSON @@ -571,22 +602,22 @@ async def create_or_update_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } # response body for status code(s): 200, 201 @@ -596,35 +627,35 @@ async def create_or_update_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ @overload - async def create_or_update_server_metrics_config( + async def create_or_update( self, name: str, body: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: """Configure server metrics for a test or test run. Configure server metrics for a test or test run. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :param body: Server metrics configuration model. Required. :type body: IO @@ -645,33 +676,33 @@ async def create_or_update_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ @distributed_trace_async - async def create_or_update_server_metrics_config(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + async def create_or_update(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: """Configure server metrics for a test or test run. Configure server metrics for a test or test run. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :param body: Server metrics configuration model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -692,25 +723,30 @@ async def create_or_update_server_metrics_config(self, name: str, body: Union[JS "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -727,7 +763,7 @@ async def create_or_update_server_metrics_config(self, name: str, body: Union[JS else: _json = body - request = build_server_metrics_create_or_update_server_metrics_config_request( + request = build_server_metrics_create_or_update_request( name=name, content_type=content_type, api_version=self._config.api_version, @@ -769,13 +805,13 @@ async def create_or_update_server_metrics_config(self, name: str, body: Union[JS return cast(JSON, deserialized) @distributed_trace_async - async def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> JSON: + async def get(self, name: str, **kwargs: Any) -> JSON: """Get server metrics configuration by its name. Get server metrics configuration by its name. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :return: JSON object :rtype: JSON @@ -791,25 +827,30 @@ async def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> J "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -817,7 +858,7 @@ async def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> J cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_get_server_metrics_config_by_name_request( + request = build_server_metrics_get_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -849,21 +890,24 @@ async def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> J return cast(JSON, deserialized) @distributed_trace_async - async def delete_server_metrics_config( # pylint: disable=inconsistent-return-statements - self, name: str, **kwargs: Any - ) -> None: + async def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete server metrics configuration by its name. Delete server metrics configuration by its name. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -871,7 +915,7 @@ async def delete_server_metrics_config( # pylint: disable=inconsistent-return-s cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_server_metrics_delete_server_metrics_config_request( + request = build_server_metrics_delete_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -896,18 +940,14 @@ async def delete_server_metrics_config( # pylint: disable=inconsistent-return-s return cls(pipeline_response, None, {}) @distributed_trace_async - async def get_server_metrics_config( - self, *, test_run_id: Optional[str] = None, test_id: Optional[str] = None, **kwargs: Any - ) -> JSON: + async def get_by_test_or_test_run(self, *, test_run_id: Optional[str] = None, **kwargs: Any) -> JSON: """Get server metrics configuration for a test or test run by its name. Get server metrics configuration for a test or test run by its name. - :keyword test_run_id: [Required, if testId is not provided] Test run Id. Default value is None. + :keyword test_run_id: Required testRunId, if testId field is not provided. Default value is + None. :paramtype test_run_id: str - :keyword test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Default value is None. - :paramtype test_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -922,25 +962,30 @@ async def get_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -948,9 +993,9 @@ async def get_server_metrics_config( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_get_server_metrics_config_request( + request = build_server_metrics_get_by_test_or_test_run_request( test_run_id=test_run_id, - test_id=test_id, + test_id=self._config.test_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -981,7 +1026,7 @@ async def get_server_metrics_config( return cast(JSON, deserialized) @distributed_trace_async - async def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: + async def get_default_metrics(self, **kwargs: Any) -> JSON: """Get all default server metrics configuration for supported resource types. Get all default server metrics configuration for supported resource types. @@ -998,37 +1043,30 @@ async def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: "defaultMetrics": { "str": [ { - "aggregation": "str", # Optional. Default metrics - map {resourceType : list of metrics config} (Refer for metrics - structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - "displayDescription": "str", # Optional. Default - metrics map {resourceType : list of metrics config} (Refer for - metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - "metricnamespace": "str", # Optional. Default - metrics map {resourceType : list of metrics config} (Refer for - metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + "aggregation": "str", # Optional. Metric + aggregation. + "displayDescription": "str", # Optional. Metric + display description. + "metricnamespace": "str", # Optional. Metric + namespace. "name": { - "localizedValue": "str", # Optional. Default - metrics map {resourceType : list of metrics config} (Refer for - metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - "value": "str" # Optional. Default metrics - map {resourceType : list of metrics config} (Refer for metrics - structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + "localizedValue": "str", # Optional. The + locale specific value. + "value": "str" # Optional. The invariant + value. }, - "unit": "str" # Optional. Default metrics map - {resourceType : list of metrics config} (Refer for metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + "unit": "str" # Optional. Metric unit. } ] } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1036,7 +1074,7 @@ async def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_get_server_default_metrics_config_request( + request = build_server_metrics_get_default_metrics_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -1067,10 +1105,10 @@ async def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace_async - async def list_supported_resource_types(self, **kwargs: Any) -> JSON: - """Get all supported resource types for App Components(Azure resource types). + async def list_supported_resource_type(self, **kwargs: Any) -> JSON: + """Get all supported resource types for adding an app component(Azure resource types). - Get all supported resource types for App Components(Azure resource types). + Get all supported resource types for adding an app component(Azure resource types). :return: JSON object :rtype: JSON @@ -1086,7 +1124,12 @@ async def list_supported_resource_types(self, **kwargs: Any) -> JSON: ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1094,7 +1137,7 @@ async def list_supported_resource_types(self, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_list_supported_resource_types_request( + request = build_server_metrics_list_supported_resource_type_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -1144,20 +1187,20 @@ def __init__(self, *args, **kwargs) -> None: raise_if_not_implemented( self.__class__, [ - "upload_test_file", + "upload_file", ], ) @overload - async def create_or_update_test( + async def create_or_update( self, test_id: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Create a new test or Update an existing test. + """Create a new test or update an existing test. - Create a new test or Update an existing test. + Create a new test or update an existing test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :param body: Load test model. Required. :type body: JSON @@ -1173,6 +1216,12 @@ async def create_or_update_test( # JSON input template you can fill out and use as your body input. body = { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -1188,62 +1237,64 @@ async def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -1258,36 +1309,43 @@ async def create_or_update_test( "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -1298,10 +1356,10 @@ async def create_or_update_test( /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -1311,6 +1369,12 @@ async def create_or_update_test( # response body for status code(s): 200, 201 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -1326,62 +1390,64 @@ async def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -1396,36 +1462,43 @@ async def create_or_update_test( "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -1436,10 +1509,10 @@ async def create_or_update_test( /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -1449,15 +1522,15 @@ async def create_or_update_test( """ @overload - async def create_or_update_test( + async def create_or_update( self, test_id: str, body: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Create a new test or Update an existing test. + """Create a new test or update an existing test. - Create a new test or Update an existing test. + Create a new test or update an existing test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :param body: Load test model. Required. :type body: IO @@ -1473,6 +1546,12 @@ async def create_or_update_test( # response body for status code(s): 200, 201 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -1488,62 +1567,64 @@ async def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -1558,36 +1639,43 @@ async def create_or_update_test( "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -1598,10 +1686,10 @@ async def create_or_update_test( /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -1611,13 +1699,13 @@ async def create_or_update_test( """ @distributed_trace_async - async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Create a new test or Update an existing test. + async def create_or_update(self, test_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + """Create a new test or update an existing test. - Create a new test or Update an existing test. + Create a new test or update an existing test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :param body: Load test model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -1633,6 +1721,12 @@ async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwa # response body for status code(s): 200, 201 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -1648,62 +1742,64 @@ async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwa "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -1718,36 +1814,43 @@ async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwa "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -1758,10 +1861,10 @@ async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwa /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -1769,7 +1872,12 @@ async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwa "testId": "str" # Optional. Unique test name as identifier. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1786,7 +1894,7 @@ async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwa else: _json = body - request = build_test_create_or_update_test_request( + request = build_test_create_or_update_request( test_id=test_id, content_type=content_type, api_version=self._config.api_version, @@ -1828,21 +1936,24 @@ async def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwa return cast(JSON, deserialized) @distributed_trace_async - async def delete_load_test( # pylint: disable=inconsistent-return-statements - self, test_id: str, **kwargs: Any - ) -> None: + async def delete(self, test_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a test by its name. Delete a test by its name. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1850,7 +1961,7 @@ async def delete_load_test( # pylint: disable=inconsistent-return-statements cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_test_delete_load_test_request( + request = build_test_delete_request( test_id=test_id, api_version=self._config.api_version, headers=_headers, @@ -1875,13 +1986,13 @@ async def delete_load_test( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) @distributed_trace_async - async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: + async def get(self, test_id: str, **kwargs: Any) -> JSON: """Get load test details by test name. Get load test details by test name. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :return: JSON object :rtype: JSON @@ -1892,6 +2003,12 @@ async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -1907,62 +2024,64 @@ async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -1977,36 +2096,43 @@ async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -2017,10 +2143,10 @@ async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -2028,7 +2154,12 @@ async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: "testId": "str" # Optional. Unique test name as identifier. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2036,7 +2167,7 @@ async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_get_load_test_request( + request = build_test_get_request( test_id=test_id, api_version=self._config.api_version, headers=_headers, @@ -2067,8 +2198,8 @@ async def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) - @distributed_trace_async - async def list_load_test_search( + @distributed_trace + def list( self, *, order_by: Optional[str] = None, @@ -2076,9 +2207,8 @@ async def list_load_test_search( last_updated_start_time: Optional[datetime.datetime] = None, last_updated_end_time: Optional[datetime.datetime] = None, continuation_token_parameter: Optional[str] = None, - max_page_size: int = 50, **kwargs: Any - ) -> JSON: + ) -> AsyncIterable[JSON]: """Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. @@ -2100,10 +2230,8 @@ async def list_load_test_search( :keyword continuation_token_parameter: Continuation token to get the next page of response. Default value is None. :paramtype continuation_token_parameter: str - :keyword max_page_size: Number of results in response. Default value is 50. - :paramtype max_page_size: int - :return: JSON object - :rtype: JSON + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: Example: @@ -2111,223 +2239,246 @@ async def list_load_test_search( # response body for status code(s): 200 response == { - "value": [ - { - "createdBy": "str", # Optional. The user that created the - test model. - "createdDateTime": "2020-02-20 00:00:00", # Optional. The - created DateTime(ISO 8601 literal format) of the test model. - "description": "str", # Optional. The test description. - "displayName": "str", # Optional. Display name of a test. - "environmentVariables": { - "str": "str" # Optional. Environment variables which - are defined as a set of pairs. - }, - "inputArtifacts": { - "additionalUrls": [ - { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - ], - "configUrl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - }, - "inputArtifactsZipFileurl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - }, - "testScriptUrl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - }, - "userPropUrl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - } - }, - "keyvaultReferenceIdentityId": "str", # Optional. Resource - Id of the managed identity referencing the Key vault. - "keyvaultReferenceIdentityType": "str", # Optional. Type of - the managed identity referencing the Key vault. - "lastModifiedBy": "str", # Optional. The user that last - modified the test model. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. - The last Modified DateTime(ISO 8601 literal format) of the test model. - "loadTestConfig": { - "engineInstances": 0, # Optional. The number of - engine instances to execute load test. Supported values are in range - of 1-45. Required for creating a new test. - "splitAllCSVs": bool # Optional. Whether all the - input CSV files should be split evenly across all engines. - }, - "passFailCriteria": { - "passFailMetrics": { - "str": { - "action": "str", # Optional. Either - "u2018stop"u2019 or "u2018continue"u2019 after the threshold - is met. Default is "u2018continue"u2019. - "actualValue": 0.0, # Optional. The - actual value of the client metric for the test run. - "aggregate": "str", # Optional. The - aggregation function to be applied on the client metric. - Allowed functions - "u2018percentage"u2019 - for error metric - ,"u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, - "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, - "u2018max"u2019 - for response_time_ms and latency metric, - "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. - "clientmetric": "str", # Optional. - The client metric on which the criteria should be applied. - Allowed values - "u2018response_time_ms"u2019 , - "u2018latency"u2019, "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. - "condition": "str", # Optional. The - comparison operator. Supported types "u2018>"u2019. - "requestName": "str", # Optional. - Request name for which the Pass fail criteria has to be - applied. - "result": "str", # Optional. Outcome - of the test run. possible outcome - "u2018passed"u2019 , - "u2018failed"u2019 , "u2018undetermined"u2019. - "value": 0.0 # Optional. The value - to compare with the client metric. Allowed values - - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms - and latency : any integer value unit- ms. - } - } - }, - "resourceId": "str", # Optional. Fully qualified resource Id - e.g - /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - "secrets": { - "str": { - "type": "str", # Optional. Type of secret. - eg. AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the - secret, of type AKV_SECRET_URI or SECRET_VALUE. - } - }, - "subnetId": "str", # Optional. Subnet ID on which the load - test instances should run. - "testId": "str" # Optional. Unique test name as identifier. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. + "createdDateTime": "2020-02-20 00:00:00", # Optional. The created + DateTime(ISO 8601 literal format) of the test model. + "description": "str", # Optional. The test description. + "displayName": "str", # Optional. Display name of a test. + "environmentVariables": { + "str": "str" # Optional. Environment variables which are defined as + a set of pairs. + }, + "inputArtifacts": { + "additionalUrls": [ + { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + } + ], + "configUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". + }, + "inputArtifactsZipFileurl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". + }, + "testScriptUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". + }, + "userPropUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } - ], - "nextLink": "str" # Optional. Link for the next list of resources in case of - paginated results, if applicable. + }, + "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed + identity referencing the Key vault. + "keyvaultReferenceIdentityType": "str", # Optional. Type of the managed + identity referencing the Key vault. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. + "loadTestConfig": { + "engineInstances": 0, # Optional. The number of engine instances to + execute load test. Supported values are in range of 1-45. Required for + creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. + "splitAllCSVs": bool # Optional. Whether all the input CSV files + should be split evenly across all engines. + }, + "passFailCriteria": { + "passFailMetrics": { + "str": { + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". + "actualValue": 0.0, # Optional. The actual value of + the client metric for the test run. + "aggregate": "str", # Optional. The aggregation + function to be applied on the client metric. Allowed functions - + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, + "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, + "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency + metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". + "clientmetric": "str", # Optional. The client metric + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". + "condition": "str", # Optional. The comparison + operator. Supported types "u2018>"u2019, "u2018<"u2019. + "requestName": "str", # Optional. Request name for + which the Pass fail criteria has to be applied. + "result": "str", # Optional. Outcome of the test + run. Known values are: "passed", "undetermined", and "failed". + "value": 0.0 # Optional. The value to compare with + the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- + % "u2019, response_time_ms and latency : any integer value unit- ms. + } + } + }, + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + "secrets": { + "str": { + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. + } + }, + "subnetId": "str", # Optional. Subnet ID on which the load test instances + should run. + "testId": "str" # Optional. Unique test name as identifier. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_list_load_test_search_request( - order_by=order_by, - search=search, - last_updated_start_time=last_updated_start_time, - last_updated_end_time=last_updated_end_time, - continuation_token_parameter=continuation_token_parameter, - max_page_size=max_page_size, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + error_map.update(kwargs.pop("error_map", {}) or {}) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) + def prepare_request(next_link=None): + if not next_link: + + request = build_test_list_request( + order_by=order_by, + search=search, + last_updated_start_time=last_updated_start_time, + last_updated_end_time=last_updated_end_time, + continuation_token_parameter=continuation_token_parameter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - response = pipeline_response.http_response + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return request - if response.content: - deserialized = response.json() - else: - deserialized = None + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), AsyncList(list_of_elem) - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) + async def get_next(next_link=None): + request = prepare_request(next_link) - return cast(JSON, deserialized) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON: + async def get_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON: """Get test file by the file name. Get test file by the file name. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str - :param file_id: Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param file_id: Unique name for test file, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type file_id: str :return: JSON object :rtype: JSON @@ -2340,15 +2491,21 @@ async def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON response == { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the file type (0 = - JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, 1, - and 2. + "fileType": "str", # Optional. File type. Known values are: "JMX_FILE", + "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. Validation status of the file. + "validationStatus": "str" # Optional. Validation status of the file. Known + values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2356,7 +2513,7 @@ async def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_get_test_file_request( + request = build_test_get_file_request( test_id=test_id, file_id=file_id, api_version=self._config.api_version, @@ -2389,24 +2546,29 @@ async def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON return cast(JSON, deserialized) @distributed_trace_async - async def delete_test_file( # pylint: disable=inconsistent-return-statements + async def delete_file( # pylint: disable=inconsistent-return-statements self, test_id: str, file_id: str, **kwargs: Any ) -> None: """Delete file by the file name for a test. Delete file by the file name for a test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str - :param file_id: Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param file_id: Unique name for test file, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type file_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2414,7 +2576,7 @@ async def delete_test_file( # pylint: disable=inconsistent-return-statements cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_test_delete_test_file_request( + request = build_test_delete_file_request( test_id=test_id, file_id=file_id, api_version=self._config.api_version, @@ -2439,22 +2601,22 @@ async def delete_test_file( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - @distributed_trace_async - async def list_test_files( + @distributed_trace + def get_all_files( self, test_id: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any - ) -> JSON: + ) -> AsyncIterable[JSON]: """Get all test files. Get all test files. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :keyword continuation_token_parameter: Continuation token to get the next page of response. Default value is None. :paramtype continuation_token_parameter: str - :return: JSON object - :rtype: JSON + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: Example: @@ -2462,63 +2624,91 @@ async def list_test_files( # response body for status code(s): 200 response == { - "value": [ - { - "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time - of the file. - "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. - "filename": "str", # Optional. Name of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. Validation status of - the file. - } - ], - "nextLink": "str" # Optional. Link for the next list of file URLs, if - applicable. + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: "JMX_FILE", + "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of the file. Known + values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_list_test_files_request( - test_id=test_id, - continuation_token_parameter=continuation_token_parameter, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + error_map.update(kwargs.pop("error_map", {}) or {}) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) + def prepare_request(next_link=None): + if not next_link: + + request = build_test_get_all_files_request( + test_id=test_id, + continuation_token_parameter=continuation_token_parameter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - response = pipeline_response.http_response + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return request - if response.content: - deserialized = response.json() - else: - deserialized = None + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), AsyncList(list_of_elem) - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) + async def get_next(next_link=None): + request = prepare_request(next_link) - return cast(JSON, deserialized) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) class TestRunOperations: @@ -2539,21 +2729,24 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def delete_test_run( # pylint: disable=inconsistent-return-statements - self, test_run_id: str, **kwargs: Any - ) -> None: + async def delete(self, test_run_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a test run by its name. Delete a test run by its name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2561,7 +2754,7 @@ async def delete_test_run( # pylint: disable=inconsistent-return-statements cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_test_run_delete_test_run_request( + request = build_test_run_delete_request( test_run_id=test_run_id, api_version=self._config.api_version, headers=_headers, @@ -2586,7 +2779,7 @@ async def delete_test_run( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) @overload - async def create_or_update_test( + async def create_or_update( self, test_run_id: str, body: JSON, @@ -2599,8 +2792,8 @@ async def create_or_update_test( Create and start a new test run with the given name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :param body: Load test run model. Required. :type body: JSON @@ -2618,11 +2811,17 @@ async def create_or_update_test( # JSON input template you can fill out and use as your body input. body = { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -2630,45 +2829,59 @@ async def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -2676,18 +2889,23 @@ async def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -2698,64 +2916,73 @@ async def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -2763,32 +2990,35 @@ async def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -2804,7 +3034,7 @@ async def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -2815,11 +3045,17 @@ async def create_or_update_test( # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -2827,45 +3063,59 @@ async def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -2873,18 +3123,23 @@ async def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -2895,64 +3150,73 @@ async def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -2960,32 +3224,35 @@ async def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -3001,7 +3268,7 @@ async def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -3012,7 +3279,7 @@ async def create_or_update_test( """ @overload - async def create_or_update_test( + async def create_or_update( self, test_run_id: str, body: IO, @@ -3025,8 +3292,8 @@ async def create_or_update_test( Create and start a new test run with the given name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :param body: Load test run model. Required. :type body: IO @@ -3044,11 +3311,17 @@ async def create_or_update_test( # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -3056,45 +3329,59 @@ async def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -3102,18 +3389,23 @@ async def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -3124,64 +3416,73 @@ async def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -3189,32 +3490,35 @@ async def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -3230,7 +3534,7 @@ async def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -3241,15 +3545,15 @@ async def create_or_update_test( """ @distributed_trace_async - async def create_or_update_test( + async def create_or_update( self, test_run_id: str, body: Union[JSON, IO], *, old_test_run_id: Optional[str] = None, **kwargs: Any ) -> JSON: """Create and start a new test run with the given name. Create and start a new test run with the given name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :param body: Load test run model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -3267,11 +3571,17 @@ async def create_or_update_test( # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -3279,45 +3589,59 @@ async def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -3325,18 +3649,23 @@ async def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -3347,64 +3676,73 @@ async def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -3412,32 +3750,35 @@ async def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -3453,7 +3794,7 @@ async def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -3462,7 +3803,12 @@ async def create_or_update_test( run. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3479,7 +3825,7 @@ async def create_or_update_test( else: _json = body - request = build_test_run_create_or_update_test_request( + request = build_test_run_create_or_update_request( test_run_id=test_run_id, old_test_run_id=old_test_run_id, content_type=content_type, @@ -3515,13 +3861,13 @@ async def create_or_update_test( return cast(JSON, deserialized) @distributed_trace_async - async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: + async def get(self, test_run_id: str, **kwargs: Any) -> JSON: """Get test run details by name. Get test run details by name. - :param test_run_id: Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :return: JSON object :rtype: JSON @@ -3532,11 +3878,17 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -3544,45 +3896,59 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -3590,18 +3956,23 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -3612,64 +3983,73 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -3677,32 +4057,35 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -3718,7 +4101,7 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -3727,7 +4110,12 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: run. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3735,7 +4123,7 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_get_test_run_request( + request = build_test_run_get_request( test_run_id=test_run_id, api_version=self._config.api_version, headers=_headers, @@ -3767,16 +4155,16 @@ async def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace_async - async def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) -> JSON: + async def get_file(self, test_run_id: str, file_id: str, **kwargs: Any) -> JSON: """Get test run file by file name. Get test run file by file name. - :param test_run_id: Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param file_id: Unique identifier for test run file, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param file_id: Unique name for test run file, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type file_id: str :return: JSON object :rtype: JSON @@ -3789,15 +4177,21 @@ async def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) response == { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the file type (0 = - JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, 1, - and 2. + "fileType": "str", # Optional. File type. Known values are: "JMX_FILE", + "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. Validation status of the file. + "validationStatus": "str" # Optional. Validation status of the file. Known + values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3805,7 +4199,7 @@ async def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_get_test_run_file_request( + request = build_test_run_get_file_request( test_run_id=test_run_id, file_id=file_id, api_version=self._config.api_version, @@ -3837,8 +4231,8 @@ async def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) return cast(JSON, deserialized) - @distributed_trace_async - async def list_test_runs( + @distributed_trace + def list( self, *, order_by: Optional[str] = None, @@ -3847,10 +4241,8 @@ async def list_test_runs( execution_from: Optional[datetime.datetime] = None, execution_to: Optional[datetime.datetime] = None, status: Optional[str] = None, - max_page_size: int = 50, - test_id: Optional[str] = None, **kwargs: Any - ) -> JSON: + ) -> AsyncIterable[JSON]: """Get all test runs with given filters. Get all test runs with given filters. @@ -3864,327 +4256,16 @@ async def list_test_runs( :keyword search: Filter search based on searchable fields - description, executedUser. Default value is None. :paramtype search: str - :keyword execution_from: The end DateTime(ISO 8601 literal format) of test-run execution time + :keyword execution_from: End DateTime(ISO 8601 literal format) of test-run execution time filter range. Default value is None. :paramtype execution_from: ~datetime.datetime - :keyword execution_to: The start DateTime(ISO 8601 literal format) of test-run execution time + :keyword execution_to: Start DateTime(ISO 8601 literal format) of test-run execution time filter range. Default value is None. :paramtype execution_to: ~datetime.datetime - :keyword status: Comma separated list of test run status, value can be - "ACCEPTED", - "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", - "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED". - Default value is None. + :keyword status: Comma separated list of test run status. Default value is None. :paramtype status: str - :keyword max_page_size: Number of results in response. Default value is 50. - :paramtype max_page_size: int - :keyword test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Default value is None. - :paramtype test_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "value": [ - { - "createdBy": "str", # Optional. The user that created the - test run. - "createdDateTime": "2020-02-20 00:00:00", # Optional. The - created DateTime(ISO 8601 literal format) of the test run. - "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test - run. - "duration": 0, # Optional. Test run duration in - milliseconds. - "endDateTime": "2020-02-20 00:00:00", # Optional. The test - run end DateTime(ISO 8601 literal format). - "environmentVariables": { - "str": "str" # Optional. Environment variables which - are defined as a set of pairs. - }, - "executedDateTime": "2020-02-20 00:00:00", # Optional. Test - run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated - the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. - The last updated DateTime(ISO 8601 literal format) of the test run. - "loadTestConfig": { - "engineInstances": 0, # Optional. The number of - engine instances to execute load test. Supported values are in range - of 1-45. Required for creating a new test. - "splitAllCSVs": bool # Optional. Whether all the - input CSV files should be split evenly across all engines. - }, - "passFailCriteria": { - "passFailMetrics": { - "str": { - "action": "str", # Optional. Either - "u2018stop"u2019 or "u2018continue"u2019 after the threshold - is met. Default is "u2018continue"u2019. - "actualValue": 0.0, # Optional. The - actual value of the client metric for the test run. - "aggregate": "str", # Optional. The - aggregation function to be applied on the client metric. - Allowed functions - "u2018percentage"u2019 - for error metric - ,"u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, - "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, - "u2018max"u2019 - for response_time_ms and latency metric, - "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. - "clientmetric": "str", # Optional. - The client metric on which the criteria should be applied. - Allowed values - "u2018response_time_ms"u2019 , - "u2018latency"u2019, "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. - "condition": "str", # Optional. The - comparison operator. Supported types "u2018>"u2019. - "requestName": "str", # Optional. - Request name for which the Pass fail criteria has to be - applied. - "result": "str", # Optional. Outcome - of the test run. possible outcome - "u2018passed"u2019 , - "u2018failed"u2019 , "u2018undetermined"u2019. - "value": 0.0 # Optional. The value - to compare with the client metric. Allowed values - - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms - and latency : any integer value unit- ms. - } - } - }, - "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. - "secrets": { - "str": { - "type": "str", # Optional. Type of secret. - eg. AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the - secret, of type AKV_SECRET_URI or SECRET_VALUE. - } - }, - "startDateTime": "2020-02-20 00:00:00", # Optional. The test - run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. - "subnetId": "str", # Optional. Subnet ID on which the load - test instances should run. - "testArtifacts": { - "inputArtifacts": { - "additionalUrls": [ - { - "expireTime": "2020-02-20 - 00:00:00", # Optional. Expiry time of the file. - "fileId": "str", # Optional. - File unique identifier. - "fileType": 0, # Optional. - Integer representation of the file type (0 = JMX_FILE, 1 - = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known - values are: 0, 1, and 2. - "filename": "str", # - Optional. Name of the file. - "url": "str", # Optional. - File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - ], - "configUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "inputArtifactsZipFileurl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "testScriptUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "userPropUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - }, - "outputArtifacts": { - "logsUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "resultUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - } - }, - "testId": "str", # Optional. Associated test Id. - "testResult": "str", # Optional. Test result for pass/Fail - criteria used during the test run. possible outcome - "u2018Passed"u2019 - , "u2018Failed"u2019 , "u2018Not Applicable"u2019. - "testRunId": "str", # Optional. Unique test run name as - identifier. - "testRunStatistics": { - "str": { - "errorCount": 0.0, # Optional. Error count. - "errorPct": 0.0, # Optional. Error - percentage. - "maxResTime": 0.0, # Optional. Max response - time. - "meanResTime": 0.0, # Optional. Mean - response time. - "medianResTime": 0.0, # Optional. Median - response time. - "minResTime": 0.0, # Optional. Minimum - response time. - "pct1ResTime": 0.0, # Optional. 90 - percentile response time. - "pct2ResTime": 0.0, # Optional. 95 - percentile response time. - "pct3ResTime": 0.0, # Optional. 99 - percentile response time. - "receivedKBytesPerSec": 0.0, # Optional. - Received network bytes. - "sampleCount": 0.0, # Optional. Sampler - count. - "sentKBytesPerSec": 0.0, # Optional. Sent - network bytes. - "throughput": 0.0, # Optional. Throughput. - "transaction": "str" # Optional. Transaction - name. - } - }, - "vusers": 0 # Optional. Number of virtual users, for which - test has been run. - } - ], - "nextLink": "str" # Optional. Link for the next list of resources in case of - paginated results, if applicable. - } - """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_test_run_list_test_runs_request( - order_by=order_by, - continuation_token_parameter=continuation_token_parameter, - search=search, - execution_from=execution_from, - execution_to=execution_to, - status=status, - max_page_size=max_page_size, - test_id=test_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) - - return cast(JSON, deserialized) - - @distributed_trace_async - async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: - """Stop test run by name. - - Stop test run by name. - - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. - :type test_run_id: str - :return: JSON object - :rtype: JSON + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: Example: @@ -4192,11 +4273,17 @@ async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -4204,45 +4291,59 @@ async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -4250,18 +4351,23 @@ async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -4272,64 +4378,73 @@ async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -4337,32 +4452,35 @@ async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -4378,7 +4496,7 @@ async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -4387,61 +4505,95 @@ async def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: run. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_stop_test_run_request( - test_run_id=test_run_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + error_map.update(kwargs.pop("error_map", {}) or {}) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) + def prepare_request(next_link=None): + if not next_link: + + request = build_test_run_list_request( + order_by=order_by, + continuation_token_parameter=continuation_token_parameter, + search=search, + execution_from=execution_from, + execution_to=execution_to, + status=status, + test_id=self._config.test_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - response = pipeline_response.http_response + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return request - if response.content: - deserialized = response.json() - else: - deserialized = None + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), AsyncList(list_of_elem) - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) + async def get_next(next_link=None): + request = prepare_request(next_link) - return cast(JSON, deserialized) + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response - @overload - async def get_test_run_client_metrics( - self, test_run_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Get all client metrics for a load test run. + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) - Get all client metrics for a load test run. + @distributed_trace_async + async def stop(self, test_run_id: str, **kwargs: Any) -> JSON: + """Stop test run by name. + + Stop test run by name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param body: Client metrics request model. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -4449,91 +4601,293 @@ async def get_test_run_client_metrics( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "endTime": "2020-02-20 00:00:00", # End time. Required. - "startTime": "2020-02-20 00:00:00", # Start time. Required. - "errors": [ - "str" # Optional. List of errors, maximum supported errors for - queries are 20. In case of empty, by default will return metrics for maximum - 20 errors. - ], - "groupByInterval": "str", # Optional. For test duration less than 10 minutes - group by time interval can be any one of 5s,10s,1m,5m.""n""nFor test duration - greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. - Default value is 1m. - "percentiles": [ - "str" # Optional. List of percentiles values for response time, - supported values 50,90,99,95. Default value is 50th percentile. - ], - "requestSamplers": [ - "str" # Optional. List of request samplers, maximum supported - samplers for queries are 20. In case of empty, it will return metrics for - maximum 20 samplers. - ] - } - # response body for status code(s): 200 response == { - "testRunId": "str", # Optional. Test run name for which client metrics - results is required. - "timeSeries": { - "activeUsers": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "errors": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "responseTime": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "throughput": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - } - } - } - """ - - @overload - async def get_test_run_client_metrics( - self, test_run_id: str, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Get all client metrics for a load test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. + "createdDateTime": "2020-02-20 00:00:00", # Optional. The created + DateTime(ISO 8601 literal format) of the test model. + "description": "str", # Optional. The test run description. + "displayName": "str", # Optional. Display name of a testRun. + "duration": 0, # Optional. Test run duration in milliseconds. + "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end + DateTime(ISO 8601 literal format). + "environmentVariables": { + "str": "str" # Optional. Environment variables which are defined as + a set of pairs. + }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], + "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated + time. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. + "loadTestConfig": { + "engineInstances": 0, # Optional. The number of engine instances to + execute load test. Supported values are in range of 1-45. Required for + creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. + "splitAllCSVs": bool # Optional. Whether all the input CSV files + should be split evenly across all engines. + }, + "passFailCriteria": { + "passFailMetrics": { + "str": { + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". + "actualValue": 0.0, # Optional. The actual value of + the client metric for the test run. + "aggregate": "str", # Optional. The aggregation + function to be applied on the client metric. Allowed functions - + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, + "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, + "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency + metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". + "clientmetric": "str", # Optional. The client metric + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". + "condition": "str", # Optional. The comparison + operator. Supported types "u2018>"u2019, "u2018<"u2019. + "requestName": "str", # Optional. Request name for + which the Pass fail criteria has to be applied. + "result": "str", # Optional. Outcome of the test + run. Known values are: "passed", "undetermined", and "failed". + "value": 0.0 # Optional. The value to compare with + the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- + % "u2019, response_time_ms and latency : any integer value unit- ms. + } + } + }, + "portalUrl": "str", # Optional. Portal url. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + "secrets": { + "str": { + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. + } + }, + "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start + DateTime(ISO 8601 literal format). + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". + "subnetId": "str", # Optional. Subnet ID on which the load test instances + should run. + "testArtifacts": { + "inputArtifacts": { + "additionalUrls": [ + { + "expireTime": "2020-02-20 00:00:00", # + Optional. Expiry time of the file. + "fileId": "str", # Optional. File unique + identifier. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the + file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + } + ], + "configUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "inputArtifactsZipFileurl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "testScriptUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "userPropUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + } + }, + "outputArtifacts": { + "logsUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "resultUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + } + } + }, + "testId": "str", # Optional. Associated test Id. + "testResult": "str", # Optional. Test result for pass/Fail criteria used + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". + "testRunId": "str", # Optional. Unique test run name as identifier. + "testRunStatistics": { + "str": { + "errorCount": 0.0, # Optional. Error count. + "errorPct": 0.0, # Optional. Error percentage. + "maxResTime": 0.0, # Optional. Max response time. + "meanResTime": 0.0, # Optional. Mean response time. + "medianResTime": 0.0, # Optional. Median response time. + "minResTime": 0.0, # Optional. Minimum response time. + "pct1ResTime": 0.0, # Optional. 90 percentile response time. + "pct2ResTime": 0.0, # Optional. 95 percentile response time. + "pct3ResTime": 0.0, # Optional. 99 percentile response time. + "receivedKBytesPerSec": 0.0, # Optional. Received network + bytes. + "sampleCount": 0.0, # Optional. Sampler count. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. + "throughput": 0.0, # Optional. Throughput. + "transaction": "str" # Optional. Transaction name. + } + }, + "vusers": 0 # Optional. Number of virtual users, for which test has been + run. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_test_run_stop_request( + test_run_id=test_run_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - Get all client metrics for a load test run. + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace_async + async def metric_namespaces(self, test_run_id: str, **kwargs: Any) -> JSON: + """Lists the metric namespaces for a load test run. + + Lists the metric namespaces for a load test run. + + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param body: Client metrics request model. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -4543,63 +4897,70 @@ async def get_test_run_client_metrics( # response body for status code(s): 200 response == { - "testRunId": "str", # Optional. Test run name for which client metrics - results is required. - "timeSeries": { - "activeUsers": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "errors": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "responseTime": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "throughput": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] + "value": [ + { + "metricNamespaceName": "str", # Optional. The fully + qualified metric namespace name. + "name": "str" # Optional. The escaped name of the namespace. } - } + ] } """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_test_run_metric_namespaces_request( + test_run_id=test_run_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) @distributed_trace_async - async def get_test_run_client_metrics(self, test_run_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Get all client metrics for a load test run. + async def metric_definitions(self, test_run_id: str, *, metricnamespace: str, **kwargs: Any) -> JSON: + """Lists the metric definitions for a load test run. - Get all client metrics for a load test run. + Lists the metric definitions for a load test run. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param body: Client metrics request model. Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -4609,71 +4970,65 @@ async def get_test_run_client_metrics(self, test_run_id: str, body: Union[JSON, # response body for status code(s): 200 response == { - "testRunId": "str", # Optional. Test run name for which client metrics - results is required. - "timeSeries": { - "activeUsers": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "errors": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "responseTime": { - "str": [ + "value": [ + { + "dimensions": [ { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. + "localizedValue": "str", # Optional. The + locale specific value. + "value": "str" # Optional. The invariant + value. } - ] - }, - "throughput": { - "str": [ + ], + "displayDescription": "str", # Optional. Detailed + description of this metric. + "metricAvailabilities": [ { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. + "timeGrain": "str" # Optional. The time + grain specifies the aggregation interval for the metric. + Expressed as a duration 'PT1M', 'PT1H', etc. Known values are: + "PT5S", "PT10S", "PT1M", "PT5M", and "PT1H". } - ] + ], + "name": { + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. + }, + "namespace": "str", # Optional. The namespace the metric + belongs to. + "primaryAggregationType": "str", # Optional. the primary + aggregation type value defining how to use the values for display. Known + values are: "Average", "Count", "Minimum", "Maximum", "None", "Total", + "Percentile90", "Percentile95", and "Percentile99". + "supportedAggregationTypes": [ + "str" # Optional. the collection of what aggregation + types are supported. + ], + "unit": "str" # Optional. The unit of the metric. Known + values are: "NotSpecified", "Percent", "Count", "Seconds", + "Milliseconds", "Bytes", "BytesPerSecond", and "CountPerSecond". } - } + ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[JSON] - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_test_run_get_test_run_client_metrics_request( + request = build_test_run_metric_definitions_request( test_run_id=test_run_id, - content_type=content_type, + metricnamespace=metricnamespace, api_version=self._config.api_version, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -4702,15 +5057,296 @@ async def get_test_run_client_metrics(self, test_run_id: str, body: Union[JSON, return cast(JSON, deserialized) + @overload + async def metrics( + self, + test_run_id: str, + body: Optional[JSON] = None, + *, + metricname: str, + metricnamespace: str, + result_type: str, + timespan: str, + aggregation: Optional[str] = None, + interval: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Lists the metric values for a load test run. + + Lists the metric values for a load test run. + + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. + :type test_run_id: str + :param body: Default value is None. + :type body: JSON + :keyword metricname: Metric name. Required. + :paramtype metricname: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str + :keyword result_type: Reduces the set of data collected. The syntax allowed depends on the + operation. See the operation's description for details. Known values are: "Data" and + "Metadata". Required. + :paramtype result_type: str + :keyword timespan: The timespan of the query. It is a string with the following format + 'startDateTime_ISO/endDateTime_ISO'. Required. + :paramtype timespan: str + :keyword aggregation: The list of aggregation types (comma separated) to retrieve. Default + value is None. + :paramtype aggregation: str + :keyword interval: The interval (i.e. timegrain) of the query. Known values are: "PT5S", + "PT10S", "PT1M", "PT5M", and "PT1H". Default value is None. + :paramtype interval: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filters": [ + { + "name": "str", # Optional. The invariant metadata name. + "values": [ + "str" # Optional. The metadata values. Maximum + values can be 20. + ] + } + ] + } + + # response body for status code(s): 200 + response == { + "interval": "str", # Optional. The interval (window size) for which the + metric data was returned in. This may be adjusted in the future and returned back + from what was originally requested. This is not present if a metadata request was + made. + "namespace": "str", # Optional. The namespace of the metrics being queried. + "timespan": "str", # Optional. The timespan for which the data was + retrieved. Its value consists of two datetimes concatenated, separated by '/'. + This may be adjusted in the future and returned back from what was originally + requested. + "value": { + "displayDescription": "str", # Optional. Detailed description of + this metric. + "id": "str", # Optional. The Metric Id. + "name": { + "localizedValue": "str", # Optional. The locale specific + value. + "value": "str" # Optional. The invariant value. + }, + "timeseries": [ + { + "data": [ + { + "average": 0.0, # Optional. The + average value in the time range. + "count": 0.0, # Optional. The number + of samples in the time range. Can be used to determine the + number of values that contributed to the average value. + "maximum": 0.0, # Optional. The + greatest value in the time range. + "minimum": 0.0, # Optional. The + least value in the time range. + "percentile90": 0.0, # Optional. + 90th percentile value in the time range. + "percentile95": 0.0, # Optional. + 95th percentile value in the time range. + "percentile99": 0.0, # Optional. + 99th percentile value in the time range. + "timeStamp": "str", # Optional. The + timestamp for the metric value in ISO 8601 format. + "total": 0.0 # Optional. The sum of + all of the values in the time range. + } + ], + "metadatavalues": [ + { + "name": { + "localizedValue": "str", # + Optional. The locale specific value. + "value": "str" # Optional. + The invariant value. + }, + "value": "str" # Optional. The value + of the metadata. + } + ] + } + ], + "unit": "str" # Optional. The unit of the metric. Known values are: + "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", + "BytesPerSecond", and "CountPerSecond". + } + } + """ + + @overload + async def metrics( + self, + test_run_id: str, + body: Optional[IO] = None, + *, + metricname: str, + metricnamespace: str, + result_type: str, + timespan: str, + aggregation: Optional[str] = None, + interval: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Lists the metric values for a load test run. + + Lists the metric values for a load test run. + + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. + :type test_run_id: str + :param body: Default value is None. + :type body: IO + :keyword metricname: Metric name. Required. + :paramtype metricname: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str + :keyword result_type: Reduces the set of data collected. The syntax allowed depends on the + operation. See the operation's description for details. Known values are: "Data" and + "Metadata". Required. + :paramtype result_type: str + :keyword timespan: The timespan of the query. It is a string with the following format + 'startDateTime_ISO/endDateTime_ISO'. Required. + :paramtype timespan: str + :keyword aggregation: The list of aggregation types (comma separated) to retrieve. Default + value is None. + :paramtype aggregation: str + :keyword interval: The interval (i.e. timegrain) of the query. Known values are: "PT5S", + "PT10S", "PT1M", "PT5M", and "PT1H". Default value is None. + :paramtype interval: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "interval": "str", # Optional. The interval (window size) for which the + metric data was returned in. This may be adjusted in the future and returned back + from what was originally requested. This is not present if a metadata request was + made. + "namespace": "str", # Optional. The namespace of the metrics being queried. + "timespan": "str", # Optional. The timespan for which the data was + retrieved. Its value consists of two datetimes concatenated, separated by '/'. + This may be adjusted in the future and returned back from what was originally + requested. + "value": { + "displayDescription": "str", # Optional. Detailed description of + this metric. + "id": "str", # Optional. The Metric Id. + "name": { + "localizedValue": "str", # Optional. The locale specific + value. + "value": "str" # Optional. The invariant value. + }, + "timeseries": [ + { + "data": [ + { + "average": 0.0, # Optional. The + average value in the time range. + "count": 0.0, # Optional. The number + of samples in the time range. Can be used to determine the + number of values that contributed to the average value. + "maximum": 0.0, # Optional. The + greatest value in the time range. + "minimum": 0.0, # Optional. The + least value in the time range. + "percentile90": 0.0, # Optional. + 90th percentile value in the time range. + "percentile95": 0.0, # Optional. + 95th percentile value in the time range. + "percentile99": 0.0, # Optional. + 99th percentile value in the time range. + "timeStamp": "str", # Optional. The + timestamp for the metric value in ISO 8601 format. + "total": 0.0 # Optional. The sum of + all of the values in the time range. + } + ], + "metadatavalues": [ + { + "name": { + "localizedValue": "str", # + Optional. The locale specific value. + "value": "str" # Optional. + The invariant value. + }, + "value": "str" # Optional. The value + of the metadata. + } + ] + } + ], + "unit": "str" # Optional. The unit of the metric. Known values are: + "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", + "BytesPerSecond", and "CountPerSecond". + } + } + """ + @distributed_trace_async - async def get_test_run_client_metrics_filters(self, test_run_id: str, **kwargs: Any) -> JSON: - """Get all filters that are supported for client metrics for a given load test run. + async def metrics( + self, + test_run_id: str, + body: Optional[Union[JSON, IO]] = None, + *, + metricname: str, + metricnamespace: str, + result_type: str, + timespan: str, + aggregation: Optional[str] = None, + interval: Optional[str] = None, + **kwargs: Any + ) -> JSON: + """Lists the metric values for a load test run. - Get all filters that are supported for client metrics for a given load test run. + Lists the metric values for a load test run. - :param test_run_id: Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str + :param body: Is either a model type or a IO type. Default value is None. + :type body: JSON or IO + :keyword metricname: Metric name. Required. + :paramtype metricname: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str + :keyword result_type: Reduces the set of data collected. The syntax allowed depends on the + operation. See the operation's description for details. Known values are: "Data" and + "Metadata". Required. + :paramtype result_type: str + :keyword timespan: The timespan of the query. It is a string with the following format + 'startDateTime_ISO/endDateTime_ISO'. Required. + :paramtype timespan: str + :keyword aggregation: The list of aggregation types (comma separated) to retrieve. Default + value is None. + :paramtype aggregation: str + :keyword interval: The interval (i.e. timegrain) of the query. Known values are: "PT5S", + "PT10S", "PT1M", "PT5M", and "PT1H". Default value is None. + :paramtype interval: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -4720,37 +5356,106 @@ async def get_test_run_client_metrics_filters(self, test_run_id: str, **kwargs: # response body for status code(s): 200 response == { - "filters": { - "errorFiltersValues": [ - "str" # Optional. List of errors occurred for the test run, - for which client metrics can be filtered. + "interval": "str", # Optional. The interval (window size) for which the + metric data was returned in. This may be adjusted in the future and returned back + from what was originally requested. This is not present if a metadata request was + made. + "namespace": "str", # Optional. The namespace of the metrics being queried. + "timespan": "str", # Optional. The timespan for which the data was + retrieved. Its value consists of two datetimes concatenated, separated by '/'. + This may be adjusted in the future and returned back from what was originally + requested. + "value": { + "displayDescription": "str", # Optional. Detailed description of + this metric. + "id": "str", # Optional. The Metric Id. + "name": { + "localizedValue": "str", # Optional. The locale specific + value. + "value": "str" # Optional. The invariant value. + }, + "timeseries": [ + { + "data": [ + { + "average": 0.0, # Optional. The + average value in the time range. + "count": 0.0, # Optional. The number + of samples in the time range. Can be used to determine the + number of values that contributed to the average value. + "maximum": 0.0, # Optional. The + greatest value in the time range. + "minimum": 0.0, # Optional. The + least value in the time range. + "percentile90": 0.0, # Optional. + 90th percentile value in the time range. + "percentile95": 0.0, # Optional. + 95th percentile value in the time range. + "percentile99": 0.0, # Optional. + 99th percentile value in the time range. + "timeStamp": "str", # Optional. The + timestamp for the metric value in ISO 8601 format. + "total": 0.0 # Optional. The sum of + all of the values in the time range. + } + ], + "metadatavalues": [ + { + "name": { + "localizedValue": "str", # + Optional. The locale specific value. + "value": "str" # Optional. + The invariant value. + }, + "value": "str" # Optional. The value + of the metadata. + } + ] + } ], - "requestSamplerValues": [ - "str" # Optional. List of request sampler for the test run, - for which client metrics can be filtered. - ] - }, - "testRunId": "str", # Optional. Test run name for which client metrics - filters is required. - "timeRange": { - "endTime": "2020-02-20 00:00:00", # Optional. end DateTime(ISO 8601 - literal format) for the requested client metrics filter. - "startTime": "2020-02-20 00:00:00" # Optional. start DateTime(ISO - 8601 literal format) for the requested client metrics filter. + "unit": "str" # Optional. The unit of the metric. Known values are: + "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", + "BytesPerSecond", and "CountPerSecond". } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_get_test_run_client_metrics_filters_request( + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + request = build_test_run_metrics_request( test_run_id=test_run_id, + metricname=metricname, + metricnamespace=metricnamespace, + result_type=result_type, + timespan=timespan, + aggregation=aggregation, + interval=interval, + content_type=content_type, api_version=self._config.api_version, + json=_json, + content=_content, headers=_headers, params=_params, ) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/operations/_operations.py b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/operations/_operations.py index 4d642f3ebfec..06882a552e1c 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/operations/_operations.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/operations/_operations.py @@ -8,15 +8,18 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -38,16 +41,16 @@ _SERIALIZER.client_side_validation = False -def build_app_component_create_or_update_app_components_request(name: str, **kwargs: Any) -> HttpRequest: +def build_app_component_create_or_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/appcomponents/{name}" + _url = "/app-components/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$"), } @@ -65,15 +68,15 @@ def build_app_component_create_or_update_app_components_request(name: str, **kwa return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_app_component_delete_app_components_request(name: str, **kwargs: Any) -> HttpRequest: +def build_app_component_delete_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/appcomponents/{name}" + _url = "/app-components/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$"), } @@ -89,15 +92,15 @@ def build_app_component_delete_app_components_request(name: str, **kwargs: Any) return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_app_component_get_app_component_by_name_request(name: str, **kwargs: Any) -> HttpRequest: +def build_app_component_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/appcomponents/{name}" + _url = "/app-components/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$"), } @@ -113,28 +116,26 @@ def build_app_component_get_app_component_by_name_request(name: str, **kwargs: A return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_app_component_get_app_component_request( +def build_app_component_get_by_test_or_test_run_request( *, test_run_id: Optional[str] = None, test_id: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/appcomponents" + _url = "/app-components" # Construct parameters + if test_id is not None: + _params["testId"] = _SERIALIZER.query("test_id", test_id, "str") if test_run_id is not None: _params["testRunId"] = _SERIALIZER.query( "test_run_id", test_run_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" ) _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if test_id is not None: - _params["testId"] = _SERIALIZER.query( - "test_id", test_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" - ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -142,12 +143,12 @@ def build_app_component_get_app_component_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_server_metrics_create_or_update_server_metrics_config_request(name: str, **kwargs: Any) -> HttpRequest: +def build_server_metrics_create_or_update_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,11 +170,11 @@ def build_server_metrics_create_or_update_server_metrics_config_request(name: st return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_server_metrics_get_server_metrics_config_by_name_request(name: str, **kwargs: Any) -> HttpRequest: +def build_server_metrics_get_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,11 +194,11 @@ def build_server_metrics_get_server_metrics_config_by_name_request(name: str, ** return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_server_metrics_delete_server_metrics_config_request(name: str, **kwargs: Any) -> HttpRequest: +def build_server_metrics_delete_request(name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,28 +218,26 @@ def build_server_metrics_delete_server_metrics_config_request(name: str, **kwarg return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_server_metrics_get_server_metrics_config_request( +def build_server_metrics_get_by_test_or_test_run_request( *, test_run_id: Optional[str] = None, test_id: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL _url = "/serverMetricsConfig" # Construct parameters + if test_id is not None: + _params["testId"] = _SERIALIZER.query("test_id", test_id, "str") if test_run_id is not None: _params["testRunId"] = _SERIALIZER.query( "test_run_id", test_run_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" ) _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if test_id is not None: - _params["testId"] = _SERIALIZER.query( - "test_id", test_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" - ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -246,11 +245,11 @@ def build_server_metrics_get_server_metrics_config_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_server_metrics_get_server_default_metrics_config_request(**kwargs: Any) -> HttpRequest: +def build_server_metrics_get_default_metrics_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,11 +264,11 @@ def build_server_metrics_get_server_default_metrics_config_request(**kwargs: Any return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_server_metrics_list_supported_resource_types_request(**kwargs: Any) -> HttpRequest: +def build_server_metrics_list_supported_resource_type_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,12 +283,12 @@ def build_server_metrics_list_supported_resource_types_request(**kwargs: Any) -> return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_create_or_update_test_request(test_id: str, **kwargs: Any) -> HttpRequest: +def build_test_create_or_update_request(test_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -311,11 +310,11 @@ def build_test_create_or_update_test_request(test_id: str, **kwargs: Any) -> Htt return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_delete_load_test_request(test_id: str, **kwargs: Any) -> HttpRequest: +def build_test_delete_request(test_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,11 +334,11 @@ def build_test_delete_load_test_request(test_id: str, **kwargs: Any) -> HttpRequ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_get_load_test_request(test_id: str, **kwargs: Any) -> HttpRequest: +def build_test_get_request(test_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -359,20 +358,19 @@ def build_test_get_load_test_request(test_id: str, **kwargs: Any) -> HttpRequest return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_list_load_test_search_request( +def build_test_list_request( *, order_by: Optional[str] = None, search: Optional[str] = None, last_updated_start_time: Optional[datetime.datetime] = None, last_updated_end_time: Optional[datetime.datetime] = None, continuation_token_parameter: Optional[str] = None, - max_page_size: int = 50, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -393,8 +391,6 @@ def build_test_list_load_test_search_request( _params["continuationToken"] = _SERIALIZER.query( "continuation_token_parameter", continuation_token_parameter, "str" ) - if max_page_size is not None: - _params["maxPageSize"] = _SERIALIZER.query("max_page_size", max_page_size, "int") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -403,11 +399,11 @@ def build_test_list_load_test_search_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_get_test_file_request(test_id: str, file_id: str, **kwargs: Any) -> HttpRequest: +def build_test_get_file_request(test_id: str, file_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -428,11 +424,11 @@ def build_test_get_test_file_request(test_id: str, file_id: str, **kwargs: Any) return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_delete_test_file_request(test_id: str, file_id: str, **kwargs: Any) -> HttpRequest: +def build_test_delete_file_request(test_id: str, file_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -453,13 +449,13 @@ def build_test_delete_test_file_request(test_id: str, file_id: str, **kwargs: An return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_list_test_files_request( +def build_test_get_all_files_request( test_id: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -471,11 +467,11 @@ def build_test_list_test_files_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if continuation_token_parameter is not None: _params["continuationToken"] = _SERIALIZER.query( "continuation_token_parameter", continuation_token_parameter, "str" ) + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -483,11 +479,11 @@ def build_test_list_test_files_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_delete_test_run_request(test_run_id: str, **kwargs: Any) -> HttpRequest: +def build_test_run_delete_request(test_run_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -509,13 +505,14 @@ def build_test_run_delete_test_run_request(test_run_id: str, **kwargs: Any) -> H return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_create_or_update_test_request(test_run_id: str, **kwargs: Any) -> HttpRequest: +def build_test_run_create_or_update_request( + test_run_id: str, *, old_test_run_id: Optional[str] = None, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - old_test_run_id = kwargs.pop("old_test_run_id", _params.pop("oldTestRunId", None)) # type: Optional[str] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -541,11 +538,11 @@ def build_test_run_create_or_update_test_request(test_run_id: str, **kwargs: Any return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_get_test_run_request(test_run_id: str, **kwargs: Any) -> HttpRequest: +def build_test_run_get_request(test_run_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -567,11 +564,11 @@ def build_test_run_get_test_run_request(test_run_id: str, **kwargs: Any) -> Http return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_get_test_run_file_request(test_run_id: str, file_id: str, **kwargs: Any) -> HttpRequest: +def build_test_run_get_file_request(test_run_id: str, file_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -594,7 +591,7 @@ def build_test_run_get_test_run_file_request(test_run_id: str, file_id: str, **k return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_list_test_runs_request( +def build_test_run_list_request( *, order_by: Optional[str] = None, continuation_token_parameter: Optional[str] = None, @@ -602,14 +599,13 @@ def build_test_run_list_test_runs_request( execution_from: Optional[datetime.datetime] = None, execution_to: Optional[datetime.datetime] = None, status: Optional[str] = None, - max_page_size: int = 50, test_id: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,19 +620,15 @@ def build_test_run_list_test_runs_request( ) if search is not None: _params["search"] = _SERIALIZER.query("search", search, "str") + if test_id is not None: + _params["testId"] = _SERIALIZER.query("test_id", test_id, "str") if execution_from is not None: _params["executionFrom"] = _SERIALIZER.query("execution_from", execution_from, "iso-8601") if execution_to is not None: _params["executionTo"] = _SERIALIZER.query("execution_to", execution_to, "iso-8601") if status is not None: _params["status"] = _SERIALIZER.query("status", status, "str") - if max_page_size is not None: - _params["maxPageSize"] = _SERIALIZER.query("max_page_size", max_page_size, "int") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if test_id is not None: - _params["testId"] = _SERIALIZER.query( - "test_id", test_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" - ) # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -644,11 +636,11 @@ def build_test_run_list_test_runs_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_stop_test_run_request(test_run_id: str, **kwargs: Any) -> HttpRequest: +def build_test_run_stop_request(test_run_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL @@ -670,16 +662,15 @@ def build_test_run_stop_test_run_request(test_run_id: str, **kwargs: Any) -> Htt return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_get_test_run_client_metrics_request(test_run_id: str, **kwargs: Any) -> HttpRequest: +def build_test_run_metric_namespaces_request(test_run_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/testruns/{testRunId}/clientMetrics" + _url = "/testRuns/{testRunId}/metricNamespaces" path_format_arguments = { "testRunId": _SERIALIZER.url( "test_run_id", test_run_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" @@ -692,22 +683,20 @@ def build_test_run_get_test_run_client_metrics_request(test_run_id: str, **kwarg _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_run_get_test_run_client_metrics_filters_request(test_run_id: str, **kwargs: Any) -> HttpRequest: +def build_test_run_metric_definitions_request(test_run_id: str, *, metricnamespace: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/testruns/{testRunId}/clientMetricsFilters" + _url = "/testRuns/{testRunId}/metricDefinitions" path_format_arguments = { "testRunId": _SERIALIZER.url( "test_run_id", test_run_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" @@ -717,6 +706,7 @@ def build_test_run_get_test_run_client_metrics_filters_request(test_run_id: str, _url = _format_url_section(_url, **path_format_arguments) # Construct parameters + _params["metricnamespace"] = _SERIALIZER.query("metricnamespace", metricnamespace, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -725,6 +715,53 @@ def build_test_run_get_test_run_client_metrics_filters_request(test_run_id: str, return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_test_run_metrics_request( + test_run_id: str, + *, + metricname: str, + metricnamespace: str, + result_type: str, + timespan: str, + aggregation: Optional[str] = None, + interval: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01")) # type: str + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/testRuns/{testRunId}/metrics" + path_format_arguments = { + "testRunId": _SERIALIZER.url( + "test_run_id", test_run_id, "str", max_length=50, min_length=2, pattern=r"^[a-z0-9_-]*$" + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + if aggregation is not None: + _params["aggregation"] = _SERIALIZER.query("aggregation", aggregation, "str") + if interval is not None: + _params["interval"] = _SERIALIZER.query("interval", interval, "str") + _params["metricname"] = _SERIALIZER.query("metricname", metricname, "str") + _params["metricnamespace"] = _SERIALIZER.query("metricnamespace", metricnamespace, "str") + _params["resultType"] = _SERIALIZER.query("result_type", result_type, "str") + _params["timespan"] = _SERIALIZER.query("timespan", timespan, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class AppComponentOperations: """ .. warning:: @@ -743,15 +780,15 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def create_or_update_app_components( + def create_or_update( self, name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Associate an App Component (Azure resource) to a test or test run. + """Associate an app component (Azure resource) to a test or test run. - Associate an App Component (Azure resource) to a test or test run. + Associate an app component (Azure resource) to a test or test run. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :param body: App Component model. Required. :type body: JSON @@ -769,16 +806,18 @@ def create_or_update_app_components( body = { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -786,25 +825,27 @@ def create_or_update_app_components( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } # response body for status code(s): 200, 201 response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -812,22 +853,22 @@ def create_or_update_app_components( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ @overload - def create_or_update_app_components( + def create_or_update( self, name: str, body: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Associate an App Component (Azure resource) to a test or test run. + """Associate an app component (Azure resource) to a test or test run. - Associate an App Component (Azure resource) to a test or test run. + Associate an app component (Azure resource) to a test or test run. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :param body: App Component model. Required. :type body: IO @@ -845,16 +886,18 @@ def create_or_update_app_components( response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -862,20 +905,20 @@ def create_or_update_app_components( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ @distributed_trace - def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Associate an App Component (Azure resource) to a test or test run. + def create_or_update(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + """Associate an app component (Azure resource) to a test or test run. - Associate an App Component (Azure resource) to a test or test run. + Associate an app component (Azure resource) to a test or test run. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :param body: App Component model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -893,16 +936,18 @@ def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kw response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -910,12 +955,17 @@ def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kw "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -932,7 +982,7 @@ def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kw else: _json = body - request = build_app_component_create_or_update_app_components_request( + request = build_app_component_create_or_update_request( name=name, content_type=content_type, api_version=self._config.api_version, @@ -974,19 +1024,24 @@ def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kw return cast(JSON, deserialized) @distributed_trace - def delete_app_components(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete an App Component. + def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete an app component. - Delete an App Component. + Delete an app component. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -994,7 +1049,7 @@ def delete_app_components(self, name: str, **kwargs: Any) -> None: # pylint: di cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_app_component_delete_app_components_request( + request = build_app_component_delete_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -1019,13 +1074,13 @@ def delete_app_components(self, name: str, **kwargs: Any) -> None: # pylint: di return cls(pipeline_response, None, {}) @distributed_trace - def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: - """Get App Component details by App Component name. + def get(self, name: str, **kwargs: Any) -> JSON: + """Get app Component details by unique name. - Get App Component details by App Component name. + Get app Component details by unique name. - :param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name of the app component, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type name: str :return: JSON object :rtype: JSON @@ -1038,16 +1093,18 @@ def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -1055,12 +1112,17 @@ def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1068,7 +1130,7 @@ def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_app_component_get_app_component_by_name_request( + request = build_app_component_get_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -1100,18 +1162,14 @@ def get_app_component_by_name(self, name: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace - def get_app_component( - self, *, test_run_id: Optional[str] = None, test_id: Optional[str] = None, **kwargs: Any - ) -> JSON: - """Get App Components for a test or a test run by its name. + def get_by_test_or_test_run(self, *, test_run_id: Optional[str] = None, **kwargs: Any) -> JSON: + """Get an app component for a test or a test run by its name. - Get App Components for a test or a test run by its name. + Get an app component for a test or a test run by its name. - :keyword test_run_id: [Required, if testId is not provided] Test run Id. Default value is None. + :keyword test_run_id: Required testRunId, if testId field is not provided. Default value is + None. :paramtype test_run_id: str - :keyword test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Default value is None. - :paramtype test_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -1123,16 +1181,18 @@ def get_app_component( response == { "value": { "str": { - "resourceId": "str", # Fully qualified resource Id e.g + "resourceId": "str", # fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. Required. - "resourceName": "str", # Azure resource name. Required. - "resourceType": "str", # Azure resource type. Required. + "resourceName": "str", # Azure resource name, required while + creating the app component. Required. "displayName": "str", # Optional. Azure resource display name. "kind": "str", # Optional. Kind of Azure resource type. "resourceGroup": "str", # Optional. Resource group name of the Azure resource. + "resourceType": "str", # Optional. Azure resource type, + required while creating the app component. "subscriptionId": "str" # Optional. Subscription Id of the Azure resource. } @@ -1140,12 +1200,17 @@ def get_app_component( "name": "str", # Optional. AppComponent name. "resourceId": "str", # Optional. Azure Load Testing resource Id. "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. + unique name. "testRunId": "str" # Optional. [Required if testId is not given] Load test - run unique identifier. + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1153,9 +1218,9 @@ def get_app_component( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_app_component_get_app_component_request( + request = build_app_component_get_by_test_or_test_run_request( test_run_id=test_run_id, - test_id=test_id, + test_id=self._config.test_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1204,15 +1269,15 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload - def create_or_update_server_metrics_config( + def create_or_update( self, name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: """Configure server metrics for a test or test run. Configure server metrics for a test or test run. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :param body: Server metrics configuration model. Required. :type body: JSON @@ -1233,22 +1298,22 @@ def create_or_update_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } # response body for status code(s): 200, 201 @@ -1258,35 +1323,35 @@ def create_or_update_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ @overload - def create_or_update_server_metrics_config( + def create_or_update( self, name: str, body: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: """Configure server metrics for a test or test run. Configure server metrics for a test or test run. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :param body: Server metrics configuration model. Required. :type body: IO @@ -1307,33 +1372,33 @@ def create_or_update_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ @distributed_trace - def create_or_update_server_metrics_config(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + def create_or_update(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: """Configure server metrics for a test or test run. Configure server metrics for a test or test run. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :param body: Server metrics configuration model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -1354,25 +1419,30 @@ def create_or_update_server_metrics_config(self, name: str, body: Union[JSON, IO "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1389,7 +1459,7 @@ def create_or_update_server_metrics_config(self, name: str, body: Union[JSON, IO else: _json = body - request = build_server_metrics_create_or_update_server_metrics_config_request( + request = build_server_metrics_create_or_update_request( name=name, content_type=content_type, api_version=self._config.api_version, @@ -1431,13 +1501,13 @@ def create_or_update_server_metrics_config(self, name: str, body: Union[JSON, IO return cast(JSON, deserialized) @distributed_trace - def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> JSON: + def get(self, name: str, **kwargs: Any) -> JSON: """Get server metrics configuration by its name. Get server metrics configuration by its name. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :return: JSON object :rtype: JSON @@ -1453,25 +1523,30 @@ def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> JSON: "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1479,7 +1554,7 @@ def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_get_server_metrics_config_by_name_request( + request = build_server_metrics_get_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -1511,21 +1586,24 @@ def get_server_metrics_config_by_name(self, name: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace - def delete_server_metrics_config( # pylint: disable=inconsistent-return-statements - self, name: str, **kwargs: Any - ) -> None: + def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete server metrics configuration by its name. Delete server metrics configuration by its name. - :param name: Unique name for server metrics, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param name: Unique name for server metrics, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1533,7 +1611,7 @@ def delete_server_metrics_config( # pylint: disable=inconsistent-return-stateme cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_server_metrics_delete_server_metrics_config_request( + request = build_server_metrics_delete_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -1558,18 +1636,14 @@ def delete_server_metrics_config( # pylint: disable=inconsistent-return-stateme return cls(pipeline_response, None, {}) @distributed_trace - def get_server_metrics_config( - self, *, test_run_id: Optional[str] = None, test_id: Optional[str] = None, **kwargs: Any - ) -> JSON: + def get_by_test_or_test_run(self, *, test_run_id: Optional[str] = None, **kwargs: Any) -> JSON: """Get server metrics configuration for a test or test run by its name. Get server metrics configuration for a test or test run by its name. - :keyword test_run_id: [Required, if testId is not provided] Test run Id. Default value is None. + :keyword test_run_id: Required testRunId, if testId field is not provided. Default value is + None. :paramtype test_run_id: str - :keyword test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Default value is None. - :paramtype test_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -1584,25 +1658,30 @@ def get_server_metrics_config( "aggregation": "str", # Metric aggregation. Required. "metricnamespace": "str", # Metric name space. Required. "name": { - "localizedValue": "str", # Metric localized name. - Required. - "value": "str" # Metric name value. Required. + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. }, - "resourceId": "str", # Azure resource Id. Required. + "resourceId": "str", # Azure resource id. Required. "resourceType": "str", # Azure resource type. Required. "displayDescription": "str", # Optional. Metric description. - "id": "str", # Optional. Unique identifier for metric. + "id": "str", # Optional. Unique name for metric. "unit": "str" # Optional. Metric unit. } }, - "name": "str", # Optional. Server metrics config name. - "testId": "str", # Optional. [Required, if testRunId is not given] Load test - unique identifier. - "testRunId": "str" # Optional. [Required, if testId is not given] Load test - run unique identifier. + "name": "str", # Optional. Server metrics configuration model. + "testId": "str", # Optional. [Required, if test run Id is not given] Load + test unique name. + "testRunId": "str" # Optional. [Required, if test Id is not given] Load test + run unique name. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1610,9 +1689,9 @@ def get_server_metrics_config( cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_get_server_metrics_config_request( + request = build_server_metrics_get_by_test_or_test_run_request( test_run_id=test_run_id, - test_id=test_id, + test_id=self._config.test_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1643,7 +1722,7 @@ def get_server_metrics_config( return cast(JSON, deserialized) @distributed_trace - def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: + def get_default_metrics(self, **kwargs: Any) -> JSON: """Get all default server metrics configuration for supported resource types. Get all default server metrics configuration for supported resource types. @@ -1660,37 +1739,30 @@ def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: "defaultMetrics": { "str": [ { - "aggregation": "str", # Optional. Default metrics - map {resourceType : list of metrics config} (Refer for metrics - structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - "displayDescription": "str", # Optional. Default - metrics map {resourceType : list of metrics config} (Refer for - metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - "metricnamespace": "str", # Optional. Default - metrics map {resourceType : list of metrics config} (Refer for - metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + "aggregation": "str", # Optional. Metric + aggregation. + "displayDescription": "str", # Optional. Metric + display description. + "metricnamespace": "str", # Optional. Metric + namespace. "name": { - "localizedValue": "str", # Optional. Default - metrics map {resourceType : list of metrics config} (Refer for - metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). - "value": "str" # Optional. Default metrics - map {resourceType : list of metrics config} (Refer for metrics - structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + "localizedValue": "str", # Optional. The + locale specific value. + "value": "str" # Optional. The invariant + value. }, - "unit": "str" # Optional. Default metrics map - {resourceType : list of metrics config} (Refer for metrics structure: - https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + "unit": "str" # Optional. Metric unit. } ] } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1698,7 +1770,7 @@ def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_get_server_default_metrics_config_request( + request = build_server_metrics_get_default_metrics_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -1729,10 +1801,10 @@ def get_server_default_metrics_config(self, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace - def list_supported_resource_types(self, **kwargs: Any) -> JSON: - """Get all supported resource types for App Components(Azure resource types). + def list_supported_resource_type(self, **kwargs: Any) -> JSON: + """Get all supported resource types for adding an app component(Azure resource types). - Get all supported resource types for App Components(Azure resource types). + Get all supported resource types for adding an app component(Azure resource types). :return: JSON object :rtype: JSON @@ -1748,7 +1820,12 @@ def list_supported_resource_types(self, **kwargs: Any) -> JSON: ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1756,7 +1833,7 @@ def list_supported_resource_types(self, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_server_metrics_list_supported_resource_types_request( + request = build_server_metrics_list_supported_resource_type_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -1806,20 +1883,20 @@ def __init__(self, *args, **kwargs): raise_if_not_implemented( self.__class__, [ - "upload_test_file", + "upload_file", ], ) @overload - def create_or_update_test( + def create_or_update( self, test_id: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Create a new test or Update an existing test. + """Create a new test or update an existing test. - Create a new test or Update an existing test. + Create a new test or update an existing test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :param body: Load test model. Required. :type body: JSON @@ -1835,6 +1912,12 @@ def create_or_update_test( # JSON input template you can fill out and use as your body input. body = { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -1850,62 +1933,64 @@ def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -1920,36 +2005,43 @@ def create_or_update_test( "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -1960,10 +2052,10 @@ def create_or_update_test( /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -1973,6 +2065,12 @@ def create_or_update_test( # response body for status code(s): 200, 201 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -1988,62 +2086,64 @@ def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -2058,36 +2158,43 @@ def create_or_update_test( "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -2098,10 +2205,10 @@ def create_or_update_test( /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -2111,15 +2218,15 @@ def create_or_update_test( """ @overload - def create_or_update_test( + def create_or_update( self, test_id: str, body: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: - """Create a new test or Update an existing test. + """Create a new test or update an existing test. - Create a new test or Update an existing test. + Create a new test or update an existing test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :param body: Load test model. Required. :type body: IO @@ -2135,6 +2242,12 @@ def create_or_update_test( # response body for status code(s): 200, 201 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -2150,62 +2263,64 @@ def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -2220,36 +2335,43 @@ def create_or_update_test( "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -2260,10 +2382,10 @@ def create_or_update_test( /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -2273,13 +2395,13 @@ def create_or_update_test( """ @distributed_trace - def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Create a new test or Update an existing test. + def create_or_update(self, test_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: + """Create a new test or update an existing test. - Create a new test or Update an existing test. + Create a new test or update an existing test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :param body: Load test model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -2295,6 +2417,12 @@ def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: A # response body for status code(s): 200, 201 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -2310,62 +2438,64 @@ def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: A "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -2380,36 +2510,43 @@ def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: A "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -2420,10 +2557,10 @@ def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: A /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -2431,7 +2568,12 @@ def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: A "testId": "str" # Optional. Unique test name as identifier. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2448,7 +2590,7 @@ def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: A else: _json = body - request = build_test_create_or_update_test_request( + request = build_test_create_or_update_request( test_id=test_id, content_type=content_type, api_version=self._config.api_version, @@ -2490,19 +2632,24 @@ def create_or_update_test(self, test_id: str, body: Union[JSON, IO], **kwargs: A return cast(JSON, deserialized) @distributed_trace - def delete_load_test(self, test_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + def delete(self, test_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a test by its name. Delete a test by its name. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2510,7 +2657,7 @@ def delete_load_test(self, test_id: str, **kwargs: Any) -> None: # pylint: disa cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_test_delete_load_test_request( + request = build_test_delete_request( test_id=test_id, api_version=self._config.api_version, headers=_headers, @@ -2535,13 +2682,13 @@ def delete_load_test(self, test_id: str, **kwargs: Any) -> None: # pylint: disa return cls(pipeline_response, None, {}) @distributed_trace - def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: + def get(self, test_id: str, **kwargs: Any) -> JSON: """Get load test details by test name. Get load test details by test name. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :return: JSON object :rtype: JSON @@ -2552,6 +2699,12 @@ def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created DateTime(ISO 8601 literal format) of the test model. @@ -2567,62 +2720,64 @@ def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation status of - the file. + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } }, "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed @@ -2637,36 +2792,43 @@ def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -2677,10 +2839,10 @@ def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "subnetId": "str", # Optional. Subnet ID on which the load test instances @@ -2688,7 +2850,12 @@ def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: "testId": "str" # Optional. Unique test name as identifier. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2696,7 +2863,7 @@ def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_get_load_test_request( + request = build_test_get_request( test_id=test_id, api_version=self._config.api_version, headers=_headers, @@ -2728,7 +2895,7 @@ def get_load_test(self, test_id: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace - def list_load_test_search( + def list( self, *, order_by: Optional[str] = None, @@ -2736,9 +2903,8 @@ def list_load_test_search( last_updated_start_time: Optional[datetime.datetime] = None, last_updated_end_time: Optional[datetime.datetime] = None, continuation_token_parameter: Optional[str] = None, - max_page_size: int = 50, **kwargs: Any - ) -> JSON: + ) -> Iterable[JSON]: """Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. @@ -2760,10 +2926,8 @@ def list_load_test_search( :keyword continuation_token_parameter: Continuation token to get the next page of response. Default value is None. :paramtype continuation_token_parameter: str - :keyword max_page_size: Number of results in response. Default value is 50. - :paramtype max_page_size: int - :return: JSON object - :rtype: JSON + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: Example: @@ -2771,223 +2935,246 @@ def list_load_test_search( # response body for status code(s): 200 response == { - "value": [ - { - "createdBy": "str", # Optional. The user that created the - test model. - "createdDateTime": "2020-02-20 00:00:00", # Optional. The - created DateTime(ISO 8601 literal format) of the test model. - "description": "str", # Optional. The test description. - "displayName": "str", # Optional. Display name of a test. - "environmentVariables": { - "str": "str" # Optional. Environment variables which - are defined as a set of pairs. - }, - "inputArtifacts": { - "additionalUrls": [ - { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - ], - "configUrl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - }, - "inputArtifactsZipFileurl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - }, - "testScriptUrl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - }, - "userPropUrl": { - "expireTime": "2020-02-20 00:00:00", # - Optional. Expiry time of the file. - "fileId": "str", # Optional. File unique - identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. - "filename": "str", # Optional. Name of the - file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. - Validation status of the file. - } - }, - "keyvaultReferenceIdentityId": "str", # Optional. Resource - Id of the managed identity referencing the Key vault. - "keyvaultReferenceIdentityType": "str", # Optional. Type of - the managed identity referencing the Key vault. - "lastModifiedBy": "str", # Optional. The user that last - modified the test model. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. - The last Modified DateTime(ISO 8601 literal format) of the test model. - "loadTestConfig": { - "engineInstances": 0, # Optional. The number of - engine instances to execute load test. Supported values are in range - of 1-45. Required for creating a new test. - "splitAllCSVs": bool # Optional. Whether all the - input CSV files should be split evenly across all engines. - }, - "passFailCriteria": { - "passFailMetrics": { - "str": { - "action": "str", # Optional. Either - "u2018stop"u2019 or "u2018continue"u2019 after the threshold - is met. Default is "u2018continue"u2019. - "actualValue": 0.0, # Optional. The - actual value of the client metric for the test run. - "aggregate": "str", # Optional. The - aggregation function to be applied on the client metric. - Allowed functions - "u2018percentage"u2019 - for error metric - ,"u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, - "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, - "u2018max"u2019 - for response_time_ms and latency metric, - "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. - "clientmetric": "str", # Optional. - The client metric on which the criteria should be applied. - Allowed values - "u2018response_time_ms"u2019 , - "u2018latency"u2019, "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. - "condition": "str", # Optional. The - comparison operator. Supported types "u2018>"u2019. - "requestName": "str", # Optional. - Request name for which the Pass fail criteria has to be - applied. - "result": "str", # Optional. Outcome - of the test run. possible outcome - "u2018passed"u2019 , - "u2018failed"u2019 , "u2018undetermined"u2019. - "value": 0.0 # Optional. The value - to compare with the client metric. Allowed values - - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms - and latency : any integer value unit- ms. - } - } - }, - "resourceId": "str", # Optional. Fully qualified resource Id - e.g - /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - "secrets": { - "str": { - "type": "str", # Optional. Type of secret. - eg. AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the - secret, of type AKV_SECRET_URI or SECRET_VALUE. - } - }, - "subnetId": "str", # Optional. Subnet ID on which the load - test instances should run. - "testId": "str" # Optional. Unique test name as identifier. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. + "createdDateTime": "2020-02-20 00:00:00", # Optional. The created + DateTime(ISO 8601 literal format) of the test model. + "description": "str", # Optional. The test description. + "displayName": "str", # Optional. Display name of a test. + "environmentVariables": { + "str": "str" # Optional. Environment variables which are defined as + a set of pairs. + }, + "inputArtifacts": { + "additionalUrls": [ + { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + } + ], + "configUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". + }, + "inputArtifactsZipFileurl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". + }, + "testScriptUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". + }, + "userPropUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time + of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: + "JMX_FILE", "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of + the file. Known values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", and "VALIDATION_INITIATED". } - ], - "nextLink": "str" # Optional. Link for the next list of resources in case of - paginated results, if applicable. + }, + "keyvaultReferenceIdentityId": "str", # Optional. Resource Id of the managed + identity referencing the Key vault. + "keyvaultReferenceIdentityType": "str", # Optional. Type of the managed + identity referencing the Key vault. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. + "loadTestConfig": { + "engineInstances": 0, # Optional. The number of engine instances to + execute load test. Supported values are in range of 1-45. Required for + creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. + "splitAllCSVs": bool # Optional. Whether all the input CSV files + should be split evenly across all engines. + }, + "passFailCriteria": { + "passFailMetrics": { + "str": { + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". + "actualValue": 0.0, # Optional. The actual value of + the client metric for the test run. + "aggregate": "str", # Optional. The aggregation + function to be applied on the client metric. Allowed functions - + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, + "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, + "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency + metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". + "clientmetric": "str", # Optional. The client metric + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". + "condition": "str", # Optional. The comparison + operator. Supported types "u2018>"u2019, "u2018<"u2019. + "requestName": "str", # Optional. Request name for + which the Pass fail criteria has to be applied. + "result": "str", # Optional. Outcome of the test + run. Known values are: "passed", "undetermined", and "failed". + "value": 0.0 # Optional. The value to compare with + the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- + % "u2019, response_time_ms and latency : any integer value unit- ms. + } + } + }, + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + "secrets": { + "str": { + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. + } + }, + "subnetId": "str", # Optional. Subnet ID on which the load test instances + should run. + "testId": "str" # Optional. Unique test name as identifier. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_list_load_test_search_request( - order_by=order_by, - search=search, - last_updated_start_time=last_updated_start_time, - last_updated_end_time=last_updated_end_time, - continuation_token_parameter=continuation_token_parameter, - max_page_size=max_page_size, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + error_map.update(kwargs.pop("error_map", {}) or {}) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) + def prepare_request(next_link=None): + if not next_link: + + request = build_test_list_request( + order_by=order_by, + search=search, + last_updated_start_time=last_updated_start_time, + last_updated_end_time=last_updated_end_time, + continuation_token_parameter=continuation_token_parameter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - response = pipeline_response.http_response + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return request - if response.content: - deserialized = response.json() - else: - deserialized = None + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), iter(list_of_elem) - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) + def get_next(next_link=None): + request = prepare_request(next_link) - return cast(JSON, deserialized) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace - def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON: + def get_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON: """Get test file by the file name. Get test file by the file name. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str - :param file_id: Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param file_id: Unique name for test file, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type file_id: str :return: JSON object :rtype: JSON @@ -3000,15 +3187,21 @@ def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON: response == { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the file type (0 = - JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, 1, - and 2. + "fileType": "str", # Optional. File type. Known values are: "JMX_FILE", + "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. Validation status of the file. + "validationStatus": "str" # Optional. Validation status of the file. Known + values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3016,7 +3209,7 @@ def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_get_test_file_request( + request = build_test_get_file_request( test_id=test_id, file_id=file_id, api_version=self._config.api_version, @@ -3049,24 +3242,29 @@ def get_test_file(self, test_id: str, file_id: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace - def delete_test_file( # pylint: disable=inconsistent-return-statements + def delete_file( # pylint: disable=inconsistent-return-statements self, test_id: str, file_id: str, **kwargs: Any ) -> None: """Delete file by the file name for a test. Delete file by the file name for a test. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str - :param file_id: Unique identifier for test file, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param file_id: Unique name for test file, must contain only lower-case alphabetic, numeric, + underscore or hyphen characters. Required. :type file_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3074,7 +3272,7 @@ def delete_test_file( # pylint: disable=inconsistent-return-statements cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_test_delete_test_file_request( + request = build_test_delete_file_request( test_id=test_id, file_id=file_id, api_version=self._config.api_version, @@ -3100,21 +3298,21 @@ def delete_test_file( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) @distributed_trace - def list_test_files( + def get_all_files( self, test_id: str, *, continuation_token_parameter: Optional[str] = None, **kwargs: Any - ) -> JSON: + ) -> Iterable[JSON]: """Get all test files. Get all test files. - :param test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_id: Unique name for the load test, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_id: str :keyword continuation_token_parameter: Continuation token to get the next page of response. Default value is None. :paramtype continuation_token_parameter: str - :return: JSON object - :rtype: JSON + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: Example: @@ -3122,63 +3320,91 @@ def list_test_files( # response body for status code(s): 200 response == { - "value": [ - { - "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time - of the file. - "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the - file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). - Known values are: 0, 1, and 2. - "filename": "str", # Optional. Name of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. Validation status of - the file. - } - ], - "nextLink": "str" # Optional. Link for the next list of file URLs, if - applicable. + "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known values are: "JMX_FILE", + "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation status of the file. Known + values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_list_test_files_request( - test_id=test_id, - continuation_token_parameter=continuation_token_parameter, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + error_map.update(kwargs.pop("error_map", {}) or {}) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) + def prepare_request(next_link=None): + if not next_link: + + request = build_test_get_all_files_request( + test_id=test_id, + continuation_token_parameter=continuation_token_parameter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - response = pipeline_response.http_response + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return request - if response.content: - deserialized = response.json() - else: - deserialized = None + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), iter(list_of_elem) - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) + def get_next(next_link=None): + request = prepare_request(next_link) - return cast(JSON, deserialized) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) class TestRunOperations: @@ -3199,21 +3425,24 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def delete_test_run( # pylint: disable=inconsistent-return-statements - self, test_run_id: str, **kwargs: Any - ) -> None: + def delete(self, test_run_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Delete a test run by its name. Delete a test run by its name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3221,7 +3450,7 @@ def delete_test_run( # pylint: disable=inconsistent-return-statements cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_test_run_delete_test_run_request( + request = build_test_run_delete_request( test_run_id=test_run_id, api_version=self._config.api_version, headers=_headers, @@ -3246,7 +3475,7 @@ def delete_test_run( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) @overload - def create_or_update_test( + def create_or_update( self, test_run_id: str, body: JSON, @@ -3259,8 +3488,8 @@ def create_or_update_test( Create and start a new test run with the given name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :param body: Load test run model. Required. :type body: JSON @@ -3278,11 +3507,17 @@ def create_or_update_test( # JSON input template you can fill out and use as your body input. body = { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -3290,45 +3525,59 @@ def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -3336,18 +3585,23 @@ def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -3358,64 +3612,73 @@ def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -3423,32 +3686,35 @@ def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -3464,7 +3730,7 @@ def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -3475,11 +3741,17 @@ def create_or_update_test( # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -3487,45 +3759,59 @@ def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -3533,18 +3819,23 @@ def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -3555,64 +3846,73 @@ def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -3620,32 +3920,35 @@ def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -3661,7 +3964,7 @@ def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -3672,7 +3975,7 @@ def create_or_update_test( """ @overload - def create_or_update_test( + def create_or_update( self, test_run_id: str, body: IO, @@ -3685,8 +3988,8 @@ def create_or_update_test( Create and start a new test run with the given name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :param body: Load test run model. Required. :type body: IO @@ -3704,11 +4007,17 @@ def create_or_update_test( # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -3716,45 +4025,59 @@ def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -3762,18 +4085,23 @@ def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -3784,64 +4112,73 @@ def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -3849,32 +4186,35 @@ def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -3890,7 +4230,7 @@ def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -3901,15 +4241,15 @@ def create_or_update_test( """ @distributed_trace - def create_or_update_test( + def create_or_update( self, test_run_id: str, body: Union[JSON, IO], *, old_test_run_id: Optional[str] = None, **kwargs: Any ) -> JSON: """Create and start a new test run with the given name. Create and start a new test run with the given name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :param body: Load test run model. Is either a model type or a IO type. Required. :type body: JSON or IO @@ -3927,11 +4267,17 @@ def create_or_update_test( # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -3939,45 +4285,59 @@ def create_or_update_test( "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -3985,18 +4345,23 @@ def create_or_update_test( } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -4007,64 +4372,73 @@ def create_or_update_test( Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -4072,32 +4446,35 @@ def create_or_update_test( "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -4113,7 +4490,7 @@ def create_or_update_test( "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -4122,7 +4499,12 @@ def create_or_update_test( run. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4139,7 +4521,7 @@ def create_or_update_test( else: _json = body - request = build_test_run_create_or_update_test_request( + request = build_test_run_create_or_update_request( test_run_id=test_run_id, old_test_run_id=old_test_run_id, content_type=content_type, @@ -4175,13 +4557,13 @@ def create_or_update_test( return cast(JSON, deserialized) @distributed_trace - def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: + def get(self, test_run_id: str, **kwargs: Any) -> JSON: """Get test run details by name. Get test run details by name. - :param test_run_id: Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str :return: JSON object :rtype: JSON @@ -4192,11 +4574,17 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -4204,45 +4592,59 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -4250,18 +4652,23 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -4272,64 +4679,73 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -4337,32 +4753,35 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -4378,7 +4797,7 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -4387,7 +4806,12 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: run. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4395,7 +4819,7 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_get_test_run_request( + request = build_test_run_get_request( test_run_id=test_run_id, api_version=self._config.api_version, headers=_headers, @@ -4427,16 +4851,16 @@ def get_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace - def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) -> JSON: + def get_file(self, test_run_id: str, file_id: str, **kwargs: Any) -> JSON: """Get test run file by file name. Get test run file by file name. - :param test_run_id: Unique name of load test run, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param file_id: Unique identifier for test run file, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param file_id: Unique name for test run file, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type file_id: str :return: JSON object :rtype: JSON @@ -4449,15 +4873,21 @@ def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) -> JS response == { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of the file type (0 = - JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, 1, - and 2. + "fileType": "str", # Optional. File type. Known values are: "JMX_FILE", + "USER_PROPERTIES", and "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. - "validationStatus": "str" # Optional. Validation status of the file. + "validationStatus": "str" # Optional. Validation status of the file. Known + values are: "NOT_VALIDATED", "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4465,7 +4895,7 @@ def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) -> JS cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_get_test_run_file_request( + request = build_test_run_get_file_request( test_run_id=test_run_id, file_id=file_id, api_version=self._config.api_version, @@ -4498,7 +4928,7 @@ def get_test_run_file(self, test_run_id: str, file_id: str, **kwargs: Any) -> JS return cast(JSON, deserialized) @distributed_trace - def list_test_runs( + def list( self, *, order_by: Optional[str] = None, @@ -4507,10 +4937,8 @@ def list_test_runs( execution_from: Optional[datetime.datetime] = None, execution_to: Optional[datetime.datetime] = None, status: Optional[str] = None, - max_page_size: int = 50, - test_id: Optional[str] = None, **kwargs: Any - ) -> JSON: + ) -> Iterable[JSON]: """Get all test runs with given filters. Get all test runs with given filters. @@ -4524,327 +4952,16 @@ def list_test_runs( :keyword search: Filter search based on searchable fields - description, executedUser. Default value is None. :paramtype search: str - :keyword execution_from: The end DateTime(ISO 8601 literal format) of test-run execution time + :keyword execution_from: End DateTime(ISO 8601 literal format) of test-run execution time filter range. Default value is None. :paramtype execution_from: ~datetime.datetime - :keyword execution_to: The start DateTime(ISO 8601 literal format) of test-run execution time + :keyword execution_to: Start DateTime(ISO 8601 literal format) of test-run execution time filter range. Default value is None. :paramtype execution_to: ~datetime.datetime - :keyword status: Comma separated list of test run status, value can be - "ACCEPTED", - "NOTSTARTED","PROVISIONING","PROVISIONED","CONFIGURING", - "CONFIGURED","EXECUTING","EXECUTED","DEPROVISIONING","DEPROVISIONED","DONE","CANCELLED","FAILED". - Default value is None. + :keyword status: Comma separated list of test run status. Default value is None. :paramtype status: str - :keyword max_page_size: Number of results in response. Default value is 50. - :paramtype max_page_size: int - :keyword test_id: Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - Default value is None. - :paramtype test_id: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "value": [ - { - "createdBy": "str", # Optional. The user that created the - test run. - "createdDateTime": "2020-02-20 00:00:00", # Optional. The - created DateTime(ISO 8601 literal format) of the test run. - "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test - run. - "duration": 0, # Optional. Test run duration in - milliseconds. - "endDateTime": "2020-02-20 00:00:00", # Optional. The test - run end DateTime(ISO 8601 literal format). - "environmentVariables": { - "str": "str" # Optional. Environment variables which - are defined as a set of pairs. - }, - "executedDateTime": "2020-02-20 00:00:00", # Optional. Test - run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated - the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. - The last updated DateTime(ISO 8601 literal format) of the test run. - "loadTestConfig": { - "engineInstances": 0, # Optional. The number of - engine instances to execute load test. Supported values are in range - of 1-45. Required for creating a new test. - "splitAllCSVs": bool # Optional. Whether all the - input CSV files should be split evenly across all engines. - }, - "passFailCriteria": { - "passFailMetrics": { - "str": { - "action": "str", # Optional. Either - "u2018stop"u2019 or "u2018continue"u2019 after the threshold - is met. Default is "u2018continue"u2019. - "actualValue": 0.0, # Optional. The - actual value of the client metric for the test run. - "aggregate": "str", # Optional. The - aggregation function to be applied on the client metric. - Allowed functions - "u2018percentage"u2019 - for error metric - ,"u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, - "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, - "u2018max"u2019 - for response_time_ms and latency metric, - "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. - "clientmetric": "str", # Optional. - The client metric on which the criteria should be applied. - Allowed values - "u2018response_time_ms"u2019 , - "u2018latency"u2019, "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. - "condition": "str", # Optional. The - comparison operator. Supported types "u2018>"u2019. - "requestName": "str", # Optional. - Request name for which the Pass fail criteria has to be - applied. - "result": "str", # Optional. Outcome - of the test run. possible outcome - "u2018passed"u2019 , - "u2018failed"u2019 , "u2018undetermined"u2019. - "value": 0.0 # Optional. The value - to compare with the client metric. Allowed values - - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms - and latency : any integer value unit- ms. - } - } - }, - "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. - "secrets": { - "str": { - "type": "str", # Optional. Type of secret. - eg. AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the - secret, of type AKV_SECRET_URI or SECRET_VALUE. - } - }, - "startDateTime": "2020-02-20 00:00:00", # Optional. The test - run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. - "subnetId": "str", # Optional. Subnet ID on which the load - test instances should run. - "testArtifacts": { - "inputArtifacts": { - "additionalUrls": [ - { - "expireTime": "2020-02-20 - 00:00:00", # Optional. Expiry time of the file. - "fileId": "str", # Optional. - File unique identifier. - "fileType": 0, # Optional. - Integer representation of the file type (0 = JMX_FILE, 1 - = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known - values are: 0, 1, and 2. - "filename": "str", # - Optional. Name of the file. - "url": "str", # Optional. - File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - ], - "configUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "inputArtifactsZipFileurl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "testScriptUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "userPropUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - }, - "outputArtifacts": { - "logsUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - }, - "resultUrl": { - "expireTime": "2020-02-20 00:00:00", - # Optional. Expiry time of the file. - "fileId": "str", # Optional. File - unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: - 0, 1, and 2. - "filename": "str", # Optional. Name - of the file. - "url": "str", # Optional. File URL. - "validationStatus": "str" # - Optional. Validation status of the file. - } - } - }, - "testId": "str", # Optional. Associated test Id. - "testResult": "str", # Optional. Test result for pass/Fail - criteria used during the test run. possible outcome - "u2018Passed"u2019 - , "u2018Failed"u2019 , "u2018Not Applicable"u2019. - "testRunId": "str", # Optional. Unique test run name as - identifier. - "testRunStatistics": { - "str": { - "errorCount": 0.0, # Optional. Error count. - "errorPct": 0.0, # Optional. Error - percentage. - "maxResTime": 0.0, # Optional. Max response - time. - "meanResTime": 0.0, # Optional. Mean - response time. - "medianResTime": 0.0, # Optional. Median - response time. - "minResTime": 0.0, # Optional. Minimum - response time. - "pct1ResTime": 0.0, # Optional. 90 - percentile response time. - "pct2ResTime": 0.0, # Optional. 95 - percentile response time. - "pct3ResTime": 0.0, # Optional. 99 - percentile response time. - "receivedKBytesPerSec": 0.0, # Optional. - Received network bytes. - "sampleCount": 0.0, # Optional. Sampler - count. - "sentKBytesPerSec": 0.0, # Optional. Sent - network bytes. - "throughput": 0.0, # Optional. Throughput. - "transaction": "str" # Optional. Transaction - name. - } - }, - "vusers": 0 # Optional. Number of virtual users, for which - test has been run. - } - ], - "nextLink": "str" # Optional. Link for the next list of resources in case of - paginated results, if applicable. - } - """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls = kwargs.pop("cls", None) # type: ClsType[JSON] - - request = build_test_run_list_test_runs_request( - order_by=order_by, - continuation_token_parameter=continuation_token_parameter, - search=search, - execution_from=execution_from, - execution_to=execution_to, - status=status, - max_page_size=max_page_size, - test_id=test_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) - - return cast(JSON, deserialized) - - @distributed_trace - def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: - """Stop test run by name. - - Stop test run by name. - - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. - :type test_run_id: str - :return: JSON object - :rtype: JSON + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: Example: @@ -4852,11 +4969,17 @@ def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == { - "createdBy": "str", # Optional. The user that created the test run. + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. "createdDateTime": "2020-02-20 00:00:00", # Optional. The created - DateTime(ISO 8601 literal format) of the test run. + DateTime(ISO 8601 literal format) of the test model. "description": "str", # Optional. The test run description. - "displayName": "str", # Optional. Display name of a test run. + "displayName": "str", # Optional. Display name of a testRun. "duration": 0, # Optional. Test run duration in milliseconds. "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end DateTime(ISO 8601 literal format). @@ -4864,45 +4987,59 @@ def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "str": "str" # Optional. Environment variables which are defined as a set of pairs. }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated time. - "lastModifiedBy": "str", # Optional. The user that updated the test run. - "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last updated - DateTime(ISO 8601 literal format) of the test run. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. "loadTestConfig": { "engineInstances": 0, # Optional. The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. + }, + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. "splitAllCSVs": bool # Optional. Whether all the input CSV files should be split evenly across all engines. }, "passFailCriteria": { "passFailMetrics": { "str": { - "action": "str", # Optional. Either "u2018stop"u2019 - or "u2018continue"u2019 after the threshold is met. Default is - "u2018continue"u2019. + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". "actualValue": 0.0, # Optional. The actual value of the client metric for the test run. "aggregate": "str", # Optional. The aggregation function to be applied on the client metric. Allowed functions - - "u2018percentage"u2019 - for error metric ,"u2018avg"u2019, + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - - for requests. + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". "clientmetric": "str", # Optional. The client metric - on which the criteria should be applied. Allowed values - - "u2018response_time_ms"u2019 , "u2018latency"u2019, - "u2018error"u2019, "u2018requests"u2019, - "u2018requests_per_sec"u2019. + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". "condition": "str", # Optional. The comparison - operator. Supported types "u2018>"u2019. + operator. Supported types "u2018>"u2019, "u2018<"u2019. "requestName": "str", # Optional. Request name for which the Pass fail criteria has to be applied. "result": "str", # Optional. Outcome of the test - run. possible outcome - "u2018passed"u2019 , "u2018failed"u2019 , - "u2018undetermined"u2019. + run. Known values are: "passed", "undetermined", and "failed". "value": 0.0 # Optional. The value to compare with the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- % "u2019, response_time_ms and latency : any integer value unit- ms. @@ -4910,18 +5047,23 @@ def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: } }, "portalUrl": "str", # Optional. Portal url. - "resourceId": "str", # Optional. Load test resource Id. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. "secrets": { "str": { - "type": "str", # Optional. Type of secret. eg. - AKV_SECRET_URI/SECRET_VALUE. - "value": "str" # Optional. The value of the secret, of type - AKV_SECRET_URI or SECRET_VALUE. + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. } }, "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start DateTime(ISO 8601 literal format). - "status": "str", # Optional. The test run status. + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". "subnetId": "str", # Optional. Subnet ID on which the load test instances should run. "testArtifacts": { @@ -4932,64 +5074,73 @@ def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer - representation of the file type (0 = JMX_FILE, 1 = - USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). Known values are: 0, - 1, and 2. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. - Validation status of the file. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } ], "configUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "inputArtifactsZipFileurl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "testScriptUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "userPropUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } }, "outputArtifacts": { @@ -4997,32 +5148,35 @@ def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". }, "resultUrl": { "expireTime": "2020-02-20 00:00:00", # Optional. Expiry time of the file. "fileId": "str", # Optional. File unique identifier. - "fileType": 0, # Optional. Integer representation of - the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = - ADDITIONAL_ARTIFACTS). Known values are: 0, 1, and 2. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". "filename": "str", # Optional. Name of the file. "url": "str", # Optional. File URL. "validationStatus": "str" # Optional. Validation - status of the file. + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } } }, "testId": "str", # Optional. Associated test Id. "testResult": "str", # Optional. Test result for pass/Fail criteria used - during the test run. possible outcome - "u2018Passed"u2019 , "u2018Failed"u2019 , - "u2018Not Applicable"u2019. + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". "testRunId": "str", # Optional. Unique test run name as identifier. "testRunStatistics": { "str": { @@ -5038,7 +5192,7 @@ def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: "receivedKBytesPerSec": 0.0, # Optional. Received network bytes. "sampleCount": 0.0, # Optional. Sampler count. - "sentKBytesPerSec": 0.0, # Optional. Sent network bytes. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. "throughput": 0.0, # Optional. Throughput. "transaction": "str" # Optional. Transaction name. } @@ -5047,61 +5201,95 @@ def stop_test_run(self, test_run_id: str, **kwargs: Any) -> JSON: run. } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_stop_test_run_request( - test_run_id=test_run_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + error_map.update(kwargs.pop("error_map", {}) or {}) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) + def prepare_request(next_link=None): + if not next_link: + + request = build_test_run_list_request( + order_by=order_by, + continuation_token_parameter=continuation_token_parameter, + search=search, + execution_from=execution_from, + execution_to=execution_to, + status=status, + test_id=self._config.test_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - response = pipeline_response.http_response + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "Endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + return request - if response.content: - deserialized = response.json() - else: - deserialized = None + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = deserialized["value"] + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.get("nextLink", None), iter(list_of_elem) - if cls: - return cls(pipeline_response, cast(JSON, deserialized), {}) + def get_next(next_link=None): + request = prepare_request(next_link) - return cast(JSON, deserialized) + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response - @overload - def get_test_run_client_metrics( - self, test_run_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Get all client metrics for a load test run. + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def stop(self, test_run_id: str, **kwargs: Any) -> JSON: + """Stop test run by name. - Get all client metrics for a load test run. + Stop test run by name. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param body: Client metrics request model. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -5109,91 +5297,293 @@ def get_test_run_client_metrics( Example: .. code-block:: python - # JSON input template you can fill out and use as your body input. - body = { - "endTime": "2020-02-20 00:00:00", # End time. Required. - "startTime": "2020-02-20 00:00:00", # Start time. Required. - "errors": [ - "str" # Optional. List of errors, maximum supported errors for - queries are 20. In case of empty, by default will return metrics for maximum - 20 errors. - ], - "groupByInterval": "str", # Optional. For test duration less than 10 minutes - group by time interval can be any one of 5s,10s,1m,5m.""n""nFor test duration - greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. - Default value is 1m. - "percentiles": [ - "str" # Optional. List of percentiles values for response time, - supported values 50,90,99,95. Default value is 50th percentile. - ], - "requestSamplers": [ - "str" # Optional. List of request samplers, maximum supported - samplers for queries are 20. In case of empty, it will return metrics for - maximum 20 samplers. - ] - } - # response body for status code(s): 200 response == { - "testRunId": "str", # Optional. Test run name for which client metrics - results is required. - "timeSeries": { - "activeUsers": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "errors": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] + "certificate": { + "name": "str", # Optional. Name of the certificate. + "type": "str", # Optional. Type of certificate. "AKV_CERT_URI" + "value": "str" # Optional. The value of the certificate for + respective type. + }, + "createdBy": "str", # Optional. The user that created the test model. + "createdDateTime": "2020-02-20 00:00:00", # Optional. The created + DateTime(ISO 8601 literal format) of the test model. + "description": "str", # Optional. The test run description. + "displayName": "str", # Optional. Display name of a testRun. + "duration": 0, # Optional. Test run duration in milliseconds. + "endDateTime": "2020-02-20 00:00:00", # Optional. The test run end + DateTime(ISO 8601 literal format). + "environmentVariables": { + "str": "str" # Optional. Environment variables which are defined as + a set of pairs. + }, + "errorDetails": [ + { + "message": "str" # Optional. Error details in case test run + was not successfully run. + } + ], + "executedDateTime": "2020-02-20 00:00:00", # Optional. Test run initiated + time. + "lastModifiedBy": "str", # Optional. The user that last modified the test + model. + "lastModifiedDateTime": "2020-02-20 00:00:00", # Optional. The last Modified + DateTime(ISO 8601 literal format) of the test model. + "loadTestConfig": { + "engineInstances": 0, # Optional. The number of engine instances to + execute load test. Supported values are in range of 1-45. Required for + creating a new test. + "optionalLoadTestConfig": { + "duration": 0, # Optional. duration. + "endpointUrl": "str", # Optional. Endpoint url. + "rampUpTime": 0, # Optional. ramp up time. + "vusers": 0 # Optional. No of virtual users. }, - "responseTime": { - "str": [ + "quickStartTest": bool, # Optional. If true, optionalLoadTestConfig + is required and JMX script for the load test is not required to upload. + "splitAllCSVs": bool # Optional. Whether all the input CSV files + should be split evenly across all engines. + }, + "passFailCriteria": { + "passFailMetrics": { + "str": { + "action": "str", # Optional. Action taken after the + threshold is met. Default is "u2018continue"u2019. Known values are: + "stop" and "continue". + "actualValue": 0.0, # Optional. The actual value of + the client metric for the test run. + "aggregate": "str", # Optional. The aggregation + function to be applied on the client metric. Allowed functions - + "u2018percentage"u2019 - for error metric , "u2018avg"u2019, + "u2018p50"u2019, "u2018p90"u2019, "u2018p95"u2019, "u2018p99"u2019, + "u2018min"u2019, "u2018max"u2019 - for response_time_ms and latency + metric, "u2018avg"u2019 - for requests_per_sec, "u2018count"u2019 - + for requests. Known values are: "count", "percentage", "avg", "p50", + "p90", "p95", "p99", "min", and "max". + "clientmetric": "str", # Optional. The client metric + on which the criteria should be applied. Known values are: + "response_time_ms", "latency", "error", "requests", and + "requests_per_sec". + "condition": "str", # Optional. The comparison + operator. Supported types "u2018>"u2019, "u2018<"u2019. + "requestName": "str", # Optional. Request name for + which the Pass fail criteria has to be applied. + "result": "str", # Optional. Outcome of the test + run. Known values are: "passed", "undetermined", and "failed". + "value": 0.0 # Optional. The value to compare with + the client metric. Allowed values - "u2018error : [0.0 , 100.0] unit- + % "u2019, response_time_ms and latency : any integer value unit- ms. + } + } + }, + "portalUrl": "str", # Optional. Portal url. + "resourceId": "str", # Optional. Fully qualified resource Id e.g + /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + "secrets": { + "str": { + "type": "str", # Optional. Type of secret. Known values are: + "AKV_SECRET_URI" and "SECRET_VALUE". + "value": "str" # Optional. The value of the secret for the + respective type. + } + }, + "startDateTime": "2020-02-20 00:00:00", # Optional. The test run start + DateTime(ISO 8601 literal format). + "status": "str", # Optional. The test run status. Known values are: + "ACCEPTED", "NOTSTARTED", "PROVISIONING", "PROVISIONED", "CONFIGURING", + "CONFIGURED", "EXECUTING", "EXECUTED", "DEPROVISIONING", "DEPROVISIONED", "DONE", + "CANCELLING", "CANCELLED", "FAILED", "VALIDATION_SUCCESS", and + "VALIDATION_FAILURE". + "subnetId": "str", # Optional. Subnet ID on which the load test instances + should run. + "testArtifacts": { + "inputArtifacts": { + "additionalUrls": [ { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. + "expireTime": "2020-02-20 00:00:00", # + Optional. Expiry time of the file. + "fileId": "str", # Optional. File unique + identifier. + "fileType": "str", # Optional. File type. + Known values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the + file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. + Validation status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". } - ] + ], + "configUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "inputArtifactsZipFileurl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "testScriptUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "userPropUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + } }, - "throughput": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] + "outputArtifacts": { + "logsUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + }, + "resultUrl": { + "expireTime": "2020-02-20 00:00:00", # Optional. + Expiry time of the file. + "fileId": "str", # Optional. File unique identifier. + "fileType": "str", # Optional. File type. Known + values are: "JMX_FILE", "USER_PROPERTIES", and + "ADDITIONAL_ARTIFACTS". + "filename": "str", # Optional. Name of the file. + "url": "str", # Optional. File URL. + "validationStatus": "str" # Optional. Validation + status of the file. Known values are: "NOT_VALIDATED", + "VALIDATION_SUCCESS", "VALIDATION_FAILURE", and + "VALIDATION_INITIATED". + } } - } + }, + "testId": "str", # Optional. Associated test Id. + "testResult": "str", # Optional. Test result for pass/Fail criteria used + during the test run. Known values are: "PASSED", "NOT_APPLICABLE", and "FAILED". + "testRunId": "str", # Optional. Unique test run name as identifier. + "testRunStatistics": { + "str": { + "errorCount": 0.0, # Optional. Error count. + "errorPct": 0.0, # Optional. Error percentage. + "maxResTime": 0.0, # Optional. Max response time. + "meanResTime": 0.0, # Optional. Mean response time. + "medianResTime": 0.0, # Optional. Median response time. + "minResTime": 0.0, # Optional. Minimum response time. + "pct1ResTime": 0.0, # Optional. 90 percentile response time. + "pct2ResTime": 0.0, # Optional. 95 percentile response time. + "pct3ResTime": 0.0, # Optional. 99 percentile response time. + "receivedKBytesPerSec": 0.0, # Optional. Received network + bytes. + "sampleCount": 0.0, # Optional. Sampler count. + "sentKBytesPerSec": 0.0, # Optional. Send network bytes. + "throughput": 0.0, # Optional. Throughput. + "transaction": "str" # Optional. Transaction name. + } + }, + "vusers": 0 # Optional. Number of virtual users, for which test has been + run. } """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def get_test_run_client_metrics( - self, test_run_id: str, body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - """Get all client metrics for a load test run. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_test_run_stop_request( + test_run_id=test_run_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) + + @distributed_trace + def metric_namespaces(self, test_run_id: str, **kwargs: Any) -> JSON: + """Lists the metric namespaces for a load test run. - Get all client metrics for a load test run. + Lists the metric namespaces for a load test run. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param body: Client metrics request model. Required. - :type body: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -5203,63 +5593,70 @@ def get_test_run_client_metrics( # response body for status code(s): 200 response == { - "testRunId": "str", # Optional. Test run name for which client metrics - results is required. - "timeSeries": { - "activeUsers": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "errors": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "responseTime": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "throughput": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] + "value": [ + { + "metricNamespaceName": "str", # Optional. The fully + qualified metric namespace name. + "name": "str" # Optional. The escaped name of the namespace. } - } + ] } """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + request = build_test_run_metric_namespaces_request( + test_run_id=test_run_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) + + return cast(JSON, deserialized) @distributed_trace - def get_test_run_client_metrics(self, test_run_id: str, body: Union[JSON, IO], **kwargs: Any) -> JSON: - """Get all client metrics for a load test run. + def metric_definitions(self, test_run_id: str, *, metricnamespace: str, **kwargs: Any) -> JSON: + """Lists the metric definitions for a load test run. - Get all client metrics for a load test run. + Lists the metric definitions for a load test run. - :param test_run_id: Unique name of the load test run, must be a valid URL character - ^[a-z0-9_-]*$. Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str - :param body: Client metrics request model. Is either a model type or a IO type. Required. - :type body: JSON or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -5269,71 +5666,65 @@ def get_test_run_client_metrics(self, test_run_id: str, body: Union[JSON, IO], * # response body for status code(s): 200 response == { - "testRunId": "str", # Optional. Test run name for which client metrics - results is required. - "timeSeries": { - "activeUsers": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "errors": { - "str": [ - { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. - } - ] - }, - "responseTime": { - "str": [ + "value": [ + { + "dimensions": [ { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. + "localizedValue": "str", # Optional. The + locale specific value. + "value": "str" # Optional. The invariant + value. } - ] - }, - "throughput": { - "str": [ + ], + "displayDescription": "str", # Optional. Detailed + description of this metric. + "metricAvailabilities": [ { - "timestamp": "2020-02-20 00:00:00", # - Optional. Timestamp(ISO 8601 literal format). - "value": 0.0 # Optional. Value at timestamp. + "timeGrain": "str" # Optional. The time + grain specifies the aggregation interval for the metric. + Expressed as a duration 'PT1M', 'PT1H', etc. Known values are: + "PT5S", "PT10S", "PT1M", "PT5M", and "PT1H". } - ] + ], + "name": { + "localizedValue": "str", # Optional. The locale + specific value. + "value": "str" # Optional. The invariant value. + }, + "namespace": "str", # Optional. The namespace the metric + belongs to. + "primaryAggregationType": "str", # Optional. the primary + aggregation type value defining how to use the values for display. Known + values are: "Average", "Count", "Minimum", "Maximum", "None", "Total", + "Percentile90", "Percentile95", and "Percentile99". + "supportedAggregationTypes": [ + "str" # Optional. the collection of what aggregation + types are supported. + ], + "unit": "str" # Optional. The unit of the metric. Known + values are: "NotSpecified", "Percent", "Count", "Seconds", + "Milliseconds", "Bytes", "BytesPerSecond", and "CountPerSecond". } - } + ] } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[JSON] - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IO, bytes)): - _content = body - else: - _json = body - - request = build_test_run_get_test_run_client_metrics_request( + request = build_test_run_metric_definitions_request( test_run_id=test_run_id, - content_type=content_type, + metricnamespace=metricnamespace, api_version=self._config.api_version, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -5362,15 +5753,296 @@ def get_test_run_client_metrics(self, test_run_id: str, body: Union[JSON, IO], * return cast(JSON, deserialized) + @overload + def metrics( + self, + test_run_id: str, + body: Optional[JSON] = None, + *, + metricname: str, + metricnamespace: str, + result_type: str, + timespan: str, + aggregation: Optional[str] = None, + interval: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Lists the metric values for a load test run. + + Lists the metric values for a load test run. + + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. + :type test_run_id: str + :param body: Default value is None. + :type body: JSON + :keyword metricname: Metric name. Required. + :paramtype metricname: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str + :keyword result_type: Reduces the set of data collected. The syntax allowed depends on the + operation. See the operation's description for details. Known values are: "Data" and + "Metadata". Required. + :paramtype result_type: str + :keyword timespan: The timespan of the query. It is a string with the following format + 'startDateTime_ISO/endDateTime_ISO'. Required. + :paramtype timespan: str + :keyword aggregation: The list of aggregation types (comma separated) to retrieve. Default + value is None. + :paramtype aggregation: str + :keyword interval: The interval (i.e. timegrain) of the query. Known values are: "PT5S", + "PT10S", "PT1M", "PT5M", and "PT1H". Default value is None. + :paramtype interval: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filters": [ + { + "name": "str", # Optional. The invariant metadata name. + "values": [ + "str" # Optional. The metadata values. Maximum + values can be 20. + ] + } + ] + } + + # response body for status code(s): 200 + response == { + "interval": "str", # Optional. The interval (window size) for which the + metric data was returned in. This may be adjusted in the future and returned back + from what was originally requested. This is not present if a metadata request was + made. + "namespace": "str", # Optional. The namespace of the metrics being queried. + "timespan": "str", # Optional. The timespan for which the data was + retrieved. Its value consists of two datetimes concatenated, separated by '/'. + This may be adjusted in the future and returned back from what was originally + requested. + "value": { + "displayDescription": "str", # Optional. Detailed description of + this metric. + "id": "str", # Optional. The Metric Id. + "name": { + "localizedValue": "str", # Optional. The locale specific + value. + "value": "str" # Optional. The invariant value. + }, + "timeseries": [ + { + "data": [ + { + "average": 0.0, # Optional. The + average value in the time range. + "count": 0.0, # Optional. The number + of samples in the time range. Can be used to determine the + number of values that contributed to the average value. + "maximum": 0.0, # Optional. The + greatest value in the time range. + "minimum": 0.0, # Optional. The + least value in the time range. + "percentile90": 0.0, # Optional. + 90th percentile value in the time range. + "percentile95": 0.0, # Optional. + 95th percentile value in the time range. + "percentile99": 0.0, # Optional. + 99th percentile value in the time range. + "timeStamp": "str", # Optional. The + timestamp for the metric value in ISO 8601 format. + "total": 0.0 # Optional. The sum of + all of the values in the time range. + } + ], + "metadatavalues": [ + { + "name": { + "localizedValue": "str", # + Optional. The locale specific value. + "value": "str" # Optional. + The invariant value. + }, + "value": "str" # Optional. The value + of the metadata. + } + ] + } + ], + "unit": "str" # Optional. The unit of the metric. Known values are: + "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", + "BytesPerSecond", and "CountPerSecond". + } + } + """ + + @overload + def metrics( + self, + test_run_id: str, + body: Optional[IO] = None, + *, + metricname: str, + metricnamespace: str, + result_type: str, + timespan: str, + aggregation: Optional[str] = None, + interval: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Lists the metric values for a load test run. + + Lists the metric values for a load test run. + + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. + :type test_run_id: str + :param body: Default value is None. + :type body: IO + :keyword metricname: Metric name. Required. + :paramtype metricname: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str + :keyword result_type: Reduces the set of data collected. The syntax allowed depends on the + operation. See the operation's description for details. Known values are: "Data" and + "Metadata". Required. + :paramtype result_type: str + :keyword timespan: The timespan of the query. It is a string with the following format + 'startDateTime_ISO/endDateTime_ISO'. Required. + :paramtype timespan: str + :keyword aggregation: The list of aggregation types (comma separated) to retrieve. Default + value is None. + :paramtype aggregation: str + :keyword interval: The interval (i.e. timegrain) of the query. Known values are: "PT5S", + "PT10S", "PT1M", "PT5M", and "PT1H". Default value is None. + :paramtype interval: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "interval": "str", # Optional. The interval (window size) for which the + metric data was returned in. This may be adjusted in the future and returned back + from what was originally requested. This is not present if a metadata request was + made. + "namespace": "str", # Optional. The namespace of the metrics being queried. + "timespan": "str", # Optional. The timespan for which the data was + retrieved. Its value consists of two datetimes concatenated, separated by '/'. + This may be adjusted in the future and returned back from what was originally + requested. + "value": { + "displayDescription": "str", # Optional. Detailed description of + this metric. + "id": "str", # Optional. The Metric Id. + "name": { + "localizedValue": "str", # Optional. The locale specific + value. + "value": "str" # Optional. The invariant value. + }, + "timeseries": [ + { + "data": [ + { + "average": 0.0, # Optional. The + average value in the time range. + "count": 0.0, # Optional. The number + of samples in the time range. Can be used to determine the + number of values that contributed to the average value. + "maximum": 0.0, # Optional. The + greatest value in the time range. + "minimum": 0.0, # Optional. The + least value in the time range. + "percentile90": 0.0, # Optional. + 90th percentile value in the time range. + "percentile95": 0.0, # Optional. + 95th percentile value in the time range. + "percentile99": 0.0, # Optional. + 99th percentile value in the time range. + "timeStamp": "str", # Optional. The + timestamp for the metric value in ISO 8601 format. + "total": 0.0 # Optional. The sum of + all of the values in the time range. + } + ], + "metadatavalues": [ + { + "name": { + "localizedValue": "str", # + Optional. The locale specific value. + "value": "str" # Optional. + The invariant value. + }, + "value": "str" # Optional. The value + of the metadata. + } + ] + } + ], + "unit": "str" # Optional. The unit of the metric. Known values are: + "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", + "BytesPerSecond", and "CountPerSecond". + } + } + """ + @distributed_trace - def get_test_run_client_metrics_filters(self, test_run_id: str, **kwargs: Any) -> JSON: - """Get all filters that are supported for client metrics for a given load test run. + def metrics( + self, + test_run_id: str, + body: Optional[Union[JSON, IO]] = None, + *, + metricname: str, + metricnamespace: str, + result_type: str, + timespan: str, + aggregation: Optional[str] = None, + interval: Optional[str] = None, + **kwargs: Any + ) -> JSON: + """Lists the metric values for a load test run. - Get all filters that are supported for client metrics for a given load test run. + Lists the metric values for a load test run. - :param test_run_id: Unique name for load test run, must be a valid URL character ^[a-z0-9_-]*$. - Required. + :param test_run_id: Unique name for the load test run, must contain only lower-case alphabetic, + numeric, underscore or hyphen characters. Required. :type test_run_id: str + :param body: Is either a model type or a IO type. Default value is None. + :type body: JSON or IO + :keyword metricname: Metric name. Required. + :paramtype metricname: str + :keyword metricnamespace: Metric namespace to query metric definitions for. Required. + :paramtype metricnamespace: str + :keyword result_type: Reduces the set of data collected. The syntax allowed depends on the + operation. See the operation's description for details. Known values are: "Data" and + "Metadata". Required. + :paramtype result_type: str + :keyword timespan: The timespan of the query. It is a string with the following format + 'startDateTime_ISO/endDateTime_ISO'. Required. + :paramtype timespan: str + :keyword aggregation: The list of aggregation types (comma separated) to retrieve. Default + value is None. + :paramtype aggregation: str + :keyword interval: The interval (i.e. timegrain) of the query. Known values are: "PT5S", + "PT10S", "PT1M", "PT5M", and "PT1H". Default value is None. + :paramtype interval: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -5380,37 +6052,106 @@ def get_test_run_client_metrics_filters(self, test_run_id: str, **kwargs: Any) - # response body for status code(s): 200 response == { - "filters": { - "errorFiltersValues": [ - "str" # Optional. List of errors occurred for the test run, - for which client metrics can be filtered. + "interval": "str", # Optional. The interval (window size) for which the + metric data was returned in. This may be adjusted in the future and returned back + from what was originally requested. This is not present if a metadata request was + made. + "namespace": "str", # Optional. The namespace of the metrics being queried. + "timespan": "str", # Optional. The timespan for which the data was + retrieved. Its value consists of two datetimes concatenated, separated by '/'. + This may be adjusted in the future and returned back from what was originally + requested. + "value": { + "displayDescription": "str", # Optional. Detailed description of + this metric. + "id": "str", # Optional. The Metric Id. + "name": { + "localizedValue": "str", # Optional. The locale specific + value. + "value": "str" # Optional. The invariant value. + }, + "timeseries": [ + { + "data": [ + { + "average": 0.0, # Optional. The + average value in the time range. + "count": 0.0, # Optional. The number + of samples in the time range. Can be used to determine the + number of values that contributed to the average value. + "maximum": 0.0, # Optional. The + greatest value in the time range. + "minimum": 0.0, # Optional. The + least value in the time range. + "percentile90": 0.0, # Optional. + 90th percentile value in the time range. + "percentile95": 0.0, # Optional. + 95th percentile value in the time range. + "percentile99": 0.0, # Optional. + 99th percentile value in the time range. + "timeStamp": "str", # Optional. The + timestamp for the metric value in ISO 8601 format. + "total": 0.0 # Optional. The sum of + all of the values in the time range. + } + ], + "metadatavalues": [ + { + "name": { + "localizedValue": "str", # + Optional. The locale specific value. + "value": "str" # Optional. + The invariant value. + }, + "value": "str" # Optional. The value + of the metadata. + } + ] + } ], - "requestSamplerValues": [ - "str" # Optional. List of request sampler for the test run, - for which client metrics can be filtered. - ] - }, - "testRunId": "str", # Optional. Test run name for which client metrics - filters is required. - "timeRange": { - "endTime": "2020-02-20 00:00:00", # Optional. end DateTime(ISO 8601 - literal format) for the requested client metrics filter. - "startTime": "2020-02-20 00:00:00" # Optional. start DateTime(ISO - 8601 literal format) for the requested client metrics filter. + "unit": "str" # Optional. The unit of the metric. Known values are: + "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", + "BytesPerSecond", and "CountPerSecond". } } """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_test_run_get_test_run_client_metrics_filters_request( + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + request = build_test_run_metrics_request( test_run_id=test_run_id, + metricname=metricname, + metricnamespace=metricnamespace, + result_type=result_type, + timespan=timespan, + aggregation=aggregation, + interval=interval, + content_type=content_type, api_version=self._config.api_version, + json=_json, + content=_content, headers=_headers, params=_params, ) diff --git a/sdk/loadtestservice/azure-developer-loadtesting/setup.py b/sdk/loadtestservice/azure-developer-loadtesting/setup.py index 2027d6df4227..4c2b6eda369e 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/setup.py +++ b/sdk/loadtestservice/azure-developer-loadtesting/setup.py @@ -13,7 +13,7 @@ PACKAGE_NAME = "azure-developer-loadtesting" -PACKAGE_PPRINT_NAME = "Azure Developer LoadTesting" +PACKAGE_PPRINT_NAME = "None" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace("-", "/") @@ -29,7 +29,7 @@ setup( name=PACKAGE_NAME, version=version, - description="Microsoft Azure Developer LoadTesting Client Library for Python", + description="Microsoft None Client Library for Python", long_description=open("README.md", "r").read(), long_description_content_type="text/markdown", license="MIT License", diff --git a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md index 64dcdc29e756..f4d3d678ac00 100644 --- a/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md +++ b/sdk/loadtestservice/azure-developer-loadtesting/swagger/README.md @@ -1,49 +1,14 @@ +# autorest configuration for Python + ### Settings -```yaml -input-file: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/loadtestservice/data-plane/Microsoft.LoadTestService/preview/2022-06-01-preview/loadtestservice.json -output-folder: ../ +``` yaml +license-header: MICROSOFT_MIT_NO_VERSION namespace: azure.developer.loadtesting +output-folder: ../ +package-mode: dataplane package-name: azure-developer-loadtesting -license-header: MICROSOFT_MIT_NO_VERSION -title: LoadTestingClient package-version: 1.0.0b1 -package-mode: dataplane -package-pprint-name: Azure Developer LoadTesting -security: AADToken -security-scopes: https://loadtest.azure-dev.com/.default -directive: - - from: swagger-document - where: $["paths"]["/serverMetricsConfig/supportedResourceTypes"].get - transform: $["operationId"] = "ServerMetrics_ListSupportedResourceTypes" - - from: swagger-document - where: $["paths"]["/testruns/sortAndFilter"].get - transform: $["operationId"] = "TestRun_ListTestRuns" - - from: swagger-document - where: $["paths"]["/serverMetricsConfig"].get - transform: $["operationId"] = "ServerMetrics_ListGetServerMetrics" - - from: swagger-document - where: $["paths"]["/appcomponents/{name}"].delete - transform: $["operationId"] = "AppComponent_DeleteAppComponents" - - from: swagger-document - where: $["paths"]["/loadtests/{testId}/files"].get - transform: $["operationId"] = "Test_ListTestFiles" - - from: swagger-document - where: $["paths"]["/testruns/sortAndFilter"].get - transform: $["operationId"] = "TestRun_ListTestRuns" - - from: swagger-document - where: $["paths"]["/testruns/{testRunId}"].patch - transform: $["operationId"] = "TestRun_CreateOrUpdateTest" - - from: swagger-document - where: $["paths"]["/serverMetricsConfig/{name}"].get - transform: $["operationId"] = "ServerMetrics_GetServerMetricsConfigByName" - - from: swagger-document - where: $["paths"]["/serverMetricsConfig/{name}"].delete - transform: $["operationId"] = "ServerMetrics_DeleteServerMetricsConfig" - - from: swagger-document - where: $["paths"]["/serverMetricsConfig"].get - transform: $["operationId"] = "ServerMetrics_GetServerMetricsConfig" - - from: swagger-document - where: $["paths"]["/serverMetricsConfig/default"].get - transform: $["operationId"] = "ServerMetrics_GetServerDefaultMetricsConfig" +require: +- ../../../../../azure-rest-api-specs/specification/loadtestservice/data-plane/readme.md ```