azure-developer-loadtesting 1.0.0__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. azure-developer-loadtesting-1.0.0/CHANGELOG.md +72 -0
  2. azure-developer-loadtesting-1.0.0/LICENSE +21 -0
  3. azure-developer-loadtesting-1.0.0/MANIFEST.in +7 -0
  4. azure-developer-loadtesting-1.0.0/PKG-INFO +281 -0
  5. azure-developer-loadtesting-1.0.0/README.md +258 -0
  6. azure-developer-loadtesting-1.0.0/azure/__init__.py +1 -0
  7. azure-developer-loadtesting-1.0.0/azure/developer/__init__.py +1 -0
  8. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/__init__.py +10 -0
  9. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_client.py +97 -0
  10. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/__init__.py +26 -0
  11. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/_client.py +88 -0
  12. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/_configuration.py +71 -0
  13. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/_patch.py +24 -0
  14. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/_serialization.py +1996 -0
  15. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/_vendor.py +20 -0
  16. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/_version.py +9 -0
  17. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/__init__.py +23 -0
  18. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/_client.py +88 -0
  19. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/_configuration.py +71 -0
  20. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/_patch.py +23 -0
  21. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/_vendor.py +17 -0
  22. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/operations/__init__.py +21 -0
  23. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/operations/_operations.py +6517 -0
  24. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/aio/operations/_patch.py +187 -0
  25. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/operations/__init__.py +21 -0
  26. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/operations/_operations.py +7242 -0
  27. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_generated/operations/_patch.py +195 -0
  28. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/_version.py +6 -0
  29. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/aio/__init__.py +9 -0
  30. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/aio/_client.py +107 -0
  31. azure-developer-loadtesting-1.0.0/azure/developer/loadtesting/py.typed +1 -0
  32. azure-developer-loadtesting-1.0.0/azure_developer_loadtesting.egg-info/PKG-INFO +281 -0
  33. azure-developer-loadtesting-1.0.0/azure_developer_loadtesting.egg-info/SOURCES.txt +52 -0
  34. azure-developer-loadtesting-1.0.0/azure_developer_loadtesting.egg-info/dependency_links.txt +1 -0
  35. azure-developer-loadtesting-1.0.0/azure_developer_loadtesting.egg-info/not-zip-safe +1 -0
  36. azure-developer-loadtesting-1.0.0/azure_developer_loadtesting.egg-info/requires.txt +5 -0
  37. azure-developer-loadtesting-1.0.0/azure_developer_loadtesting.egg-info/top_level.txt +1 -0
  38. azure-developer-loadtesting-1.0.0/pyproject.toml +6 -0
  39. azure-developer-loadtesting-1.0.0/samples/begin_test_run.py +52 -0
  40. azure-developer-loadtesting-1.0.0/samples/create_or_update_app_components.py +57 -0
  41. azure-developer-loadtesting-1.0.0/samples/create_or_update_test_function.py +84 -0
  42. azure-developer-loadtesting-1.0.0/samples/delete_load_test_function.py +46 -0
  43. azure-developer-loadtesting-1.0.0/samples/delete_load_test_run.py +39 -0
  44. azure-developer-loadtesting-1.0.0/samples/get_metrics.py +64 -0
  45. azure-developer-loadtesting-1.0.0/samples/upload_test_file.py +45 -0
  46. azure-developer-loadtesting-1.0.0/setup.cfg +4 -0
  47. azure-developer-loadtesting-1.0.0/setup.py +71 -0
  48. azure-developer-loadtesting-1.0.0/tests/conftest.py +60 -0
  49. azure-developer-loadtesting-1.0.0/tests/test_admin_ops.py +284 -0
  50. azure-developer-loadtesting-1.0.0/tests/test_async_admin_ops.py +286 -0
  51. azure-developer-loadtesting-1.0.0/tests/test_async_run_ops.py +286 -0
  52. azure-developer-loadtesting-1.0.0/tests/test_run_ops.py +289 -0
  53. azure-developer-loadtesting-1.0.0/tests/testcase.py +41 -0
  54. azure-developer-loadtesting-1.0.0/tests/testcase_async.py +26 -0
