Skip to content

Commit d5443ef

Browse files
author
SDKAuto
committed
CodeGen from PR 34361 in Azure/azure-rest-api-specs
Merge 0e19b9c3ef5fbd4efe035665cf67d8004f03919f into 40c12a2dd76da721d480d55a44e6ec666045d508
1 parent fa88072 commit d5443ef

File tree

232 files changed

+49258
-2857
lines changed

Some content is hidden

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

232 files changed

+49258
-2857
lines changed

sdk/compute/azure-mgmt-avs/CHANGELOG.md

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

sdk/compute/azure-mgmt-avs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Avs Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -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.

sdk/compute/azure-mgmt-avs/_meta.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "abb0052f400b0215d4fbbf479e5bbc54714199e0",
2+
"commit": "3402b9341d30bdf31dad7e0b1ee57f95554f6a93",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/vmware/resource-manager/readme.md --generate-sample=True --generate-test=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.10.2 --version-tolerant=False",
10-
"readme": "specification/vmware/resource-manager/readme.md"
4+
"typespec_src": "specification/vmware/Microsoft.AVS.Management",
5+
"@azure-tools/typespec-python": "0.44.1"
116
}

sdk/compute/azure-mgmt-avs/apiview-properties.json

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

sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__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 ._avs_client import AVSClient
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 AVSClient # 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
"AVSClient",
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: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
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) Python 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, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import AVSClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import (
23+
AddonsOperations,
24+
AuthorizationsOperations,
25+
CloudLinksOperations,
26+
ClustersOperations,
27+
DatastoresOperations,
28+
GlobalReachConnectionsOperations,
29+
HcxEnterpriseSitesOperations,
30+
HostsOperations,
31+
IscsiPathsOperations,
32+
LocationsOperations,
33+
Operations,
34+
PlacementPoliciesOperations,
35+
PrivateCloudsOperations,
36+
ProvisionedNetworksOperations,
37+
PureStoragePoliciesOperations,
38+
ScriptCmdletsOperations,
39+
ScriptExecutionsOperations,
40+
ScriptPackagesOperations,
41+
SkusOperations,
42+
VirtualMachinesOperations,
43+
WorkloadNetworkDhcpConfigurationsOperations,
44+
WorkloadNetworkDnsServicesOperations,
45+
WorkloadNetworkDnsZonesOperations,
46+
WorkloadNetworkGatewaysOperations,
47+
WorkloadNetworkPortMirroringProfilesOperations,
48+
WorkloadNetworkPublicIpsOperations,
49+
WorkloadNetworkSegmentsOperations,
50+
WorkloadNetworkVirtualMachinesOperations,
51+
WorkloadNetworkVmGroupsOperations,
52+
WorkloadNetworksOperations,
53+
)
54+
55+
if TYPE_CHECKING:
56+
from azure.core.credentials import TokenCredential
57+
58+
59+
class AVSClient: # pylint: disable=too-many-instance-attributes
60+
"""Azure VMware Solution API.
61+
62+
:ivar operations: Operations operations
63+
:vartype operations: azure.mgmt.avs.operations.Operations
64+
:ivar addons: AddonsOperations operations
65+
:vartype addons: azure.mgmt.avs.operations.AddonsOperations
66+
:ivar authorizations: AuthorizationsOperations operations
67+
:vartype authorizations: azure.mgmt.avs.operations.AuthorizationsOperations
68+
:ivar cloud_links: CloudLinksOperations operations
69+
:vartype cloud_links: azure.mgmt.avs.operations.CloudLinksOperations
70+
:ivar clusters: ClustersOperations operations
71+
:vartype clusters: azure.mgmt.avs.operations.ClustersOperations
72+
:ivar datastores: DatastoresOperations operations
73+
:vartype datastores: azure.mgmt.avs.operations.DatastoresOperations
74+
:ivar global_reach_connections: GlobalReachConnectionsOperations operations
75+
:vartype global_reach_connections: azure.mgmt.avs.operations.GlobalReachConnectionsOperations
76+
:ivar hcx_enterprise_sites: HcxEnterpriseSitesOperations operations
77+
:vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations
78+
:ivar hosts: HostsOperations operations
79+
:vartype hosts: azure.mgmt.avs.operations.HostsOperations
80+
:ivar iscsi_paths: IscsiPathsOperations operations
81+
:vartype iscsi_paths: azure.mgmt.avs.operations.IscsiPathsOperations
82+
:ivar locations: LocationsOperations operations
83+
:vartype locations: azure.mgmt.avs.operations.LocationsOperations
84+
:ivar placement_policies: PlacementPoliciesOperations operations
85+
:vartype placement_policies: azure.mgmt.avs.operations.PlacementPoliciesOperations
86+
:ivar private_clouds: PrivateCloudsOperations operations
87+
:vartype private_clouds: azure.mgmt.avs.operations.PrivateCloudsOperations
88+
:ivar provisioned_networks: ProvisionedNetworksOperations operations
89+
:vartype provisioned_networks: azure.mgmt.avs.operations.ProvisionedNetworksOperations
90+
:ivar pure_storage_policies: PureStoragePoliciesOperations operations
91+
:vartype pure_storage_policies: azure.mgmt.avs.operations.PureStoragePoliciesOperations
92+
:ivar script_cmdlets: ScriptCmdletsOperations operations
93+
:vartype script_cmdlets: azure.mgmt.avs.operations.ScriptCmdletsOperations
94+
:ivar script_executions: ScriptExecutionsOperations operations
95+
:vartype script_executions: azure.mgmt.avs.operations.ScriptExecutionsOperations
96+
:ivar script_packages: ScriptPackagesOperations operations
97+
:vartype script_packages: azure.mgmt.avs.operations.ScriptPackagesOperations
98+
:ivar skus: SkusOperations operations
99+
:vartype skus: azure.mgmt.avs.operations.SkusOperations
100+
:ivar virtual_machines: VirtualMachinesOperations operations
101+
:vartype virtual_machines: azure.mgmt.avs.operations.VirtualMachinesOperations
102+
:ivar workload_network_dhcp_configurations: WorkloadNetworkDhcpConfigurationsOperations
103+
operations
104+
:vartype workload_network_dhcp_configurations:
105+
azure.mgmt.avs.operations.WorkloadNetworkDhcpConfigurationsOperations
106+
:ivar workload_network_dns_services: WorkloadNetworkDnsServicesOperations operations
107+
:vartype workload_network_dns_services:
108+
azure.mgmt.avs.operations.WorkloadNetworkDnsServicesOperations
109+
:ivar workload_network_dns_zones: WorkloadNetworkDnsZonesOperations operations
110+
:vartype workload_network_dns_zones:
111+
azure.mgmt.avs.operations.WorkloadNetworkDnsZonesOperations
112+
:ivar workload_network_gateways: WorkloadNetworkGatewaysOperations operations
113+
:vartype workload_network_gateways: azure.mgmt.avs.operations.WorkloadNetworkGatewaysOperations
114+
:ivar workload_network_port_mirroring_profiles: WorkloadNetworkPortMirroringProfilesOperations
115+
operations
116+
:vartype workload_network_port_mirroring_profiles:
117+
azure.mgmt.avs.operations.WorkloadNetworkPortMirroringProfilesOperations
118+
:ivar workload_network_public_ips: WorkloadNetworkPublicIpsOperations operations
119+
:vartype workload_network_public_ips:
120+
azure.mgmt.avs.operations.WorkloadNetworkPublicIpsOperations
121+
:ivar workload_network_segments: WorkloadNetworkSegmentsOperations operations
122+
:vartype workload_network_segments: azure.mgmt.avs.operations.WorkloadNetworkSegmentsOperations
123+
:ivar workload_network_virtual_machines: WorkloadNetworkVirtualMachinesOperations operations
124+
:vartype workload_network_virtual_machines:
125+
azure.mgmt.avs.operations.WorkloadNetworkVirtualMachinesOperations
126+
:ivar workload_network_vm_groups: WorkloadNetworkVmGroupsOperations operations
127+
:vartype workload_network_vm_groups:
128+
azure.mgmt.avs.operations.WorkloadNetworkVmGroupsOperations
129+
:ivar workload_networks: WorkloadNetworksOperations operations
130+
:vartype workload_networks: azure.mgmt.avs.operations.WorkloadNetworksOperations
131+
:param credential: Credential used to authenticate requests to the service. Required.
132+
:type credential: ~azure.core.credentials.TokenCredential
133+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
134+
:type subscription_id: str
135+
:param base_url: Service host. Default value is None.
136+
:type base_url: str
137+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
138+
Note that overriding this default value may result in unsupported behavior.
139+
:paramtype api_version: str
140+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
141+
Retry-After header is present.
142+
"""
143+
144+
def __init__(
145+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
146+
) -> None:
147+
_endpoint = "{endpoint}"
148+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
149+
_endpoints = get_arm_endpoints(_cloud)
150+
if not base_url:
151+
base_url = _endpoints["resource_manager"]
152+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
153+
self._config = AVSClientConfiguration(
154+
credential=credential,
155+
subscription_id=subscription_id,
156+
base_url=cast(str, base_url),
157+
credential_scopes=credential_scopes,
158+
**kwargs
159+
)
160+
161+
_policies = kwargs.pop("policies", None)
162+
if _policies is None:
163+
_policies = [
164+
policies.RequestIdPolicy(**kwargs),
165+
self._config.headers_policy,
166+
self._config.user_agent_policy,
167+
self._config.proxy_policy,
168+
policies.ContentDecodePolicy(**kwargs),
169+
ARMAutoResourceProviderRegistrationPolicy(),
170+
self._config.redirect_policy,
171+
self._config.retry_policy,
172+
self._config.authentication_policy,
173+
self._config.custom_hook_policy,
174+
self._config.logging_policy,
175+
policies.DistributedTracingPolicy(**kwargs),
176+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
177+
self._config.http_logging_policy,
178+
]
179+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
180+
181+
self._serialize = Serializer()
182+
self._deserialize = Deserializer()
183+
self._serialize.client_side_validation = False
184+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
185+
self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize)
186+
self.authorizations = AuthorizationsOperations(self._client, self._config, self._serialize, self._deserialize)
187+
self.cloud_links = CloudLinksOperations(self._client, self._config, self._serialize, self._deserialize)
188+
self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize)
189+
self.datastores = DatastoresOperations(self._client, self._config, self._serialize, self._deserialize)
190+
self.global_reach_connections = GlobalReachConnectionsOperations(
191+
self._client, self._config, self._serialize, self._deserialize
192+
)
193+
self.hcx_enterprise_sites = HcxEnterpriseSitesOperations(
194+
self._client, self._config, self._serialize, self._deserialize
195+
)
196+
self.hosts = HostsOperations(self._client, self._config, self._serialize, self._deserialize)
197+
self.iscsi_paths = IscsiPathsOperations(self._client, self._config, self._serialize, self._deserialize)
198+
self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize)
199+
self.placement_policies = PlacementPoliciesOperations(
200+
self._client, self._config, self._serialize, self._deserialize
201+
)
202+
self.private_clouds = PrivateCloudsOperations(self._client, self._config, self._serialize, self._deserialize)
203+
self.provisioned_networks = ProvisionedNetworksOperations(
204+
self._client, self._config, self._serialize, self._deserialize
205+
)
206+
self.pure_storage_policies = PureStoragePoliciesOperations(
207+
self._client, self._config, self._serialize, self._deserialize
208+
)
209+
self.script_cmdlets = ScriptCmdletsOperations(self._client, self._config, self._serialize, self._deserialize)
210+
self.script_executions = ScriptExecutionsOperations(
211+
self._client, self._config, self._serialize, self._deserialize
212+
)
213+
self.script_packages = ScriptPackagesOperations(self._client, self._config, self._serialize, self._deserialize)
214+
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
215+
self.virtual_machines = VirtualMachinesOperations(
216+
self._client, self._config, self._serialize, self._deserialize
217+
)
218+
self.workload_network_dhcp_configurations = WorkloadNetworkDhcpConfigurationsOperations(
219+
self._client, self._config, self._serialize, self._deserialize
220+
)
221+
self.workload_network_dns_services = WorkloadNetworkDnsServicesOperations(
222+
self._client, self._config, self._serialize, self._deserialize
223+
)
224+
self.workload_network_dns_zones = WorkloadNetworkDnsZonesOperations(
225+
self._client, self._config, self._serialize, self._deserialize
226+
)
227+
self.workload_network_gateways = WorkloadNetworkGatewaysOperations(
228+
self._client, self._config, self._serialize, self._deserialize
229+
)
230+
self.workload_network_port_mirroring_profiles = WorkloadNetworkPortMirroringProfilesOperations(
231+
self._client, self._config, self._serialize, self._deserialize
232+
)
233+
self.workload_network_public_ips = WorkloadNetworkPublicIpsOperations(
234+
self._client, self._config, self._serialize, self._deserialize
235+
)
236+
self.workload_network_segments = WorkloadNetworkSegmentsOperations(
237+
self._client, self._config, self._serialize, self._deserialize
238+
)
239+
self.workload_network_virtual_machines = WorkloadNetworkVirtualMachinesOperations(
240+
self._client, self._config, self._serialize, self._deserialize
241+
)
242+
self.workload_network_vm_groups = WorkloadNetworkVmGroupsOperations(
243+
self._client, self._config, self._serialize, self._deserialize
244+
)
245+
self.workload_networks = WorkloadNetworksOperations(
246+
self._client, self._config, self._serialize, self._deserialize
247+
)
248+
249+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
250+
"""Runs the network request through the client's chained policies.
251+
252+
>>> from azure.core.rest import HttpRequest
253+
>>> request = HttpRequest("GET", "https://www.example.org/")
254+
<HttpRequest [GET], url: 'https://www.example.org/'>
255+
>>> response = client.send_request(request)
256+
<HttpResponse: 200 OK>
257+
258+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
259+
260+
:param request: The network request you want to make. Required.
261+
:type request: ~azure.core.rest.HttpRequest
262+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
263+
:return: The response of your network call. Does not do error handling on your response.
264+
:rtype: ~azure.core.rest.HttpResponse
265+
"""
266+
267+
request_copy = deepcopy(request)
268+
path_format_arguments = {
269+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
270+
}
271+
272+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
273+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
274+
275+
def close(self) -> None:
276+
self._client.close()
277+
278+
def __enter__(self) -> Self:
279+
self._client.__enter__()
280+
return self
281+
282+
def __exit__(self, *exc_details: Any) -> None:
283+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)