azure-developer-loadtesting 1.0.0__py3-none-any.whl
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.
- azure/developer/loadtesting/__init__.py +10 -0
- azure/developer/loadtesting/_client.py +97 -0
- azure/developer/loadtesting/_generated/__init__.py +26 -0
- azure/developer/loadtesting/_generated/_client.py +88 -0
- azure/developer/loadtesting/_generated/_configuration.py +71 -0
- azure/developer/loadtesting/_generated/_patch.py +24 -0
- azure/developer/loadtesting/_generated/_serialization.py +1996 -0
- azure/developer/loadtesting/_generated/_vendor.py +20 -0
- azure/developer/loadtesting/_generated/_version.py +9 -0
- azure/developer/loadtesting/_generated/aio/__init__.py +23 -0
- azure/developer/loadtesting/_generated/aio/_client.py +88 -0
- azure/developer/loadtesting/_generated/aio/_configuration.py +71 -0
- azure/developer/loadtesting/_generated/aio/_patch.py +23 -0
- azure/developer/loadtesting/_generated/aio/_vendor.py +17 -0
- azure/developer/loadtesting/_generated/aio/operations/__init__.py +21 -0
- azure/developer/loadtesting/_generated/aio/operations/_operations.py +6517 -0
- azure/developer/loadtesting/_generated/aio/operations/_patch.py +187 -0
- azure/developer/loadtesting/_generated/operations/__init__.py +21 -0
- azure/developer/loadtesting/_generated/operations/_operations.py +7242 -0
- azure/developer/loadtesting/_generated/operations/_patch.py +195 -0
- azure/developer/loadtesting/_version.py +6 -0
- azure/developer/loadtesting/aio/__init__.py +9 -0
- azure/developer/loadtesting/aio/_client.py +107 -0
- azure/developer/loadtesting/py.typed +1 -0
- azure_developer_loadtesting-1.0.0.dist-info/LICENSE +21 -0
- azure_developer_loadtesting-1.0.0.dist-info/METADATA +284 -0
- azure_developer_loadtesting-1.0.0.dist-info/RECORD +29 -0
- azure_developer_loadtesting-1.0.0.dist-info/WHEEL +5 -0
- azure_developer_loadtesting-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
+
# license information.
|
|
5
|
+
# --------------------------------------------------------------------------
|
|
6
|
+
from ._client import LoadTestAdministrationClient, LoadTestRunClient
|
|
7
|
+
from ._version import VERSION
|
|
8
|
+
|
|
9
|
+
__version__ = VERSION
|
|
10
|
+
__all__ = ["LoadTestAdministrationClient", "LoadTestRunClient"]
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
+
# license information.
|
|
5
|
+
# --------------------------------------------------------------------------
|
|
6
|
+
from copy import deepcopy
|
|
7
|
+
from typing import Any, TYPE_CHECKING
|
|
8
|
+
|
|
9
|
+
from azure.core import PipelineClient
|
|
10
|
+
from azure.core.rest import HttpRequest, HttpResponse
|
|
11
|
+
|
|
12
|
+
from ._generated._configuration import LoadTestingClientConfiguration
|
|
13
|
+
from ._generated._serialization import Deserializer, Serializer
|
|
14
|
+
from ._generated.operations import AdministrationOperations, TestRunOperations
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
# pylint: disable=unused-import,ungrouped-imports
|
|
18
|
+
from azure.core.credentials import TokenCredential
|
|
19
|
+
|
|
20
|
+
class _BaseClient:
|
|
21
|
+
def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
|
|
22
|
+
_endpoint = "https://{Endpoint}"
|
|
23
|
+
self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
|
|
24
|
+
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
|
|
25
|
+
|
|
26
|
+
self._serialize = Serializer()
|
|
27
|
+
self._deserialize = Deserializer()
|
|
28
|
+
self._serialize.client_side_validation = False
|
|
29
|
+
super().__init__(self._client, self._config, self._serialize, self._deserialize)
|
|
30
|
+
|
|
31
|
+
def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
|
|
32
|
+
"""Runs the network request through the client's chained policies.
|
|
33
|
+
|
|
34
|
+
>>> from azure.core.rest import HttpRequest
|
|
35
|
+
>>> request = HttpRequest("GET", "https://www.example.org/")
|
|
36
|
+
<HttpRequest [GET], url: 'https://www.example.org/'>
|
|
37
|
+
>>> response = client.send_request(request)
|
|
38
|
+
<HttpResponse: 200 OK>
|
|
39
|
+
|
|
40
|
+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
|
|
41
|
+
|
|
42
|
+
:param request: The network request you want to make. Required.
|
|
43
|
+
:type request: ~azure.core.rest.HttpRequest
|
|
44
|
+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
|
|
45
|
+
:return: The response of your network call. Does not do error handling on your response.
|
|
46
|
+
:rtype: ~azure.core.rest.HttpResponse
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
request_copy = deepcopy(request)
|
|
50
|
+
path_format_arguments = {
|
|
51
|
+
"Endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
|
|
55
|
+
return self._client.send_request(request_copy, **kwargs)
|
|
56
|
+
|
|
57
|
+
def close(self):
|
|
58
|
+
# type: () -> None
|
|
59
|
+
self._client.close()
|
|
60
|
+
|
|
61
|
+
def __exit__(self, *exc_details):
|
|
62
|
+
# type: (Any) -> None
|
|
63
|
+
self._client.__exit__(*exc_details)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class LoadTestAdministrationClient(_BaseClient, AdministrationOperations): # pylint: disable=client-accepts-api-version-keyword
|
|
67
|
+
"""These APIs allow end users to do various administrative operations on Azure Load Test Service.
|
|
68
|
+
|
|
69
|
+
:param endpoint: URL to perform data plane API operations on the resource. Required.
|
|
70
|
+
:type endpoint: str
|
|
71
|
+
:param credential: Credential needed for the client to connect to Azure. Required.
|
|
72
|
+
:type credential: ~azure.core.credentials.TokenCredential
|
|
73
|
+
:keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
|
|
74
|
+
default value may result in unsupported behavior.
|
|
75
|
+
:paramtype api_version: str
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
def __enter__(self) -> "LoadTestAdministrationClient":
|
|
79
|
+
self._client.__enter__()
|
|
80
|
+
return self
|
|
81
|
+
|
|
82
|
+
class LoadTestRunClient(_BaseClient, TestRunOperations): # pylint: disable=client-accepts-api-version-keyword
|
|
83
|
+
"""These APIs allow end users to run Azure Load Test and manage test run.
|
|
84
|
+
|
|
85
|
+
:param endpoint: URL to perform data plane API operations on the resource. Required.
|
|
86
|
+
:type endpoint: str
|
|
87
|
+
:param credential: Credential needed for the client to connect to Azure. Required.
|
|
88
|
+
:type credential: ~azure.core.credentials.TokenCredential
|
|
89
|
+
:keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
|
|
90
|
+
default value may result in unsupported behavior.
|
|
91
|
+
:paramtype api_version: str
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
def __enter__(self) -> "LoadTestRunClient":
|
|
95
|
+
self._client.__enter__()
|
|
96
|
+
return self
|
|
97
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
from ._version import VERSION
|
|
11
|
+
|
|
12
|
+
__version__ = VERSION
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
from ._patch import __all__ as _patch_all
|
|
16
|
+
from ._patch import * # pylint: disable=unused-wildcard-import
|
|
17
|
+
except ImportError:
|
|
18
|
+
_patch_all = []
|
|
19
|
+
from ._patch import patch_sdk as _patch_sdk
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"LoadTestingClient",
|
|
23
|
+
]
|
|
24
|
+
__all__.extend([p for p in _patch_all if p not in __all__])
|
|
25
|
+
|
|
26
|
+
_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, TYPE_CHECKING
|
|
11
|
+
|
|
12
|
+
from azure.core import PipelineClient
|
|
13
|
+
from azure.core.rest import HttpRequest, HttpResponse
|
|
14
|
+
|
|
15
|
+
from ._configuration import LoadTestingClientConfiguration
|
|
16
|
+
from ._serialization import Deserializer, Serializer
|
|
17
|
+
from .operations import AdministrationOperations, TestRunOperations
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
# pylint: disable=unused-import,ungrouped-imports
|
|
21
|
+
from azure.core.credentials import TokenCredential
|
|
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.operations.AdministrationOperations
|
|
30
|
+
:ivar test_run: TestRunOperations operations
|
|
31
|
+
:vartype test_run: azure.developer.loadtesting._generated.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.TokenCredential
|
|
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: "TokenCredential", **kwargs: Any) -> None:
|
|
44
|
+
_endpoint = "https://{Endpoint}"
|
|
45
|
+
self._config = LoadTestingClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
|
|
46
|
+
self._client = PipelineClient(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) -> HttpResponse:
|
|
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 = client.send_request(request)
|
|
61
|
+
<HttpResponse: 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.HttpResponse
|
|
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
|
+
def close(self) -> None:
|
|
81
|
+
self._client.close()
|
|
82
|
+
|
|
83
|
+
def __enter__(self) -> "LoadTestingClient":
|
|
84
|
+
self._client.__enter__()
|
|
85
|
+
return self
|
|
86
|
+
|
|
87
|
+
def __exit__(self, *exc_details: Any) -> None:
|
|
88
|
+
self._client.__exit__(*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 import TokenCredential
|
|
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.TokenCredential
|
|
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: "TokenCredential", **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.RetryPolicy(**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.RedirectPolicy(**kwargs)
|
|
67
|
+
self.authentication_policy = kwargs.get("authentication_policy")
|
|
68
|
+
if self.credential and not self.authentication_policy:
|
|
69
|
+
self.authentication_policy = policies.BearerTokenCredentialPolicy(
|
|
70
|
+
self.credential, *self.credential_scopes, **kwargs
|
|
71
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
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 TYPE_CHECKING, List
|
|
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
|
|
15
|
+
# package level
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def patch_sdk():
|
|
19
|
+
"""Do not remove from this file.
|
|
20
|
+
|
|
21
|
+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
|
22
|
+
you can't accomplish using the techniques described in
|
|
23
|
+
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
|
24
|
+
"""
|