Skip to content

Commit cc969d0

Browse files
author
SDKAuto
committed
CodeGen from PR 33471 in Azure/azure-rest-api-specs
Merge 534267c5c95ccba7b40b574943218b805fdc9aaa into 0a042d1a9f2b8be564c87f2021c76de3d9652210
1 parent b305dc7 commit cc969d0

File tree

84 files changed

+11882
-9816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+11882
-9816
lines changed

sdk/chaos/azure-mgmt-chaos/CHANGELOG.md

Lines changed: 227 additions & 0 deletions
Large diffs are not rendered by default.

sdk/chaos/azure-mgmt-chaos/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "50f502f5099796ba92f63384884574d46333cec2",
2+
"commit": "d8dacf6774db11fc7e5f27ae940f4ca0031e3fee",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/chaos/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
10-
"readme": "specification/chaos/resource-manager/readme.md"
4+
"typespec_src": "specification/chaos/Chaos.Management",
5+
"@azure-tools/typespec-python": "0.42.2"
116
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.Chaos",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.chaos.models.ActionStatus": "Microsoft.Chaos.ActionStatus",
5+
"azure.mgmt.chaos.models.BranchStatus": "Microsoft.Chaos.BranchStatus",
6+
"azure.mgmt.chaos.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
7+
"azure.mgmt.chaos.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
8+
"azure.mgmt.chaos.models.Capability": "Microsoft.Chaos.Capability",
9+
"azure.mgmt.chaos.models.CapabilityProperties": "Microsoft.Chaos.CapabilityProperties",
10+
"azure.mgmt.chaos.models.CapabilityType": "Microsoft.Chaos.CapabilityType",
11+
"azure.mgmt.chaos.models.CapabilityTypeProperties": "Microsoft.Chaos.CapabilityTypeProperties",
12+
"azure.mgmt.chaos.models.CapabilityTypePropertiesRuntimeProperties": "Microsoft.Chaos.CapabilityTypePropertiesRuntimeProperties",
13+
"azure.mgmt.chaos.models.ChaosExperimentAction": "Microsoft.Chaos.ChaosExperimentAction",
14+
"azure.mgmt.chaos.models.ChaosExperimentBranch": "Microsoft.Chaos.ChaosExperimentBranch",
15+
"azure.mgmt.chaos.models.ChaosExperimentStep": "Microsoft.Chaos.ChaosExperimentStep",
16+
"azure.mgmt.chaos.models.ChaosTargetFilter": "Microsoft.Chaos.ChaosTargetFilter",
17+
"azure.mgmt.chaos.models.ChaosTargetSelector": "Microsoft.Chaos.ChaosTargetSelector",
18+
"azure.mgmt.chaos.models.ChaosTargetListSelector": "Microsoft.Chaos.ChaosTargetListSelector",
19+
"azure.mgmt.chaos.models.ChaosTargetQuerySelector": "Microsoft.Chaos.ChaosTargetQuerySelector",
20+
"azure.mgmt.chaos.models.ChaosTargetSimpleFilter": "Microsoft.Chaos.ChaosTargetSimpleFilter",
21+
"azure.mgmt.chaos.models.ChaosTargetSimpleFilterParameters": "Microsoft.Chaos.ChaosTargetSimpleFilterParameters",
22+
"azure.mgmt.chaos.models.ContinuousAction": "Microsoft.Chaos.ContinuousAction",
23+
"azure.mgmt.chaos.models.DelayAction": "Microsoft.Chaos.DelayAction",
24+
"azure.mgmt.chaos.models.DiscreteAction": "Microsoft.Chaos.DiscreteAction",
25+
"azure.mgmt.chaos.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
26+
"azure.mgmt.chaos.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
27+
"azure.mgmt.chaos.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
28+
"azure.mgmt.chaos.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
29+
"azure.mgmt.chaos.models.Experiment": "Microsoft.Chaos.Experiment",
30+
"azure.mgmt.chaos.models.ExperimentExecution": "Microsoft.Chaos.ExperimentExecution",
31+
"azure.mgmt.chaos.models.ExperimentExecutionActionTargetDetailsError": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsError",
32+
"azure.mgmt.chaos.models.ExperimentExecutionActionTargetDetailsProperties": "Microsoft.Chaos.ExperimentExecutionActionTargetDetailsProperties",
33+
"azure.mgmt.chaos.models.ExperimentExecutionDetails": "Microsoft.Chaos.ExperimentExecutionDetails",
34+
"azure.mgmt.chaos.models.ExperimentExecutionDetailsProperties": "Microsoft.Chaos.ExperimentExecutionDetailsProperties",
35+
"azure.mgmt.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation": "Microsoft.Chaos.ExperimentExecutionDetailsPropertiesRunInformation",
36+
"azure.mgmt.chaos.models.ExperimentExecutionProperties": "Microsoft.Chaos.ExperimentExecutionProperties",
37+
"azure.mgmt.chaos.models.ExperimentProperties": "Microsoft.Chaos.ExperimentProperties",
38+
"azure.mgmt.chaos.models.ExperimentUpdate": "Microsoft.Chaos.ExperimentUpdate",
39+
"azure.mgmt.chaos.models.KeyValuePair": "Microsoft.Chaos.KeyValuePair",
40+
"azure.mgmt.chaos.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity",
41+
"azure.mgmt.chaos.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
42+
"azure.mgmt.chaos.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
43+
"azure.mgmt.chaos.models.OperationStatusResult": "Azure.ResourceManager.CommonTypes.OperationStatusResult",
44+
"azure.mgmt.chaos.models.StepStatus": "Microsoft.Chaos.StepStatus",
45+
"azure.mgmt.chaos.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
46+
"azure.mgmt.chaos.models.Target": "Microsoft.Chaos.Target",
47+
"azure.mgmt.chaos.models.TargetReference": "Microsoft.Chaos.TargetReference",
48+
"azure.mgmt.chaos.models.TargetType": "Microsoft.Chaos.TargetType",
49+
"azure.mgmt.chaos.models.TargetTypeProperties": "Microsoft.Chaos.TargetTypeProperties",
50+
"azure.mgmt.chaos.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity",
51+
"azure.mgmt.chaos.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
52+
"azure.mgmt.chaos.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
53+
"azure.mgmt.chaos.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
54+
"azure.mgmt.chaos.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType",
55+
"azure.mgmt.chaos.models.ProvisioningState": "Microsoft.Chaos.ProvisioningState",
56+
"azure.mgmt.chaos.models.ExperimentActionType": "Microsoft.Chaos.ExperimentActionType",
57+
"azure.mgmt.chaos.models.SelectorType": "Microsoft.Chaos.SelectorType",
58+
"azure.mgmt.chaos.models.FilterType": "Microsoft.Chaos.FilterType",
59+
"azure.mgmt.chaos.models.TargetReferenceType": "Microsoft.Chaos.TargetReferenceType",
60+
"azure.mgmt.chaos.ChaosManagementClient.capabilities.get": "Microsoft.Chaos.Capabilities.get",
61+
"azure.mgmt.chaos.ChaosManagementClient.capabilities.create_or_update": "Microsoft.Chaos.Capabilities.createOrUpdate",
62+
"azure.mgmt.chaos.ChaosManagementClient.capabilities.delete": "Microsoft.Chaos.Capabilities.delete",
63+
"azure.mgmt.chaos.ChaosManagementClient.capabilities.list": "Microsoft.Chaos.Capabilities.list",
64+
"azure.mgmt.chaos.ChaosManagementClient.operations.list": "Azure.ResourceManager.Operations.list",
65+
"azure.mgmt.chaos.ChaosManagementClient.targets.get": "Microsoft.Chaos.Targets.get",
66+
"azure.mgmt.chaos.ChaosManagementClient.targets.create_or_update": "Microsoft.Chaos.Targets.createOrUpdate",
67+
"azure.mgmt.chaos.ChaosManagementClient.targets.delete": "Microsoft.Chaos.Targets.delete",
68+
"azure.mgmt.chaos.ChaosManagementClient.targets.list": "Microsoft.Chaos.Targets.list",
69+
"azure.mgmt.chaos.ChaosManagementClient.capability_types.get": "Microsoft.Chaos.CapabilityTypes.get",
70+
"azure.mgmt.chaos.ChaosManagementClient.capability_types.list": "Microsoft.Chaos.CapabilityTypes.list",
71+
"azure.mgmt.chaos.ChaosManagementClient.experiments.get": "Microsoft.Chaos.Experiments.get",
72+
"azure.mgmt.chaos.ChaosManagementClient.experiments.begin_create_or_update": "Microsoft.Chaos.Experiments.createOrUpdate",
73+
"azure.mgmt.chaos.ChaosManagementClient.experiments.begin_update": "Microsoft.Chaos.Experiments.update",
74+
"azure.mgmt.chaos.ChaosManagementClient.experiments.begin_delete": "Microsoft.Chaos.Experiments.delete",
75+
"azure.mgmt.chaos.ChaosManagementClient.experiments.list": "Microsoft.Chaos.Experiments.list",
76+
"azure.mgmt.chaos.ChaosManagementClient.experiments.list_all": "Microsoft.Chaos.Experiments.listAll",
77+
"azure.mgmt.chaos.ChaosManagementClient.experiments.begin_cancel": "Microsoft.Chaos.Experiments.cancel",
78+
"azure.mgmt.chaos.ChaosManagementClient.experiments.begin_start": "Microsoft.Chaos.Experiments.start",
79+
"azure.mgmt.chaos.ChaosManagementClient.experiment_executions.get_execution": "Microsoft.Chaos.ExperimentExecutions.getExecution",
80+
"azure.mgmt.chaos.ChaosManagementClient.experiment_executions.list_all_executions": "Microsoft.Chaos.ExperimentExecutions.listAllExecutions",
81+
"azure.mgmt.chaos.ChaosManagementClient.experiment_executions.get_execution_details": "Microsoft.Chaos.ExperimentExecutions.getExecutionDetails",
82+
"azure.mgmt.chaos.ChaosManagementClient.target_types.get": "Microsoft.Chaos.TargetTypes.get",
83+
"azure.mgmt.chaos.ChaosManagementClient.target_types.list": "Microsoft.Chaos.TargetTypes.list",
84+
"azure.mgmt.chaos.ChaosManagementClient.operation_statuses.get": "Microsoft.Chaos.OperationStatuses.get"
85+
}
86+
}

