Skip to content

Commit b322e60

Browse files
committed
Merge branch 'sdkauto/azure-mgmt-rdbms-5607470' of https://github.com/azure-sdk/azure-sdk-for-python into sdkauto/azure-mgmt-rdbms-5607470
2 parents 7a33500 + 976665f commit b322e60

File tree

82 files changed

+16078
-171
lines changed

Some content is hidden

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

82 files changed

+16078
-171
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "7c92da3a5031b0417fd488d6dbe1e41dd5fab9e6",
2+
"commit": "517eeb0bdbfe56c34a9423d2a970313ae74d497c",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
66
"@autorest/[email protected]",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/postgresql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/postgresql/resource-manager/readme.md"
9+
"autorest_command": "autorest specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/readme.md"
1111
}

sdk/rdbms/azure-mgmt-rdbms/apiview-properties.json

Lines changed: 120 additions & 168 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._my_sql_management_client import MySQLManagementClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
25+
from ._patch import patch_sdk as _patch_sdk
26+
27+
__all__ = [
28+
"MySQLManagementClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
31+
32+
_patch_sdk()
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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 typing import Any, Optional, TYPE_CHECKING
10+
11+
from azure.core.pipeline import policies
12+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
13+
14+
from ._version import VERSION
15+
16+
if TYPE_CHECKING:
17+
from azure.core import AzureClouds
18+
from azure.core.credentials import TokenCredential
19+
20+
21+
class MySQLManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
22+
"""Configuration for MySQLManagementClient.
23+
24+
Note that all parameters used to create this instance are saved as instance
25+
attributes.
26+
27+
:param credential: Credential needed for the client to connect to Azure. Required.
28+
:type credential: ~azure.core.credentials.TokenCredential
29+
:param subscription_id: The ID of the target subscription. Required.
30+
:type subscription_id: str
31+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
32+
None.
33+
:type cloud_setting: ~azure.core.AzureClouds
34+
:keyword api_version: Api Version. Default value is "2021-05-01". Note that overriding this
35+
default value may result in unsupported behavior.
36+
:paramtype api_version: str
37+
"""
38+
39+
def __init__(
40+
self,
41+
credential: "TokenCredential",
42+
subscription_id: str,
43+
cloud_setting: Optional["AzureClouds"] = None,
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2021-05-01")
47+
48+
if credential is None:
49+
raise ValueError("Parameter 'credential' must not be None.")
50+
if subscription_id is None:
51+
raise ValueError("Parameter 'subscription_id' must not be None.")
52+
53+
self.credential = credential
54+
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
56+
self.api_version = api_version
57+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
58+
kwargs.setdefault("sdk_moniker", "mgmt-rdbms/{}".format(VERSION))
59+
self.polling_interval = kwargs.get("polling_interval", 30)
60+
self._configure(**kwargs)
61+
62+
def _configure(self, **kwargs: Any) -> None:
63+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
64+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
65+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
66+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
67+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
68+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
69+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
70+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
71+
self.authentication_policy = kwargs.get("authentication_policy")
72+
if self.credential and not self.authentication_policy:
73+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
74+
self.credential, *self.credential_scopes, **kwargs
75+
)
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
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, 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 . import models as _models
21+
from ._configuration import MySQLManagementClientConfiguration
22+
from ._utils.serialization import Deserializer, Serializer
23+
from .operations import (
24+
BackupsOperations,
25+
CheckNameAvailabilityOperations,
26+
CheckNameAvailabilityWithoutLocationOperations,
27+
CheckVirtualNetworkSubnetUsageOperations,
28+
ConfigurationsOperations,
29+
DatabasesOperations,
30+
FirewallRulesOperations,
31+
GetPrivateDnsZoneSuffixOperations,
32+
LocationBasedCapabilitiesOperations,
33+
Operations,
34+
ReplicasOperations,
35+
ServersOperations,
36+
)
37+
38+
if TYPE_CHECKING:
39+
from azure.core import AzureClouds
40+
from azure.core.credentials import TokenCredential
41+
42+
43+
class MySQLManagementClient: # pylint: disable=too-many-instance-attributes
44+
"""The Microsoft Azure management API provides create, read, update, and delete functionality for
45+
Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and
46+
configurations with new business model.
47+
48+
:ivar servers: ServersOperations operations
49+
:vartype servers: azure.mgmt.rdbms.mysql_flexibleservers.operations.ServersOperations
50+
:ivar replicas: ReplicasOperations operations
51+
:vartype replicas: azure.mgmt.rdbms.mysql_flexibleservers.operations.ReplicasOperations
52+
:ivar backups: BackupsOperations operations
53+
:vartype backups: azure.mgmt.rdbms.mysql_flexibleservers.operations.BackupsOperations
54+
:ivar firewall_rules: FirewallRulesOperations operations
55+
:vartype firewall_rules:
56+
azure.mgmt.rdbms.mysql_flexibleservers.operations.FirewallRulesOperations
57+
:ivar databases: DatabasesOperations operations
58+
:vartype databases: azure.mgmt.rdbms.mysql_flexibleservers.operations.DatabasesOperations
59+
:ivar configurations: ConfigurationsOperations operations
60+
:vartype configurations:
61+
azure.mgmt.rdbms.mysql_flexibleservers.operations.ConfigurationsOperations
62+
:ivar location_based_capabilities: LocationBasedCapabilitiesOperations operations
63+
:vartype location_based_capabilities:
64+
azure.mgmt.rdbms.mysql_flexibleservers.operations.LocationBasedCapabilitiesOperations
65+
:ivar check_virtual_network_subnet_usage: CheckVirtualNetworkSubnetUsageOperations operations
66+
:vartype check_virtual_network_subnet_usage:
67+
azure.mgmt.rdbms.mysql_flexibleservers.operations.CheckVirtualNetworkSubnetUsageOperations
68+
:ivar check_name_availability: CheckNameAvailabilityOperations operations
69+
:vartype check_name_availability:
70+
azure.mgmt.rdbms.mysql_flexibleservers.operations.CheckNameAvailabilityOperations
71+
:ivar check_name_availability_without_location: CheckNameAvailabilityWithoutLocationOperations
72+
operations
73+
:vartype check_name_availability_without_location:
74+
azure.mgmt.rdbms.mysql_flexibleservers.operations.CheckNameAvailabilityWithoutLocationOperations
75+
:ivar get_private_dns_zone_suffix: GetPrivateDnsZoneSuffixOperations operations
76+
:vartype get_private_dns_zone_suffix:
77+
azure.mgmt.rdbms.mysql_flexibleservers.operations.GetPrivateDnsZoneSuffixOperations
78+
:ivar operations: Operations operations
79+
:vartype operations: azure.mgmt.rdbms.mysql_flexibleservers.operations.Operations
80+
:param credential: Credential needed for the client to connect to Azure. Required.
81+
:type credential: ~azure.core.credentials.TokenCredential
82+
:param subscription_id: The ID of the target subscription. Required.
83+
:type subscription_id: str
84+
:param base_url: Service URL. Default value is None.
85+
:type base_url: str
86+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
87+
None.
88+
:paramtype cloud_setting: ~azure.core.AzureClouds
89+
:keyword api_version: Api Version. Default value is "2021-05-01". Note that overriding this
90+
default value may result in unsupported behavior.
91+
:paramtype api_version: str
92+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
93+
Retry-After header is present.
94+
"""
95+
96+
def __init__(
97+
self,
98+
credential: "TokenCredential",
99+
subscription_id: str,
100+
base_url: Optional[str] = None,
101+
*,
102+
cloud_setting: Optional["AzureClouds"] = None,
103+
**kwargs: Any
104+
) -> None:
105+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
106+
_endpoints = get_arm_endpoints(_cloud)
107+
if not base_url:
108+
base_url = _endpoints["resource_manager"]
109+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
110+
self._config = MySQLManagementClientConfiguration(
111+
credential=credential,
112+
subscription_id=subscription_id,
113+
cloud_setting=cloud_setting,
114+
credential_scopes=credential_scopes,
115+
**kwargs
116+
)
117+
118+
_policies = kwargs.pop("policies", None)
119+
if _policies is None:
120+
_policies = [
121+
policies.RequestIdPolicy(**kwargs),
122+
self._config.headers_policy,
123+
self._config.user_agent_policy,
124+
self._config.proxy_policy,
125+
policies.ContentDecodePolicy(**kwargs),
126+
ARMAutoResourceProviderRegistrationPolicy(),
127+
self._config.redirect_policy,
128+
self._config.retry_policy,
129+
self._config.authentication_policy,
130+
self._config.custom_hook_policy,
131+
self._config.logging_policy,
132+
policies.DistributedTracingPolicy(**kwargs),
133+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
134+
self._config.http_logging_policy,
135+
]
136+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
137+
138+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
139+
self._serialize = Serializer(client_models)
140+
self._deserialize = Deserializer(client_models)
141+
self._serialize.client_side_validation = False
142+
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
143+
self.replicas = ReplicasOperations(self._client, self._config, self._serialize, self._deserialize)
144+
self.backups = BackupsOperations(self._client, self._config, self._serialize, self._deserialize)
145+
self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize)
146+
self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize)
147+
self.configurations = ConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
148+
self.location_based_capabilities = LocationBasedCapabilitiesOperations(
149+
self._client, self._config, self._serialize, self._deserialize
150+
)
151+
self.check_virtual_network_subnet_usage = CheckVirtualNetworkSubnetUsageOperations(
152+
self._client, self._config, self._serialize, self._deserialize
153+
)
154+
self.check_name_availability = CheckNameAvailabilityOperations(
155+
self._client, self._config, self._serialize, self._deserialize
156+
)
157+
self.check_name_availability_without_location = CheckNameAvailabilityWithoutLocationOperations(
158+
self._client, self._config, self._serialize, self._deserialize
159+
)
160+
self.get_private_dns_zone_suffix = GetPrivateDnsZoneSuffixOperations(
161+
self._client, self._config, self._serialize, self._deserialize
162+
)
163+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
164+
165+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
166+
"""Runs the network request through the client's chained policies.
167+
168+
>>> from azure.core.rest import HttpRequest
169+
>>> request = HttpRequest("GET", "https://www.example.org/")
170+
<HttpRequest [GET], url: 'https://www.example.org/'>
171+
>>> response = client._send_request(request)
172+
<HttpResponse: 200 OK>
173+
174+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
175+
176+
:param request: The network request you want to make. Required.
177+
:type request: ~azure.core.rest.HttpRequest
178+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
179+
:return: The response of your network call. Does not do error handling on your response.
180+
:rtype: ~azure.core.rest.HttpResponse
181+
"""
182+
183+
request_copy = deepcopy(request)
184+
request_copy.url = self._client.format_url(request_copy.url)
185+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
186+
187+
def close(self) -> None:
188+
self._client.close()
189+
190+
def __enter__(self) -> Self:
191+
self._client.__enter__()
192+
return self
193+
194+
def __exit__(self, *exc_details: Any) -> None:
195+
self._client.__exit__(*exc_details)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
# --------------------------------------------------------------------------
6+
"""Customize generated code here.
7+
8+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
9+
"""
10+
11+
12+
__all__: list[str] = [] # Add all objects you want publicly available to users at this package level
13+
14+
15+
def patch_sdk():
16+
"""Do not remove from this file.
17+
18+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
19+
you can't accomplish using the techniques described in
20+
https://aka.ms/azsdk/python/dpcodegen/python/customize
21+
"""
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)