@@ -0,0 +1,20 @@
1
+ # --------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+ # Code generated by Microsoft (R) AutoRest Code Generator.
5
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
6
+ # --------------------------------------------------------------------------
7
+
8
+ from typing import List, cast
9
+
10
+
11
+ def _format_url_section(template, **kwargs):
12
+ components = template.split("/")
13
+ while components:
14
+ try:
15
+ return template.format(**kwargs)
16
+ except KeyError as key:
17
+ # Need the cast, as for some reasons "split" is typed as list[str | Any]
18
+ formatted_components = cast(List[str], template.split("/"))
19
+ components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
20
+ template = "/".join(components)
@@ -0,0 +1,9 @@
1
+ # coding=utf-8
2
+ # --------------------------------------------------------------------------
3
+ # Copyright (c) Microsoft Corporation. All rights reserved.
4
+ # Licensed under the MIT License. See License.txt in the project root for license information.
5
+ # Code generated by Microsoft (R) AutoRest Code Generator.
6
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ # --------------------------------------------------------------------------
8
+
9
+ VERSION = "1.0.0"
@@ -0,0 +1,23 @@
1
+ # coding=utf-8
2
+ # --------------------------------------------------------------------------
3
+ # Copyright (c) Microsoft Corporation. All rights reserved.
4
+ # Licensed under the MIT License. See License.txt in the project root for license information.
5
+ # Code generated by Microsoft (R) AutoRest Code Generator.
6
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ # --------------------------------------------------------------------------
8
+
9
+ from ._client import LoadTestingClient
10
+
11
+ try:
12
+ from ._patch import __all__ as _patch_all
13
+ from ._patch import * # pylint: disable=unused-wildcard-import
14
+ except ImportError:
15
+ _patch_all = []
16
+ from ._patch import patch_sdk as _patch_sdk
17
+
18
+ __all__ = [
19
+ "LoadTestingClient",
20
+ ]
21
+ __all__.extend([p for p in _patch_all if p not in __all__])
22
+
23
+ _patch_sdk()
@@ -0,0 +1,88 @@
1
+ # coding=utf-8
2
+ # --------------------------------------------------------------------------
3
+ # Copyright (c) Microsoft Corporation. All rights reserved.
4
+ # Licensed under the MIT License. See License.txt in the project root for license information.
5
+ # Code generated by Microsoft (R) AutoRest Code Generator.
6
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ # --------------------------------------------------------------------------
8
+
9
+ from copy import deepcopy
10
+ from typing import Any, Awaitable, TYPE_CHECKING
11
+
12
+ from azure.core import AsyncPipelineClient
13
+ from azure.core.rest import AsyncHttpResponse, HttpRequest
14
+
15
+ from .._serialization import Deserializer, Serializer
16
+ from ._configuration import LoadTestingClientConfiguration
17
+ from .operations import AdministrationOperations, TestRunOperations
18
+
19
+ if TYPE_CHECKING:
20
+ # pylint: disable=unused-import,ungrouped-imports
21
+ from azure.core.credentials_async import AsyncTokenCredential
22
+
23
+
24
+ class LoadTestingClient: # pylint: disable=client-accepts-api-version-keyword
25
+ """These APIs allow end users to create, view and run load tests using Azure Load Test Service.
26
+
27
+ :ivar administration: AdministrationOperations operations
28
+ :vartype administration:
29
+ azure.developer.loadtesting._generated.aio.operations.AdministrationOperations
30
+ :ivar test_run: TestRunOperations operations
31
+ :vartype test_run: azure.developer.loadtesting._generated.aio.operations.TestRunOperations
32
+ :param endpoint: URL to perform data plane API operations on the resource. Required.
33
+ :type endpoint: str
34
+ :param credential: Credential needed for the client to connect to Azure. Required.
35
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
36
+ :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
37
+ default value may result in unsupported behavior.
38
+ :paramtype api_version: str
39
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
40
+ Retry-After header is present.
41
+ """
42
+
43
+ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
44
+ _endpoint = "https://{Endpoint}"
45
+ self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
46
+ self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)
47
+
48
+ self._serialize = Serializer()
49
+ self._deserialize = Deserializer()
50
+ self._serialize.client_side_validation = False
51
+ self.administration = AdministrationOperations(self._client, self._config, self._serialize, self._deserialize)
52
+ self.test_run = TestRunOperations(self._client, self._config, self._serialize, self._deserialize)
53
+
54
+ def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
55
+ """Runs the network request through the client's chained policies.
56
+
57
+ >>> from azure.core.rest import HttpRequest
58
+ >>> request = HttpRequest("GET", "https://www.example.org/")
59
+ <HttpRequest [GET], url: 'https://www.example.org/'>
60
+ >>> response = await client.send_request(request)
61
+ <AsyncHttpResponse: 200 OK>
62
+
63
+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
64
+
65
+ :param request: The network request you want to make. Required.
66
+ :type request: ~azure.core.rest.HttpRequest
67
+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
68
+ :return: The response of your network call. Does not do error handling on your response.
69
+ :rtype: ~azure.core.rest.AsyncHttpResponse
70
+ """
71
+
72
+ request_copy = deepcopy(request)
73
+ path_format_arguments = {
74
+ "Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
75
+ }
76
+
77
+ request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
78
+ return self._client.send_request(request_copy, **kwargs)
79
+
80
+ async def close(self) -> None:
81
+ await self._client.close()
82
+
83
+ async def __aenter__(self) -> "LoadTestingClient":
84
+ await self._client.__aenter__()
85
+ return self
86
+
87
+ async def __aexit__(self, *exc_details: Any) -> None:
88
+ await self._client.__aexit__(*exc_details)
@@ -0,0 +1,71 @@
1
+ # coding=utf-8
2
+ # --------------------------------------------------------------------------
3
+ # Copyright (c) Microsoft Corporation. All rights reserved.
4
+ # Licensed under the MIT License. See License.txt in the project root for license information.
5
+ # Code generated by Microsoft (R) AutoRest Code Generator.
6
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ # --------------------------------------------------------------------------
8
+
9
+ import sys
10
+ from typing import Any, TYPE_CHECKING
11
+
12
+ from azure.core.configuration import Configuration
13
+ from azure.core.pipeline import policies
14
+
15
+ from .._version import VERSION
16
+
17
+ if sys.version_info >= (3, 8):
18
+ from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
19
+ else:
20
+ from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
21
+
22
+ if TYPE_CHECKING:
23
+ # pylint: disable=unused-import,ungrouped-imports
24
+ from azure.core.credentials_async import AsyncTokenCredential
25
+
26
+
27
+ class LoadTestingClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
28
+ """Configuration for LoadTestingClient.
29
+
30
+ Note that all parameters used to create this instance are saved as instance
31
+ attributes.
32
+
33
+ :param endpoint: URL to perform data plane API operations on the resource. Required.
34
+ :type endpoint: str
35
+ :param credential: Credential needed for the client to connect to Azure. Required.
36
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
37
+ :keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
38
+ default value may result in unsupported behavior.
39
+ :paramtype api_version: str
40
+ """
41
+
42
+ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
43
+ super(LoadTestingClientConfiguration, self).__init__(**kwargs)
44
+ api_version: Literal["2022-11-01"] = kwargs.pop("api_version", "2022-11-01")
45
+
46
+ if endpoint is None:
47
+ raise ValueError("Parameter 'endpoint' must not be None.")
48
+ if credential is None:
49
+ raise ValueError("Parameter 'credential' must not be None.")
50
+
51
+ self.endpoint = endpoint
52
+ self.credential = credential
53
+ self.api_version = api_version
54
+ self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"])
55
+ kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
56
+ self._configure(**kwargs)
57
+
58
+ def _configure(self, **kwargs: Any) -> None:
59
+ self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
60
+ self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
61
+ self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
62
+ self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
63
+ self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
64
+ self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
65
+ self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
66
+ self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
67
+ self.authentication_policy = kwargs.get("authentication_policy")
68
+ if self.credential and not self.authentication_policy:
69
+ self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(
70
+ self.credential, *self.credential_scopes, **kwargs
71
+ )
@@ -0,0 +1,23 @@
1
+ # ------------------------------------
2
+ # Copyright (c) Microsoft Corporation.
3
+ # Licensed under the MIT License.
4
+ # ------------------------------------
5
+ """Customize generated code here.
6
+
7
+ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8
+ """
9
+ from typing import List, TYPE_CHECKING
10
+
11
+ if TYPE_CHECKING:
12
+ # pylint: disable=unused-import,ungrouped-imports
13
+ pass
14
+ __all__: List[str] = [] # Add all objects you want publicly available to users at this package level
15
+
16
+
17
+ def patch_sdk():
18
+ """Do not remove from this file.
19
+
20
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
21
+ you can't accomplish using the techniques described in
22
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
23
+ """
@@ -0,0 +1,17 @@
1
+ # --------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+ # Code generated by Microsoft (R) AutoRest Code Generator.
5
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
6
+ # --------------------------------------------------------------------------
7
+
8
+
9
+ def raise_if_not_implemented(cls, abstract_methods):
10
+ not_implemented = [f for f in abstract_methods if not callable(getattr(cls, f, None))]
11
+ if not_implemented:
12
+ raise NotImplementedError(
13
+ "The following methods on operation group '{}' are not implemented: '{}'."
14
+ " Please refer to https://aka.ms/azsdk/python/dpcodegen/python/customize to learn how to customize.".format(
15
+ cls.__name__, "', '".join(not_implemented)
16
+ )
17
+ )
@@ -0,0 +1,21 @@
1
+ # coding=utf-8
2
+ # --------------------------------------------------------------------------
3
+ # Copyright (c) Microsoft Corporation. All rights reserved.
4
+ # Licensed under the MIT License. See License.txt in the project root for license information.
5
+ # Code generated by Microsoft (R) AutoRest Code Generator.
6
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ # --------------------------------------------------------------------------
8
+
9
+ from ._operations import AdministrationOperations
10
+ from ._operations import TestRunOperations
11
+
12
+ from ._patch import __all__ as _patch_all
13
+ from ._patch import * # pylint: disable=unused-wildcard-import
14
+ from ._patch import patch_sdk as _patch_sdk
15
+
16
+ __all__ = [
17
+ "AdministrationOperations",
18
+ "TestRunOperations",
19
+ ]
20
+ __all__.extend([p for p in _patch_all if p not in __all__])
21
+ _patch_sdk()