sdk/chaos/azure-mgmt-chaos/azure/mgmt/chaos/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._chaos_management_client import ChaosManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import ChaosManagementClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"ChaosManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()
Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
1315
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1417

15-
from . import models as _models
1618
from ._configuration import ChaosManagementClientConfiguration
1719
from ._serialization import Deserializer, Serializer
1820
from .operations import (
1921
CapabilitiesOperations,
2022
CapabilityTypesOperations,
23+
ExperimentExecutionsOperations,
2124
ExperimentsOperations,
2225
OperationStatusesOperations,
2326
Operations,
@@ -26,35 +29,36 @@
2629
)
2730

2831
if TYPE_CHECKING:
29-
# pylint: disable=unused-import,ungrouped-imports
3032
from azure.core.credentials import TokenCredential
3133

3234

33-
class ChaosManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
35+
class ChaosManagementClient: # pylint: disable=too-many-instance-attributes
3436
"""Chaos Management Client.
3537
3638
:ivar capabilities: CapabilitiesOperations operations
3739
:vartype capabilities: azure.mgmt.chaos.operations.CapabilitiesOperations
40+
:ivar operations: Operations operations
41+
:vartype operations: azure.mgmt.chaos.operations.Operations
42+
:ivar targets: TargetsOperations operations
43+
:vartype targets: azure.mgmt.chaos.operations.TargetsOperations
3844
:ivar capability_types: CapabilityTypesOperations operations
3945
:vartype capability_types: azure.mgmt.chaos.operations.CapabilityTypesOperations
4046
:ivar experiments: ExperimentsOperations operations
4147
:vartype experiments: azure.mgmt.chaos.operations.ExperimentsOperations
42-
:ivar operation_statuses: OperationStatusesOperations operations
43-
:vartype operation_statuses: azure.mgmt.chaos.operations.OperationStatusesOperations
44-
:ivar operations: Operations operations
45-
:vartype operations: azure.mgmt.chaos.operations.Operations
48+
:ivar experiment_executions: ExperimentExecutionsOperations operations
49+
:vartype experiment_executions: azure.mgmt.chaos.operations.ExperimentExecutionsOperations
4650
:ivar target_types: TargetTypesOperations operations
4751
:vartype target_types: azure.mgmt.chaos.operations.TargetTypesOperations
48-
:ivar targets: TargetsOperations operations
49-
:vartype targets: azure.mgmt.chaos.operations.TargetsOperations
50-
:param credential: Credential needed for the client to connect to Azure. Required.
52+
:ivar operation_statuses: OperationStatusesOperations operations
53+
:vartype operation_statuses: azure.mgmt.chaos.operations.OperationStatusesOperations
54+
:param credential: Credential used to authenticate requests to the service. Required.
5155
:type credential: ~azure.core.credentials.TokenCredential
52-
:param subscription_id: GUID that represents an Azure subscription ID. Required.
56+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5357
:type subscription_id: str
54-
:param base_url: Service URL. Default value is "https://management.azure.com".
58+
:param base_url: Service host. Default value is "https://management.azure.com".
5559
:type base_url: str
56-
:keyword api_version: Api Version. Default value is "2024-01-01". Note that overriding this
57-
default value may result in unsupported behavior.
60+
:keyword api_version: The API version to use for this operation. Default value is "2025-01-01".
61+
Note that overriding this default value may result in unsupported behavior.
5862
:paramtype api_version: str
5963
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6064
Retry-After header is present.
@@ -67,34 +71,55 @@ def __init__(
6771
base_url: str = "https://management.azure.com",
6872
**kwargs: Any
6973
) -> None:
74+
_endpoint = "{endpoint}"
7075
self._config = ChaosManagementClientConfiguration(
71-
credential=credential, subscription_id=subscription_id, **kwargs
76+
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
7277
)
73-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
74-
75-
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
76-
self._serialize = Serializer(client_models)
77-
self._deserialize = Deserializer(client_models)
78+
_policies = kwargs.pop("policies", None)
79+
if _policies is None:
80+
_policies = [
81+
policies.RequestIdPolicy(**kwargs),
82+
self._config.headers_policy,
83+
self._config.user_agent_policy,
84+
self._config.proxy_policy,
85+
policies.ContentDecodePolicy(**kwargs),
86+
ARMAutoResourceProviderRegistrationPolicy(),
87+
self._config.redirect_policy,
88+
self._config.retry_policy,
89+
self._config.authentication_policy,
90+
self._config.custom_hook_policy,
91+
self._config.logging_policy,
92+
policies.DistributedTracingPolicy(**kwargs),
93+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
94+
self._config.http_logging_policy,
95+
]
96+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
97+
98+
self._serialize = Serializer()
99+
self._deserialize = Deserializer()
78100
self._serialize.client_side_validation = False
79101
self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize)
102+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
103+
self.targets = TargetsOperations(self._client, self._config, self._serialize, self._deserialize)
80104
self.capability_types = CapabilityTypesOperations(
81105
self._client, self._config, self._serialize, self._deserialize
82106
)
83107
self.experiments = ExperimentsOperations(self._client, self._config, self._serialize, self._deserialize)
84-
self.operation_statuses = OperationStatusesOperations(
108+
self.experiment_executions = ExperimentExecutionsOperations(
85109
self._client, self._config, self._serialize, self._deserialize
86110
)
87-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
88111
self.target_types = TargetTypesOperations(self._client, self._config, self._serialize, self._deserialize)
89-
self.targets = TargetsOperations(self._client, self._config, self._serialize, self._deserialize)
112+
self.operation_statuses = OperationStatusesOperations(
113+
self._client, self._config, self._serialize, self._deserialize
114+
)
90115

91-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
116+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
92117
"""Runs the network request through the client's chained policies.
93118
94119
>>> from azure.core.rest import HttpRequest
95120
>>> request = HttpRequest("GET", "https://www.example.org/")
96121
<HttpRequest [GET], url: 'https://www.example.org/'>
97-
>>> response = client._send_request(request)
122+
>>> response = client.send_request(request)
98123
<HttpResponse: 200 OK>
99124
100125
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -107,13 +132,17 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
107132
"""
108133

109134
request_copy = deepcopy(request)
110-
request_copy.url = self._client.format_url(request_copy.url)
111-
return self._client.send_request(request_copy, **kwargs)
135+
path_format_arguments = {
136+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
137+
}
138+
139+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
140+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
112141

113142
def close(self) -> None:
114143
self._client.close()
115144

116-
def __enter__(self) -> "ChaosManagementClient":
145+
def __enter__(self) -> Self:
117146
self._client.__enter__()
118147
return self
119148

0 commit comments

Comments
 (0)