From ddcc48968326bdf57a5f345abcfe672f1e9c13d1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 18 Sep 2023 02:47:23 +0000 Subject: [PATCH] CodeGen from PR 25825 in Azure/azure-rest-api-specs Merge 1817bb075de0b9af8ae4d7f0dbc4f5262e7048c9 into def187e2e78d7173d8fdd7f77740dd9719e1dfbf --- sdk/rdbms/azure-mgmt-rdbms/_meta.json | 12 +- .../azure/mgmt/rdbms/mysql/_serialization.py | 26 +- .../azure/mgmt/rdbms/mysql/_vendor.py | 14 +- .../azure/mgmt/rdbms/mysql/_version.py | 2 +- .../_check_name_availability_operations.py | 3 +- .../operations/_configurations_operations.py | 3 +- .../aio/operations/_databases_operations.py | 3 +- .../operations/_firewall_rules_operations.py | 3 +- .../_my_sql_management_client_operations.py | 2 +- ...private_endpoint_connections_operations.py | 5 +- .../_server_administrators_operations.py | 3 +- .../aio/operations/_server_keys_operations.py | 3 +- .../_server_parameters_operations.py | 3 +- ...rver_security_alert_policies_operations.py | 3 +- .../aio/operations/_servers_operations.py | 7 +- .../_top_query_statistics_operations.py | 3 +- .../_virtual_network_rules_operations.py | 3 +- .../operations/_wait_statistics_operations.py | 3 +- .../mysql/operations/_advisors_operations.py | 6 +- .../_check_name_availability_operations.py | 7 +- .../operations/_configurations_operations.py | 11 +- .../mysql/operations/_databases_operations.py | 13 +- .../operations/_firewall_rules_operations.py | 13 +- ...ation_based_performance_tier_operations.py | 4 +- ...on_sessions_operation_status_operations.py | 4 +- ...ended_action_sessions_result_operations.py | 4 +- .../mysql/operations/_log_files_operations.py | 4 +- .../_my_sql_management_client_operations.py | 12 +- ...private_endpoint_connections_operations.py | 17 +- .../_private_link_resources_operations.py | 6 +- .../operations/_query_texts_operations.py | 6 +- .../_recommended_actions_operations.py | 6 +- .../_recoverable_servers_operations.py | 4 +- .../mysql/operations/_replicas_operations.py | 4 +- .../_server_administrators_operations.py | 13 +- ...erver_based_performance_tier_operations.py | 4 +- .../operations/_server_keys_operations.py | 13 +- .../_server_parameters_operations.py | 7 +- ...rver_security_alert_policies_operations.py | 11 +- .../mysql/operations/_servers_operations.py | 29 +- .../_top_query_statistics_operations.py | 9 +- .../_virtual_network_rules_operations.py | 13 +- .../operations/_wait_statistics_operations.py | 9 +- .../mysql_flexibleservers/_configuration.py | 8 +- .../_my_sql_management_client.py | 26 +- .../mysql_flexibleservers/_serialization.py | 26 +- .../rdbms/mysql_flexibleservers/_vendor.py | 14 - .../rdbms/mysql_flexibleservers/_version.py | 2 +- .../aio/_configuration.py | 8 +- .../aio/_my_sql_management_client.py | 26 +- .../aio/operations/__init__.py | 6 + .../_azure_ad_administrators_operations.py | 41 +- .../_backup_and_export_operations.py | 15 +- .../aio/operations/_backups_operations.py | 29 +- .../_check_name_availability_operations.py | 8 +- ...vailability_without_location_operations.py | 8 +- ...virtual_network_subnet_usage_operations.py | 8 +- .../operations/_configurations_operations.py | 52 +- .../aio/operations/_databases_operations.py | 41 +- .../operations/_firewall_rules_operations.py | 41 +- ..._get_private_dns_zone_suffix_operations.py | 5 +- ..._location_based_capabilities_operations.py | 19 +- ...ocation_based_capability_set_operations.py | 203 ++++ .../aio/operations/_log_files_operations.py | 19 +- .../_operation_results_operations.py | 115 +++ .../aio/operations/_operations.py | 19 +- .../aio/operations/_replicas_operations.py | 19 +- .../_servers_migration_operations.py | 188 ++++ .../aio/operations/_servers_operations.py | 107 ++- .../mysql_flexibleservers/models/__init__.py | 42 +- .../models/_models_py3.py | 900 +++++++++++++++--- .../models/_my_sql_management_client_enums.py | 41 +- .../operations/__init__.py | 6 + .../_azure_ad_administrators_operations.py | 67 +- .../_backup_and_export_operations.py | 29 +- .../operations/_backups_operations.py | 49 +- .../_check_name_availability_operations.py | 18 +- ...vailability_without_location_operations.py | 16 +- ...virtual_network_subnet_usage_operations.py | 18 +- .../operations/_configurations_operations.py | 84 +- .../operations/_databases_operations.py | 67 +- .../operations/_firewall_rules_operations.py | 67 +- ..._get_private_dns_zone_suffix_operations.py | 7 +- ..._location_based_capabilities_operations.py | 29 +- ...ocation_based_capability_set_operations.py | 265 ++++++ .../operations/_log_files_operations.py | 27 +- .../_operation_results_operations.py | 147 +++ .../operations/_operations.py | 21 +- .../operations/_replicas_operations.py | 27 +- .../_servers_migration_operations.py | 221 +++++ .../operations/_servers_operations.py | 175 ++-- .../azure_ad_administrator_create.py | 2 +- .../azure_ad_administrator_delete.py | 2 +- .../azure_ad_administrator_get.py | 2 +- .../azure_ad_administrators_list_by_server.py | 2 +- .../backup_and_export.py | 2 +- .../mysql_flexibleservers/backup_get.py | 2 +- .../mysql_flexibleservers/backup_put.py | 2 +- .../backups_list_by_server.py | 2 +- .../capabilities_by_location_list.py | 2 +- .../capability_set_by_location.py | 40 + .../capability_set_list_by_location.py | 41 + .../check_name_availability.py | 2 +- .../check_virtual_network_subnet_usage.py | 2 +- .../configuration_create_or_update.py | 2 +- .../configuration_get.py | 2 +- .../configuration_update.py | 2 +- .../configurations_batch_update.py | 2 +- .../configurations_list_by_server.py | 2 +- .../cutover_migration.py | 41 + .../mysql_flexibleservers/database_create.py | 2 +- .../mysql_flexibleservers/database_delete.py | 2 +- .../mysql_flexibleservers/database_get.py | 2 +- .../databases_list_by_server.py | 2 +- .../firewall_rule_create.py | 2 +- .../firewall_rule_delete.py | 2 +- .../firewall_rule_get.py | 2 +- .../firewall_rules_list_by_server.py | 2 +- .../get_private_dns_zone_suffix.py | 2 +- .../log_files_list_by_server.py | 2 +- .../operation_results_get.py | 41 + .../mysql_flexibleservers/operations_list.py | 2 +- .../replicas_list_by_server.py | 2 +- .../mysql_flexibleservers/server_create.py | 2 +- .../server_create_replica.py | 2 +- .../server_create_with_byok.py | 2 +- ...erver_create_with_point_in_time_restore.py | 2 +- .../mysql_flexibleservers/server_delete.py | 2 +- .../mysql_flexibleservers/server_failover.py | 2 +- .../mysql_flexibleservers/server_get.py | 2 +- .../server_get_with_vnet.py | 2 +- .../server_reset_gtid.py | 2 +- .../mysql_flexibleservers/server_restart.py | 2 +- .../mysql_flexibleservers/server_start.py | 2 +- .../mysql_flexibleservers/server_stop.py | 2 +- .../mysql_flexibleservers/server_update.py | 5 +- .../server_update_with_byok.py | 2 +- ...update_with_customer_maintenance_window.py | 2 +- .../mysql_flexibleservers/servers_list.py | 2 +- .../servers_list_by_resource_group.py | 2 +- .../mysql_flexibleservers/validate_backup.py | 2 +- 141 files changed, 3211 insertions(+), 753 deletions(-) create mode 100644 sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capability_set_operations.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operation_results_operations.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_migration_operations.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capability_set_operations.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_operation_results_operations.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_servers_migration_operations.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_by_location.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_list_by_location.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/cutover_migration.py create mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operation_results_get.py diff --git a/sdk/rdbms/azure-mgmt-rdbms/_meta.json b/sdk/rdbms/azure-mgmt-rdbms/_meta.json index 8d344ef1fd0a..4db173a45ff5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/_meta.json +++ b/sdk/rdbms/azure-mgmt-rdbms/_meta.json @@ -1,11 +1,11 @@ { - "commit": "dc92283b118284e79f4ed3837763e2bb079ffa09", + "commit": "f03d64572754f4b63e15ebc9483316e7872c3730", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.4.12", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/postgresql/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/python@6.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", - "readme": "specification/postgresql/resource-manager/readme.md" + "autorest_command": "autorest specification/mysql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", + "readme": "specification/mysql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_serialization.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_serialization.py index 842ae727fbbc..4bae2292227b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_serialization.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_serialization.py @@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_vendor.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_vendor.py index c234fb4d3806..c66f4e1bfd63 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_vendor.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class MySQLManagementClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_version.py index 0e54abf8a90d..e5754a47ce68 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.2.0b10" +VERSION = "1.0.0b1" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_check_name_availability_operations.py index 02fe8dd8c26b..16a17ec6a08d 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_check_name_availability_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -126,7 +127,7 @@ async def execute( content_type = content_type or "application/json" _json = None _content = None - if isinstance(name_availability_request, (IO, bytes)): + if isinstance(name_availability_request, (IOBase, bytes)): _content = name_availability_request else: _json = self._serialize.body(name_availability_request, "NameAvailabilityRequest") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_configurations_operations.py index eddabbfbd0c5..9a94f1378bce 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_configurations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -85,7 +86,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Configuration") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_databases_operations.py index 5fc247749f8c..be96a3199dd4 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_databases_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -86,7 +87,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Database") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_firewall_rules_operations.py index 5b1dc7ffdecb..3bffe65f6d36 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_firewall_rules_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -86,7 +87,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FirewallRule") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_my_sql_management_client_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_my_sql_management_client_operations.py index bde97c571518..e5ad37def63f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_my_sql_management_client_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_my_sql_management_client_operations.py @@ -102,7 +102,7 @@ async def reset_query_performance_insight_data( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/resetQueryPerformanceInsightData" } - async def _create_recommended_action_session_initial( # pylint: disable=inconsistent-return-statements,name-too-long + async def _create_recommended_action_session_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, advisor_name: str, database_name: str, **kwargs: Any ) -> None: error_map = { diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_private_endpoint_connections_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_private_endpoint_connections_operations.py index 3df017db2df9..f57794f1f229 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_private_endpoint_connections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -154,7 +155,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PrivateEndpointConnection") @@ -508,7 +509,7 @@ async def _update_tags_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TagsObject") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_administrators_operations.py index d5c580a3ba12..8698da37c1cf 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_administrators_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -149,7 +150,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(properties, (IO, bytes)): + if isinstance(properties, (IOBase, bytes)): _content = properties else: _json = self._serialize.body(properties, "ServerAdministratorResource") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_keys_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_keys_operations.py index 6e33e1e010f8..3053fde26e28 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_keys_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -229,7 +230,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerKey") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_parameters_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_parameters_operations.py index 6b9a5118111a..67235b1be84a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_parameters_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_parameters_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -78,7 +79,7 @@ async def _list_update_configurations_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(value, (IO, bytes)): + if isinstance(value, (IOBase, bytes)): _content = value else: _json = self._serialize.body(value, "ConfigurationListResult") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_security_alert_policies_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_security_alert_policies_operations.py index 4cf8b30983e4..97c5ea401c8e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_security_alert_policies_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_server_security_alert_policies_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -156,7 +157,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerSecurityAlertPolicy") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_servers_operations.py index 16530a7025d2..384fa092db26 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_servers_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -87,7 +88,7 @@ async def _create_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerForCreate") @@ -312,7 +313,7 @@ async def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerUpdateParameters") @@ -1190,7 +1191,7 @@ async def _upgrade_initial( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerUpgradeParameters") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_top_query_statistics_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_top_query_statistics_operations.py index 5d6f664444eb..798a871286c5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_top_query_statistics_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_top_query_statistics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -219,7 +220,7 @@ def list_by_server( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TopQueryStatisticsInput") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_virtual_network_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_virtual_network_rules_operations.py index b3af952c4adc..f8492cdc88fc 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_virtual_network_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_virtual_network_rules_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -153,7 +154,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualNetworkRule") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_wait_statistics_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_wait_statistics_operations.py index 16f47ff45102..861eb074c189 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_wait_statistics_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/aio/operations/_wait_statistics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -219,7 +220,7 @@ def list_by_server( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WaitStatisticsInput") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_advisors_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_advisors_operations.py index 8d2918d220b3..37e2f88889aa 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_advisors_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_advisors_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +58,7 @@ def build_get_request( "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,7 +91,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_check_name_availability_operations.py index d3917e649eaa..0da8b4e1a855 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_check_name_availability_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -25,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +51,7 @@ def build_execute_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,7 +158,7 @@ def execute( content_type = content_type or "application/json" _json = None _content = None - if isinstance(name_availability_request, (IO, bytes)): + if isinstance(name_availability_request, (IOBase, bytes)): _content = name_availability_request else: _json = self._serialize.body(name_availability_request, "NameAvailabilityRequest") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_configurations_operations.py index c3216f3f10bb..fd00c431baa6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_configurations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -61,7 +62,7 @@ def build_create_or_update_request( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +98,7 @@ def build_get_request( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,7 +131,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,7 +187,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Configuration") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_databases_operations.py index 88035096e6f0..7e27c311229d 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_databases_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -61,7 +62,7 @@ def build_create_or_update_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +98,7 @@ def build_delete_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,7 +132,7 @@ def build_get_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +165,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -220,7 +221,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Database") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_firewall_rules_operations.py index a7fd17b53a21..ada50a363361 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_firewall_rules_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -61,7 +62,7 @@ def build_create_or_update_request( "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +98,7 @@ def build_delete_request( "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,7 +132,7 @@ def build_get_request( "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +165,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -220,7 +221,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FirewallRule") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_performance_tier_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_performance_tier_operations.py index 0cc38df1e1e3..407331d492af 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_performance_tier_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_performance_tier_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +52,7 @@ def build_list_request(location_name: str, subscription_id: str, **kwargs: Any) "locationName": _SERIALIZER.url("location_name", location_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_operation_status_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_operation_status_operations.py index 157853639d36..47936d37806e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_operation_status_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_operation_status_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +52,7 @@ def build_get_request(location_name: str, operation_id: str, subscription_id: st "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_result_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_result_operations.py index f6d3bb7eb802..7910f226cc89 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_result_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_location_based_recommended_action_sessions_result_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_list_request(location_name: str, operation_id: str, subscription_id: s "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_log_files_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_log_files_operations.py index 6e945cc66e48..c54854d790f7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_log_files_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_log_files_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +57,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_my_sql_management_client_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_my_sql_management_client_operations.py index fcc82a1c72c6..895bf05d5e85 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_my_sql_management_client_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_my_sql_management_client_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -36,7 +36,7 @@ _SERIALIZER.client_side_validation = False -def build_reset_query_performance_insight_data_request( # pylint: disable=name-too-long +def build_reset_query_performance_insight_data_request( resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -58,7 +58,7 @@ def build_reset_query_performance_insight_data_request( # pylint: disable=name- "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -69,7 +69,7 @@ def build_reset_query_performance_insight_data_request( # pylint: disable=name- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_recommended_action_session_request( # pylint: disable=name-too-long +def build_create_recommended_action_session_request( resource_group_name: str, server_name: str, advisor_name: str, @@ -95,7 +95,7 @@ def build_create_recommended_action_session_request( # pylint: disable=name-too "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,7 +169,7 @@ def reset_query_performance_insight_data( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/resetQueryPerformanceInsightData" } - def _create_recommended_action_session_initial( # pylint: disable=inconsistent-return-statements,name-too-long + def _create_recommended_action_session_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, advisor_name: str, database_name: str, **kwargs: Any ) -> None: error_map = { diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_endpoint_connections_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_endpoint_connections_operations.py index 0e8862fd6f90..b9deea2a6d8d 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_endpoint_connections_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_endpoint_connections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +67,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -149,7 +150,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,7 +191,7 @@ def build_update_tags_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -225,7 +226,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -348,7 +349,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PrivateEndpointConnection") @@ -699,7 +700,7 @@ def _update_tags_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TagsObject") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_link_resources_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_link_resources_operations.py index dd6d198c9733..10a20a107a6a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_link_resources_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_private_link_resources_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +57,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,7 +91,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_query_texts_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_query_texts_operations.py index e06bbdab35c7..f8c8b9a5c555 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_query_texts_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_query_texts_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +58,7 @@ def build_get_request( "queryId": _SERIALIZER.url("query_id", query_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,7 +91,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recommended_actions_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recommended_actions_operations.py index 565037375623..ae54649837e4 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recommended_actions_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recommended_actions_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -64,7 +64,7 @@ def build_get_request( "recommendedActionName": _SERIALIZER.url("recommended_action_name", recommended_action_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -104,7 +104,7 @@ def build_list_by_server_request( "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recoverable_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recoverable_servers_operations.py index d9dc423d2ce5..8a18abf0a127 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recoverable_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_recoverable_servers_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -54,7 +54,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_replicas_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_replicas_operations.py index 9e26c24ea373..f7f75864b288 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_replicas_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_replicas_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +57,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_administrators_operations.py index e0ee5a8a9fea..4e259d11106d 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_administrators_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +58,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,7 +92,7 @@ def build_create_or_update_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +127,7 @@ def build_delete_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,7 +158,7 @@ def build_list_request(resource_group_name: str, server_name: str, subscription_ "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -274,7 +275,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(properties, (IO, bytes)): + if isinstance(properties, (IOBase, bytes)): _content = properties else: _json = self._serialize.body(properties, "ServerAdministratorResource") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_based_performance_tier_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_based_performance_tier_operations.py index 76f5ce63736f..cc56c51d71db 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_based_performance_tier_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_based_performance_tier_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -55,7 +55,7 @@ def build_list_request(resource_group_name: str, server_name: str, subscription_ "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_keys_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_keys_operations.py index 37ab2c723dec..7bd8b1faf942 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_keys_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +58,7 @@ def build_list_request(resource_group_name: str, server_name: str, subscription_ "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,7 +92,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +127,7 @@ def build_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -162,7 +163,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -361,7 +362,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerKey") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_parameters_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_parameters_operations.py index 83cdef0d126c..1df03c48c20e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_parameters_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_parameters_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -27,7 +28,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -59,7 +60,7 @@ def build_list_update_configurations_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +117,7 @@ def _list_update_configurations_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(value, (IO, bytes)): + if isinstance(value, (IOBase, bytes)): _content = value else: _json = self._serialize.body(value, "ConfigurationListResult") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_security_alert_policies_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_security_alert_policies_operations.py index 9325a1f9e916..a6bf42999335 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_security_alert_policies_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_server_security_alert_policies_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -64,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,7 +104,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +139,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -265,7 +266,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerSecurityAlertPolicy") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_servers_operations.py index f2dfd7a09100..9cd544bf44ec 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_servers_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +61,7 @@ def build_create_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,7 +97,7 @@ def build_update_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,7 +132,7 @@ def build_delete_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -162,7 +163,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -192,7 +193,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -216,7 +217,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -249,7 +250,7 @@ def build_restart_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -280,7 +281,7 @@ def build_start_request(resource_group_name: str, server_name: str, subscription "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -311,7 +312,7 @@ def build_stop_request(resource_group_name: str, server_name: str, subscription_ "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -345,7 +346,7 @@ def build_upgrade_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -398,7 +399,7 @@ def _create_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerForCreate") @@ -620,7 +621,7 @@ def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerUpdateParameters") @@ -1495,7 +1496,7 @@ def _upgrade_initial( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerUpgradeParameters") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_top_query_statistics_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_top_query_statistics_operations.py index 7e8b270f4b2b..fcce027b11fd 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_top_query_statistics_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_top_query_statistics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +59,7 @@ def build_get_request( "queryStatisticId": _SERIALIZER.url("query_statistic_id", query_statistic_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,7 +93,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,7 +291,7 @@ def list_by_server( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TopQueryStatisticsInput") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_virtual_network_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_virtual_network_rules_operations.py index cc58f677fd6f..214a5c3b2258 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_virtual_network_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_virtual_network_rules_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -28,7 +29,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +61,7 @@ def build_get_request( "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,7 +96,7 @@ def build_create_or_update_request( "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +129,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,7 +159,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -281,7 +282,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualNetworkRule") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_wait_statistics_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_wait_statistics_operations.py index 686ccf7b85ec..8c3c30dfddcb 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_wait_statistics_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_wait_statistics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import MySQLManagementClientMixinABC, _convert_request, _format_url_section +from .._vendor import MySQLManagementClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +59,7 @@ def build_get_request( "waitStatisticsId": _SERIALIZER.url("wait_statistics_id", wait_statistics_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,7 +93,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,7 +291,7 @@ def list_by_server( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WaitStatisticsInput") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_configuration.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_configuration.py index 7b699f78062e..ee0d6f0a455f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_configuration.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_configuration.py @@ -27,12 +27,17 @@ class MySQLManagementClientConfiguration(Configuration): # pylint: disable=too- :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(MySQLManagementClientConfiguration, self).__init__(**kwargs) + api_version: str = kwargs.pop("api_version", "2023-06-01-preview") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -40,6 +45,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-rdbms/{}".format(VERSION)) self._configure(**kwargs) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_my_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_my_sql_management_client.py index 6db86f666b1f..351ba4142671 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_my_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_my_sql_management_client.py @@ -27,9 +27,12 @@ FirewallRulesOperations, GetPrivateDnsZoneSuffixOperations, LocationBasedCapabilitiesOperations, + LocationBasedCapabilitySetOperations, LogFilesOperations, + OperationResultsOperations, Operations, ReplicasOperations, + ServersMigrationOperations, ServersOperations, ) @@ -63,11 +66,17 @@ class MySQLManagementClient: # pylint: disable=client-accepts-api-version-keywo :vartype servers: azure.mgmt.rdbms.mysql_flexibleservers.operations.ServersOperations :ivar replicas: ReplicasOperations operations :vartype replicas: azure.mgmt.rdbms.mysql_flexibleservers.operations.ReplicasOperations + :ivar servers_migration: ServersMigrationOperations operations + :vartype servers_migration: + azure.mgmt.rdbms.mysql_flexibleservers.operations.ServersMigrationOperations :ivar log_files: LogFilesOperations operations :vartype log_files: azure.mgmt.rdbms.mysql_flexibleservers.operations.LogFilesOperations :ivar location_based_capabilities: LocationBasedCapabilitiesOperations operations :vartype location_based_capabilities: azure.mgmt.rdbms.mysql_flexibleservers.operations.LocationBasedCapabilitiesOperations + :ivar location_based_capability_set: LocationBasedCapabilitySetOperations operations + :vartype location_based_capability_set: + azure.mgmt.rdbms.mysql_flexibleservers.operations.LocationBasedCapabilitySetOperations :ivar check_virtual_network_subnet_usage: CheckVirtualNetworkSubnetUsageOperations operations :vartype check_virtual_network_subnet_usage: azure.mgmt.rdbms.mysql_flexibleservers.operations.CheckVirtualNetworkSubnetUsageOperations @@ -78,6 +87,9 @@ class MySQLManagementClient: # pylint: disable=client-accepts-api-version-keywo operations :vartype check_name_availability_without_location: azure.mgmt.rdbms.mysql_flexibleservers.operations.CheckNameAvailabilityWithoutLocationOperations + :ivar operation_results: OperationResultsOperations operations + :vartype operation_results: + azure.mgmt.rdbms.mysql_flexibleservers.operations.OperationResultsOperations :ivar get_private_dns_zone_suffix: GetPrivateDnsZoneSuffixOperations operations :vartype get_private_dns_zone_suffix: azure.mgmt.rdbms.mysql_flexibleservers.operations.GetPrivateDnsZoneSuffixOperations @@ -85,10 +97,13 @@ class MySQLManagementClient: # pylint: disable=client-accepts-api-version-keywo :vartype operations: azure.mgmt.rdbms.mysql_flexibleservers.operations.Operations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -121,10 +136,16 @@ def __init__( self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) self.replicas = ReplicasOperations(self._client, self._config, self._serialize, self._deserialize) + self.servers_migration = ServersMigrationOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.log_files = LogFilesOperations(self._client, self._config, self._serialize, self._deserialize) self.location_based_capabilities = LocationBasedCapabilitiesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.location_based_capability_set = LocationBasedCapabilitySetOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.check_virtual_network_subnet_usage = CheckVirtualNetworkSubnetUsageOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -134,6 +155,9 @@ def __init__( self.check_name_availability_without_location = CheckNameAvailabilityWithoutLocationOperations( self._client, self._config, self._serialize, self._deserialize ) + self.operation_results = OperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.get_private_dns_zone_suffix = GetPrivateDnsZoneSuffixOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_serialization.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_serialization.py index 842ae727fbbc..4bae2292227b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_serialization.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_serialization.py @@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_vendor.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_vendor.py index bd0df84f5319..0dafe0e287ff 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_vendor.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_version.py index 0e54abf8a90d..e5754a47ce68 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.2.0b10" +VERSION = "1.0.0b1" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_configuration.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_configuration.py index aeda478aee23..9f07a4f635cd 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_configuration.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_configuration.py @@ -27,12 +27,17 @@ class MySQLManagementClientConfiguration(Configuration): # pylint: disable=too- :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(MySQLManagementClientConfiguration, self).__init__(**kwargs) + api_version: str = kwargs.pop("api_version", "2023-06-01-preview") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -40,6 +45,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-rdbms/{}".format(VERSION)) self._configure(**kwargs) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_my_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_my_sql_management_client.py index 32602390ad78..58913f976407 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_my_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/_my_sql_management_client.py @@ -27,9 +27,12 @@ FirewallRulesOperations, GetPrivateDnsZoneSuffixOperations, LocationBasedCapabilitiesOperations, + LocationBasedCapabilitySetOperations, LogFilesOperations, + OperationResultsOperations, Operations, ReplicasOperations, + ServersMigrationOperations, ServersOperations, ) @@ -63,11 +66,17 @@ class MySQLManagementClient: # pylint: disable=client-accepts-api-version-keywo :vartype servers: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.ServersOperations :ivar replicas: ReplicasOperations operations :vartype replicas: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.ReplicasOperations + :ivar servers_migration: ServersMigrationOperations operations + :vartype servers_migration: + azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.ServersMigrationOperations :ivar log_files: LogFilesOperations operations :vartype log_files: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.LogFilesOperations :ivar location_based_capabilities: LocationBasedCapabilitiesOperations operations :vartype location_based_capabilities: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.LocationBasedCapabilitiesOperations + :ivar location_based_capability_set: LocationBasedCapabilitySetOperations operations + :vartype location_based_capability_set: + azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.LocationBasedCapabilitySetOperations :ivar check_virtual_network_subnet_usage: CheckVirtualNetworkSubnetUsageOperations operations :vartype check_virtual_network_subnet_usage: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.CheckVirtualNetworkSubnetUsageOperations @@ -78,6 +87,9 @@ class MySQLManagementClient: # pylint: disable=client-accepts-api-version-keywo operations :vartype check_name_availability_without_location: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.CheckNameAvailabilityWithoutLocationOperations + :ivar operation_results: OperationResultsOperations operations + :vartype operation_results: + azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.OperationResultsOperations :ivar get_private_dns_zone_suffix: GetPrivateDnsZoneSuffixOperations operations :vartype get_private_dns_zone_suffix: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.GetPrivateDnsZoneSuffixOperations @@ -85,10 +97,13 @@ class MySQLManagementClient: # pylint: disable=client-accepts-api-version-keywo :vartype operations: azure.mgmt.rdbms.mysql_flexibleservers.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -121,10 +136,16 @@ def __init__( self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) self.replicas = ReplicasOperations(self._client, self._config, self._serialize, self._deserialize) + self.servers_migration = ServersMigrationOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.log_files = LogFilesOperations(self._client, self._config, self._serialize, self._deserialize) self.location_based_capabilities = LocationBasedCapabilitiesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.location_based_capability_set = LocationBasedCapabilitySetOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.check_virtual_network_subnet_usage = CheckVirtualNetworkSubnetUsageOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -134,6 +155,9 @@ def __init__( self.check_name_availability_without_location = CheckNameAvailabilityWithoutLocationOperations( self._client, self._config, self._serialize, self._deserialize ) + self.operation_results = OperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.get_private_dns_zone_suffix = GetPrivateDnsZoneSuffixOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/__init__.py index 08c628080505..357a2f586b56 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/__init__.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/__init__.py @@ -14,11 +14,14 @@ from ._firewall_rules_operations import FirewallRulesOperations from ._servers_operations import ServersOperations from ._replicas_operations import ReplicasOperations +from ._servers_migration_operations import ServersMigrationOperations from ._log_files_operations import LogFilesOperations from ._location_based_capabilities_operations import LocationBasedCapabilitiesOperations +from ._location_based_capability_set_operations import LocationBasedCapabilitySetOperations from ._check_virtual_network_subnet_usage_operations import CheckVirtualNetworkSubnetUsageOperations from ._check_name_availability_operations import CheckNameAvailabilityOperations from ._check_name_availability_without_location_operations import CheckNameAvailabilityWithoutLocationOperations +from ._operation_results_operations import OperationResultsOperations from ._get_private_dns_zone_suffix_operations import GetPrivateDnsZoneSuffixOperations from ._operations import Operations @@ -35,11 +38,14 @@ "FirewallRulesOperations", "ServersOperations", "ReplicasOperations", + "ServersMigrationOperations", "LogFilesOperations", "LocationBasedCapabilitiesOperations", + "LocationBasedCapabilitySetOperations", "CheckVirtualNetworkSubnetUsageOperations", "CheckNameAvailabilityOperations", "CheckNameAvailabilityWithoutLocationOperations", + "OperationResultsOperations", "GetPrivateDnsZoneSuffixOperations", "Operations", ] diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_azure_ad_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_azure_ad_administrators_operations.py index 3d6c3c336b04..f59422c48d93 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_azure_ad_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_azure_ad_administrators_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -78,14 +80,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.AzureADAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "AzureADAdministrator") @@ -115,7 +117,8 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -259,7 +262,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AzureADAdministrator] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -323,7 +326,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -348,7 +351,8 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -390,7 +394,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -467,7 +471,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AzureADAdministrator] = kwargs.pop("cls", None) request = build_get_request( @@ -492,7 +496,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("AzureADAdministrator", pipeline_response) @@ -526,7 +531,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) error_map = { @@ -553,7 +558,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -577,7 +593,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backup_and_export_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backup_and_export_operations.py index d89a0e55f31b..178d2243b2b8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backup_and_export_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backup_and_export_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -70,14 +71,14 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.BackupAndExportResponse]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "BackupAndExportRequest") @@ -106,7 +107,8 @@ async def _create_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None response_headers = {} @@ -242,7 +244,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupAndExportResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -316,7 +318,7 @@ async def validate_backup( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ValidateBackupResponse] = kwargs.pop("cls", None) request = build_validate_backup_request( @@ -340,7 +342,8 @@ async def validate_backup( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ValidateBackupResponse", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backups_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backups_operations.py index d746abf86f3f..f8f4253f0b16 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backups_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_backups_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -81,7 +82,7 @@ async def put( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerBackup] = kwargs.pop("cls", None) request = build_put_request( @@ -106,7 +107,8 @@ async def put( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerBackup", pipeline_response) @@ -148,7 +150,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerBackup] = kwargs.pop("cls", None) request = build_get_request( @@ -173,7 +175,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerBackup", pipeline_response) @@ -206,7 +209,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -233,7 +236,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -257,7 +271,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_operations.py index 6a17c36a4d63..9b9e91c60f87 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -132,14 +133,14 @@ async def execute( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.NameAvailability] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(name_availability_request, (IO, bytes)): + if isinstance(name_availability_request, (IOBase, bytes)): _content = name_availability_request else: _json = self._serialize.body(name_availability_request, "NameAvailabilityRequest") @@ -167,7 +168,8 @@ async def execute( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("NameAvailability", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_without_location_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_without_location_operations.py index d53f15555dcf..bffd7914b518 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_without_location_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_name_availability_without_location_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -120,14 +121,14 @@ async def execute( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.NameAvailability] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(name_availability_request, (IO, bytes)): + if isinstance(name_availability_request, (IOBase, bytes)): _content = name_availability_request else: _json = self._serialize.body(name_availability_request, "NameAvailabilityRequest") @@ -154,7 +155,8 @@ async def execute( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("NameAvailability", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_virtual_network_subnet_usage_operations.py index 059d3ddfb09f..0d59feccfdc8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_check_virtual_network_subnet_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -125,14 +126,14 @@ async def execute( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualNetworkSubnetUsageResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualNetworkSubnetUsageParameter") @@ -160,7 +161,8 @@ async def execute( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualNetworkSubnetUsageResult", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_configurations_operations.py index 116357cf992d..fe56ed39cc0a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_configurations_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -79,14 +81,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Configuration]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Configuration") @@ -116,7 +118,8 @@ async def _create_or_update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None response_headers = {} @@ -256,7 +259,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Configuration] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -321,14 +324,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Configuration]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Configuration") @@ -358,7 +361,8 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -494,7 +498,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Configuration] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -569,7 +573,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Configuration] = kwargs.pop("cls", None) request = build_get_request( @@ -594,7 +598,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Configuration", pipeline_response) @@ -625,14 +630,14 @@ async def _batch_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ConfigurationListResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ConfigurationListForBatchUpdate") @@ -661,7 +666,8 @@ async def _batch_update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -790,7 +796,7 @@ async def begin_batch_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ConfigurationListResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -873,7 +879,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConfigurationListResult] = kwargs.pop("cls", None) error_map = { @@ -904,7 +910,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -928,7 +945,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_databases_operations.py index 10dfc7281b56..25d8dc993c73 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_databases_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -78,14 +80,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Database") @@ -115,7 +117,8 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -254,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -314,7 +317,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -339,7 +342,8 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -376,7 +380,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +450,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) request = build_get_request( @@ -471,7 +475,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Database", pipeline_response) @@ -504,7 +509,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -531,7 +536,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -555,7 +571,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_firewall_rules_operations.py index 611b9c3c5083..71287c7d01a7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_firewall_rules_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -78,14 +80,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FirewallRule") @@ -115,7 +117,8 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: @@ -254,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -314,7 +317,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -339,7 +342,8 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -376,7 +380,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +450,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) request = build_get_request( @@ -471,7 +475,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("FirewallRule", pipeline_response) @@ -504,7 +509,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { @@ -531,7 +536,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -555,7 +571,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py index 4dca276ee241..a9aab936d44f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py @@ -70,7 +70,7 @@ async def execute(self, **kwargs: Any) -> _models.GetPrivateDnsZoneSuffixRespons _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GetPrivateDnsZoneSuffixResponse] = kwargs.pop("cls", None) request = build_execute_request( @@ -91,7 +91,8 @@ async def execute(self, **kwargs: Any) -> _models.GetPrivateDnsZoneSuffixRespons if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("GetPrivateDnsZoneSuffixResponse", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capabilities_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capabilities_operations.py index 32c64c2c636f..b6ede904d612 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capabilities_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capabilities_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -67,7 +68,7 @@ def list(self, location_name: str, **kwargs: Any) -> AsyncIterable["_models.Capa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CapabilitiesListResult] = kwargs.pop("cls", None) error_map = { @@ -93,7 +94,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -117,7 +129,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capability_set_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capability_set_operations.py new file mode 100644 index 000000000000..f83751b61606 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_location_based_capability_set_operations.py @@ -0,0 +1,203 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._location_based_capability_set_operations import build_get_request, build_list_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class LocationBasedCapabilitySetOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.rdbms.mysql_flexibleservers.aio.MySQLManagementClient`'s + :attr:`location_based_capability_set` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location_name: str, **kwargs: Any) -> AsyncIterable["_models.Capability"]: + """Get capabilities at specified location in a given subscription. + + :param location_name: The name of the location. Required. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Capability or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.rdbms.mysql_flexibleservers.models.Capability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.CapabilitySetsList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("CapabilitySetsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets" + } + + @distributed_trace_async + async def get(self, location_name: str, capability_set_name: str = "default", **kwargs: Any) -> _models.Capability: + """Get capabilities at specified location in a given subscription. + + :param location_name: The name of the location. Required. + :type location_name: str + :param capability_set_name: Name of capability set. Default value is "default". + :type capability_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Capability or the result of cls(response) + :rtype: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Capability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Capability] = kwargs.pop("cls", None) + + request = build_get_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + capability_set_name=capability_set_name, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Capability", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}" + } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_log_files_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_log_files_operations.py index 5c0282bf7acf..866390b6d8b6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_log_files_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_log_files_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -71,7 +72,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogFileListResult] = kwargs.pop("cls", None) error_map = { @@ -98,7 +99,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -122,7 +134,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operation_results_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operation_results_operations.py new file mode 100644 index 000000000000..e83b5d9028df --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operation_results_operations.py @@ -0,0 +1,115 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_results_operations import build_get_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OperationResultsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.rdbms.mysql_flexibleservers.aio.MySQLManagementClient`'s + :attr:`operation_results` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location_name: str, operation_id: str, **kwargs: Any) -> _models.OperationStatusExtendedResult: + """Get the operation result for a long running operation. + + Get the operation result for a long running operation. + + :param location_name: The name of the location. Required. + :type location_name: str + :param operation_id: The operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusExtendedResult or the result of cls(response) + :rtype: ~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatusExtendedResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationStatusExtendedResult] = kwargs.pop("cls", None) + + request = build_get_request( + location_name=location_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusExtendedResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}" + } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operations.py index ecac65f94ce4..b80aee6e15d8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -64,7 +65,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -88,7 +89,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -112,7 +124,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_replicas_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_replicas_operations.py index 4e9326289ac9..e0483a42d823 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_replicas_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_replicas_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -71,7 +72,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -98,7 +99,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -122,7 +134,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_migration_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_migration_operations.py new file mode 100644 index 000000000000..a39df3377725 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_migration_operations.py @@ -0,0 +1,188 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._servers_migration_operations import build_cutover_migration_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ServersMigrationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.rdbms.mysql_flexibleservers.aio.MySQLManagementClient`'s + :attr:`servers_migration` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _cutover_migration_initial( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> Optional[_models.Server]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) + + request = build_cutover_migration_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._cutover_migration_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("Server", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _cutover_migration_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration" + } + + @distributed_trace_async + async def begin_cutover_migration( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Cutover migration for MySQL import, it will switch source elastic server DNS to flexible + server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Server or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.rdbms.mysql_flexibleservers.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Server] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._cutover_migration_initial( + resource_group_name=resource_group_name, + server_name=server_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Server", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_cutover_migration.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration" + } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_operations.py index 0029f178ef58..3383181454f5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/aio/operations/_servers_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -80,14 +82,14 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Server") @@ -116,7 +118,8 @@ async def _create_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None response_headers = {} @@ -249,7 +252,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -308,14 +311,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerForUpdate") @@ -344,7 +347,8 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None response_headers = {} @@ -474,7 +478,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -533,7 +537,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -557,7 +561,8 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -594,7 +599,7 @@ async def begin_delete(self, resource_group_name: str, server_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -662,7 +667,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( @@ -686,7 +691,8 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Server", pipeline_response) @@ -715,7 +721,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -741,7 +747,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -765,7 +782,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -788,7 +806,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Server"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -813,7 +831,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -837,7 +866,8 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -859,7 +889,7 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -883,7 +913,8 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -920,7 +951,7 @@ async def begin_failover(self, resource_group_name: str, server_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -978,14 +1009,14 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerRestartParameter") @@ -1014,7 +1045,8 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1133,7 +1165,7 @@ async def begin_restart( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1190,7 +1222,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( @@ -1214,7 +1246,8 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1251,7 +1284,7 @@ async def begin_start(self, resource_group_name: str, server_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1305,7 +1338,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -1329,7 +1362,8 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1366,7 +1400,7 @@ async def begin_stop(self, resource_group_name: str, server_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1424,14 +1458,14 @@ async def _reset_gtid_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerGtidSetParameter") @@ -1460,7 +1494,8 @@ async def _reset_gtid_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1579,7 +1614,7 @@ async def begin_reset_gtid( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/__init__.py index 5c66478b7902..82361c37dcf6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/__init__.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/__init__.py @@ -15,7 +15,9 @@ from ._models_py3 import BackupSettings from ._models_py3 import BackupStoreDetails from ._models_py3 import CapabilitiesListResult +from ._models_py3 import Capability from ._models_py3 import CapabilityProperties +from ._models_py3 import CapabilitySetsList from ._models_py3 import Configuration from ._models_py3 import ConfigurationForBatchUpdate from ._models_py3 import ConfigurationListForBatchUpdate @@ -25,35 +27,45 @@ from ._models_py3 import DatabaseListResult from ._models_py3 import DelegatedSubnetUsage from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse from ._models_py3 import FirewallRule from ._models_py3 import FirewallRuleListResult from ._models_py3 import FullBackupStoreDetails from ._models_py3 import GetPrivateDnsZoneSuffixResponse from ._models_py3 import HighAvailability -from ._models_py3 import Identity +from ._models_py3 import ImportSourceProperties from ._models_py3 import LogFile from ._models_py3 import LogFileListResult from ._models_py3 import MaintenanceWindow +from ._models_py3 import MySQLServerIdentity +from ._models_py3 import MySQLServerSku from ._models_py3 import NameAvailability from ._models_py3 import NameAvailabilityRequest from ._models_py3 import Network from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult +from ._models_py3 import OperationStatusExtendedResult +from ._models_py3 import OperationStatusResult +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import Server from ._models_py3 import ServerBackup from ._models_py3 import ServerBackupListResult from ._models_py3 import ServerEditionCapability +from ._models_py3 import ServerEditionCapabilityV2 from ._models_py3 import ServerForUpdate from ._models_py3 import ServerGtidSetParameter from ._models_py3 import ServerListResult from ._models_py3 import ServerRestartParameter from ._models_py3 import ServerVersionCapability -from ._models_py3 import Sku +from ._models_py3 import ServerVersionCapabilityV2 from ._models_py3 import SkuCapability +from ._models_py3 import SkuCapabilityV2 from ._models_py3 import Storage from ._models_py3 import StorageEditionCapability from ._models_py3 import SystemData @@ -73,16 +85,19 @@ from ._my_sql_management_client_enums import EnableStatusEnum from ._my_sql_management_client_enums import HighAvailabilityMode from ._my_sql_management_client_enums import HighAvailabilityState +from ._my_sql_management_client_enums import ImportSourceStorageType from ._my_sql_management_client_enums import IsConfigPendingRestart from ._my_sql_management_client_enums import IsDynamicConfig from ._my_sql_management_client_enums import IsReadOnly from ._my_sql_management_client_enums import ManagedServiceIdentityType from ._my_sql_management_client_enums import OperationStatus +from ._my_sql_management_client_enums import PrivateEndpointConnectionProvisioningState +from ._my_sql_management_client_enums import PrivateEndpointServiceConnectionStatus from ._my_sql_management_client_enums import ReplicationRole from ._my_sql_management_client_enums import ResetAllToDefault +from ._my_sql_management_client_enums import ServerSkuTier from ._my_sql_management_client_enums import ServerState from ._my_sql_management_client_enums import ServerVersion -from ._my_sql_management_client_enums import SkuTier from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -97,7 +112,9 @@ "BackupSettings", "BackupStoreDetails", "CapabilitiesListResult", + "Capability", "CapabilityProperties", + "CapabilitySetsList", "Configuration", "ConfigurationForBatchUpdate", "ConfigurationListForBatchUpdate", @@ -107,35 +124,45 @@ "DatabaseListResult", "DelegatedSubnetUsage", "ErrorAdditionalInfo", + "ErrorDetail", "ErrorResponse", "FirewallRule", "FirewallRuleListResult", "FullBackupStoreDetails", "GetPrivateDnsZoneSuffixResponse", "HighAvailability", - "Identity", + "ImportSourceProperties", "LogFile", "LogFileListResult", "MaintenanceWindow", + "MySQLServerIdentity", + "MySQLServerSku", "NameAvailability", "NameAvailabilityRequest", "Network", "Operation", "OperationDisplay", "OperationListResult", + "OperationStatusExtendedResult", + "OperationStatusResult", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateLinkServiceConnectionState", "ProxyResource", "Resource", "Server", "ServerBackup", "ServerBackupListResult", "ServerEditionCapability", + "ServerEditionCapabilityV2", "ServerForUpdate", "ServerGtidSetParameter", "ServerListResult", "ServerRestartParameter", "ServerVersionCapability", - "Sku", + "ServerVersionCapabilityV2", "SkuCapability", + "SkuCapabilityV2", "Storage", "StorageEditionCapability", "SystemData", @@ -154,16 +181,19 @@ "EnableStatusEnum", "HighAvailabilityMode", "HighAvailabilityState", + "ImportSourceStorageType", "IsConfigPendingRestart", "IsDynamicConfig", "IsReadOnly", "ManagedServiceIdentityType", "OperationStatus", + "PrivateEndpointConnectionProvisioningState", + "PrivateEndpointServiceConnectionStatus", "ReplicationRole", "ResetAllToDefault", + "ServerSkuTier", "ServerState", "ServerVersion", - "SkuTier", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_models_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_models_py3.py index 02bbaf9b694d..d5f20b195fc6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_models_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_models_py3.py @@ -61,26 +61,31 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } def __init__(self, **kwargs: Any) -> None: @@ -89,6 +94,7 @@ def __init__(self, **kwargs: Any) -> None: self.id = None self.name = None self.type = None + self.system_data = None class ProxyResource(Resource): @@ -97,26 +103,31 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } def __init__(self, **kwargs: Any) -> None: @@ -129,15 +140,16 @@ class AzureADAdministrator(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar administrator_type: Type of the sever administrator. "ActiveDirectory" :vartype administrator_type: str or @@ -195,7 +207,6 @@ def __init__( :paramtype identity_resource_id: str """ super().__init__(**kwargs) - self.system_data = None self.administrator_type = administrator_type self.login = login self.sid = sid @@ -309,19 +320,45 @@ def __init__( self.target_details = target_details -class BackupAndExportResponse(ProxyResource): # pylint: disable=too-many-instance-attributes +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class BackupAndExportResponse(ProxyResource, ErrorResponse): # pylint: disable=too-many-instance-attributes """Represents BackupAndExport API Response. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar error: The error object. + :vartype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar status: The operation status. Known values are: "Pending", "InProgress", "Succeeded", "Failed", "CancelInProgress", and "Canceled". :vartype status: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatus @@ -331,8 +368,6 @@ class BackupAndExportResponse(ProxyResource): # pylint: disable=too-many-instan :vartype end_time: ~datetime.datetime :ivar percent_complete: Operation progress (0-100). :vartype percent_complete: float - :ivar error: The BackupAndExport operation error response. - :vartype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorResponse :ivar datasource_size_in_bytes: Size of datasource in bytes. :vartype datasource_size_in_bytes: int :ivar data_transferred_in_bytes: Data transferred in bytes. @@ -346,18 +381,20 @@ class BackupAndExportResponse(ProxyResource): # pylint: disable=too-many-instan "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "percent_complete": {"maximum": 100, "minimum": 0}, } _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "status": {"key": "status", "type": "str"}, "start_time": {"key": "startTime", "type": "iso-8601"}, "end_time": {"key": "endTime", "type": "iso-8601"}, "percent_complete": {"key": "percentComplete", "type": "float"}, - "error": {"key": "error", "type": "ErrorResponse"}, "datasource_size_in_bytes": {"key": "properties.datasourceSizeInBytes", "type": "int"}, "data_transferred_in_bytes": {"key": "properties.dataTransferredInBytes", "type": "int"}, "backup_metadata": {"key": "properties.backupMetadata", "type": "str"}, @@ -366,17 +403,19 @@ class BackupAndExportResponse(ProxyResource): # pylint: disable=too-many-instan def __init__( self, *, + error: Optional["_models.ErrorDetail"] = None, status: Optional[Union[str, "_models.OperationStatus"]] = None, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, percent_complete: Optional[float] = None, - error: Optional["_models.ErrorResponse"] = None, datasource_size_in_bytes: Optional[int] = None, data_transferred_in_bytes: Optional[int] = None, backup_metadata: Optional[str] = None, **kwargs: Any ) -> None: """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail :keyword status: The operation status. Known values are: "Pending", "InProgress", "Succeeded", "Failed", "CancelInProgress", and "Canceled". :paramtype status: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatus @@ -386,8 +425,6 @@ def __init__( :paramtype end_time: ~datetime.datetime :keyword percent_complete: Operation progress (0-100). :paramtype percent_complete: float - :keyword error: The BackupAndExport operation error response. - :paramtype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorResponse :keyword datasource_size_in_bytes: Size of datasource in bytes. :paramtype datasource_size_in_bytes: int :keyword data_transferred_in_bytes: Data transferred in bytes. @@ -396,15 +433,19 @@ def __init__( key-value pairs. :paramtype backup_metadata: str """ - super().__init__(**kwargs) + super().__init__(error=error, **kwargs) + self.error = error self.status = status self.start_time = start_time self.end_time = end_time self.percent_complete = percent_complete - self.error = error self.datasource_size_in_bytes = datasource_size_in_bytes self.data_transferred_in_bytes = data_transferred_in_bytes self.backup_metadata = backup_metadata + self.id = None + self.name = None + self.type = None + self.system_data = None class BackupSettings(_serialization.Model): @@ -415,7 +456,7 @@ class BackupSettings(_serialization.Model): :ivar backup_name: The name of the backup. Required. :vartype backup_name: str :ivar backup_format: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT - USE). Known values are: "None" and "CollatedFormat". + USE). Known values are: "CollatedFormat" and "Raw". :vartype backup_format: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.BackupFormat """ @@ -435,7 +476,7 @@ def __init__( :keyword backup_name: The name of the backup. Required. :paramtype backup_name: str :keyword backup_format: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO - NOT USE). Known values are: "None" and "CollatedFormat". + NOT USE). Known values are: "CollatedFormat" and "Raw". :paramtype backup_format: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.BackupFormat """ super().__init__(**kwargs) @@ -499,6 +540,66 @@ def __init__(self, **kwargs: Any) -> None: self.next_link = None +class Capability(ProxyResource): + """Represents a location capability set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData + :ivar supported_geo_backup_regions: supported geo backup regions. + :vartype supported_geo_backup_regions: list[str] + :ivar supported_flexible_server_editions: A list of supported flexible server editions. + :vartype supported_flexible_server_editions: + list[~azure.mgmt.rdbms.mysql_flexibleservers.models.ServerEditionCapabilityV2] + :ivar supported_server_versions: A list of supported server versions. + :vartype supported_server_versions: + list[~azure.mgmt.rdbms.mysql_flexibleservers.models.ServerVersionCapabilityV2] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "supported_geo_backup_regions": {"readonly": True}, + "supported_flexible_server_editions": {"readonly": True}, + "supported_server_versions": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "supported_geo_backup_regions": {"key": "properties.supportedGeoBackupRegions", "type": "[str]"}, + "supported_flexible_server_editions": { + "key": "properties.supportedFlexibleServerEditions", + "type": "[ServerEditionCapabilityV2]", + }, + "supported_server_versions": { + "key": "properties.supportedServerVersions", + "type": "[ServerVersionCapabilityV2]", + }, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.supported_geo_backup_regions = None + self.supported_flexible_server_editions = None + self.supported_server_versions = None + + class CapabilityProperties(_serialization.Model): """Location capabilities. @@ -541,20 +642,49 @@ def __init__(self, **kwargs: Any) -> None: self.supported_flexible_server_editions = None +class CapabilitySetsList(_serialization.Model): + """location capability set. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of supported capability sets. + :vartype value: list[~azure.mgmt.rdbms.mysql_flexibleservers.models.Capability] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Capability]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + class Configuration(ProxyResource): # pylint: disable=too-many-instance-attributes """Represents a Configuration. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar value: Value of the configuration. :vartype value: str @@ -635,7 +765,6 @@ def __init__( :paramtype source: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.ConfigurationSource """ super().__init__(**kwargs) - self.system_data = None self.value = value self.current_value = current_value self.description = None @@ -754,15 +883,16 @@ class Database(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar charset: The charset of the database. :vartype charset: str @@ -794,7 +924,6 @@ def __init__(self, *, charset: Optional[str] = None, collation: Optional[str] = :paramtype collation: str """ super().__init__(**kwargs) - self.system_data = None self.charset = charset self.collation = collation @@ -942,9 +1071,8 @@ def __init__(self, **kwargs: Any) -> None: self.info = None -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). +class ErrorDetail(_serialization.Model): + """The error detail. Variables are only populated by the server, and will be ignored when sending a request. @@ -955,7 +1083,7 @@ class ErrorResponse(_serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorResponse] + :vartype details: list[~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail] :ivar additional_info: The error additional info. :vartype additional_info: list[~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorAdditionalInfo] @@ -973,7 +1101,7 @@ class ErrorResponse(_serialization.Model): "code": {"key": "code", "type": "str"}, "message": {"key": "message", "type": "str"}, "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorResponse]"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } @@ -994,15 +1122,16 @@ class FirewallRule(ProxyResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar start_ip_address: The start IP address of the server firewall rule. Must be IPv4 format. Required. @@ -1046,7 +1175,6 @@ def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs: Any) :paramtype end_ip_address: str """ super().__init__(**kwargs) - self.system_data = None self.start_ip_address = start_ip_address self.end_ip_address = end_ip_address @@ -1178,52 +1306,54 @@ def __init__( self.standby_availability_zone = standby_availability_zone -class Identity(_serialization.Model): - """Properties to configure Identity for Bring your Own Keys. +class ImportSourceProperties(_serialization.Model): + """Import source related properties. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: ObjectId from the KeyVault. - :vartype principal_id: str - :ivar tenant_id: TenantId from the KeyVault. - :vartype tenant_id: str - :ivar type: Type of managed service identity. "UserAssigned" - :vartype type: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.ManagedServiceIdentityType - :ivar user_assigned_identities: Metadata of user assigned identity. - :vartype user_assigned_identities: dict[str, JSON] + :ivar storage_type: Storage type of import source. "AzureBlob" + :vartype storage_type: str or + ~azure.mgmt.rdbms.mysql_flexibleservers.models.ImportSourceStorageType + :ivar storage_url: Uri of the import source storage. + :vartype storage_url: str + :ivar sas_token: Sas token for accessing source storage. Read and list permissions are required + for sas token. + :vartype sas_token: str + :ivar data_dir_path: Relative path of data directory in storage. + :vartype data_dir_path: str """ - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{object}"}, + "storage_type": {"key": "storageType", "type": "str"}, + "storage_url": {"key": "storageUrl", "type": "str"}, + "sas_token": {"key": "sasToken", "type": "str"}, + "data_dir_path": {"key": "dataDirPath", "type": "str"}, } def __init__( self, *, - type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, JSON]] = None, + storage_type: Optional[Union[str, "_models.ImportSourceStorageType"]] = None, + storage_url: Optional[str] = None, + sas_token: Optional[str] = None, + data_dir_path: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword type: Type of managed service identity. "UserAssigned" - :paramtype type: str or - ~azure.mgmt.rdbms.mysql_flexibleservers.models.ManagedServiceIdentityType - :keyword user_assigned_identities: Metadata of user assigned identity. - :paramtype user_assigned_identities: dict[str, JSON] + :keyword storage_type: Storage type of import source. "AzureBlob" + :paramtype storage_type: str or + ~azure.mgmt.rdbms.mysql_flexibleservers.models.ImportSourceStorageType + :keyword storage_url: Uri of the import source storage. + :paramtype storage_url: str + :keyword sas_token: Sas token for accessing source storage. Read and list permissions are + required for sas token. + :paramtype sas_token: str + :keyword data_dir_path: Relative path of data directory in storage. + :paramtype data_dir_path: str """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities + self.storage_type = storage_type + self.storage_url = storage_url + self.sas_token = sas_token + self.data_dir_path = data_dir_path class LogFile(ProxyResource): @@ -1231,15 +1361,16 @@ class LogFile(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar size_in_kb: The size in kb of the logFile. :vartype size_in_kb: int @@ -1295,7 +1426,6 @@ def __init__( :paramtype url: str """ super().__init__(**kwargs) - self.system_data = None self.size_in_kb = size_in_kb self.created_time = created_time self.type_properties_type = type_properties_type @@ -1377,6 +1507,89 @@ def __init__( self.day_of_week = day_of_week +class MySQLServerIdentity(_serialization.Model): + """Properties to configure Identity for Bring your Own Keys. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: ObjectId from the KeyVault. + :vartype principal_id: str + :ivar tenant_id: TenantId from the KeyVault. + :vartype tenant_id: str + :ivar type: Type of managed service identity. "UserAssigned" + :vartype type: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.ManagedServiceIdentityType + :ivar user_assigned_identities: Metadata of user assigned identity. + :vartype user_assigned_identities: dict[str, JSON] + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{object}"}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, JSON]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Type of managed service identity. "UserAssigned" + :paramtype type: str or + ~azure.mgmt.rdbms.mysql_flexibleservers.models.ManagedServiceIdentityType + :keyword user_assigned_identities: Metadata of user assigned identity. + :paramtype user_assigned_identities: dict[str, JSON] + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class MySQLServerSku(_serialization.Model): + """Billing information related properties of a server. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the sku, e.g. Standard_D32s_v3. Required. + :vartype name: str + :ivar tier: The tier of the particular SKU, e.g. GeneralPurpose. Required. Known values are: + "Burstable", "GeneralPurpose", and "MemoryOptimized". + :vartype tier: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.ServerSkuTier + """ + + _validation = { + "name": {"required": True}, + "tier": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__(self, *, name: str, tier: Union[str, "_models.ServerSkuTier"], **kwargs: Any) -> None: + """ + :keyword name: The name of the sku, e.g. Standard_D32s_v3. Required. + :paramtype name: str + :keyword tier: The tier of the particular SKU, e.g. GeneralPurpose. Required. Known values are: + "Burstable", "GeneralPurpose", and "MemoryOptimized". + :paramtype tier: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.ServerSkuTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + class NameAvailability(_serialization.Model): """Represents a resource name availability. @@ -1615,6 +1828,338 @@ def __init__( self.next_link = next_link +class OperationStatusResult(_serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail + """ + + _validation = { + "resource_id": {"readonly": True}, + "status": {"required": True}, + "percent_complete": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "percent_complete": {"key": "percentComplete", "type": "float"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "operations": {"key": "operations", "type": "[OperationStatusResult]"}, + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[List["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Operation status. Required. + :paramtype status: str + :keyword percent_complete: Percent of the operation that is complete. + :paramtype percent_complete: float + :keyword start_time: The start time of the operation. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword operations: The operations list. + :paramtype operations: + list[~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatusResult] + :keyword error: If present, details of the operation error. + :paramtype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail + """ + super().__init__(**kwargs) + self.id = id + self.resource_id = None + self.name = name + self.status = status + self.percent_complete = percent_complete + self.start_time = start_time + self.end_time = end_time + self.operations = operations + self.error = error + + +class OperationStatusExtendedResult(OperationStatusResult): + """Represents Operation Results API Response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail + :ivar properties: The extended properties of Operation Results. + :vartype properties: dict[str, any] + """ + + _validation = { + "resource_id": {"readonly": True}, + "status": {"required": True}, + "percent_complete": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "percent_complete": {"key": "percentComplete", "type": "float"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "operations": {"key": "operations", "type": "[OperationStatusResult]"}, + "error": {"key": "error", "type": "ErrorDetail"}, + "properties": {"key": "properties", "type": "{object}"}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[List["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + properties: Optional[Dict[str, Any]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Operation status. Required. + :paramtype status: str + :keyword percent_complete: Percent of the operation that is complete. + :paramtype percent_complete: float + :keyword start_time: The start time of the operation. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword operations: The operations list. + :paramtype operations: + list[~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatusResult] + :keyword error: If present, details of the operation error. + :paramtype error: ~azure.mgmt.rdbms.mysql_flexibleservers.models.ErrorDetail + :keyword properties: The extended properties of Operation Results. + :paramtype properties: dict[str, any] + """ + super().__init__( + id=id, + name=name, + status=status, + percent_complete=percent_complete, + start_time=start_time, + end_time=end_time, + operations=operations, + error=error, + **kwargs + ) + self.properties = properties + + +class PrivateEndpoint(_serialization.Model): + """The private endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for private endpoint. + :vartype id: str + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The private endpoint connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData + :ivar group_ids: The group ids for the private endpoint resource. + :vartype group_ids: list[str] + :ivar private_endpoint: The private endpoint resource. + :vartype private_endpoint: ~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: + ~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Known values are: "Succeeded", "Creating", "Deleting", and "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "group_ids": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "group_ids": {"key": "properties.groupIds", "type": "[str]"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + private_endpoint: Optional["_models.PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + **kwargs: Any + ) -> None: + """ + :keyword private_endpoint: The private endpoint resource. + :paramtype private_endpoint: ~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateLinkServiceConnectionState + """ + super().__init__(**kwargs) + self.group_ids = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateLinkServiceConnectionState(_serialization.Model): + """A collection of information about the state of the connection between service consumer and + provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Known values are: "Pending", "Approved", and "Rejected". + :vartype status: str or + ~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateEndpointServiceConnectionStatus + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actions_required: str + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the + owner of the service. Known values are: "Pending", "Approved", and "Rejected". + :paramtype status: str or + ~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateEndpointServiceConnectionStatus + :keyword description: The reason for approval/rejection of the connection. + :paramtype description: str + :keyword actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :paramtype actions_required: str + """ + super().__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -1623,14 +2168,17 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. @@ -1641,6 +2189,7 @@ class TrackedResource(Resource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "location": {"required": True}, } @@ -1648,6 +2197,7 @@ class TrackedResource(Resource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, } @@ -1671,24 +2221,25 @@ class Server(TrackedResource): # pylint: disable=too-many-instance-attributes All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar identity: The cmk identity for the server. - :vartype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Identity + :vartype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerIdentity :ivar sku: The SKU (pricing tier) of the server. - :vartype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Sku - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData + :vartype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerSku :ivar administrator_login: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). :vartype administrator_login: str @@ -1728,30 +2279,37 @@ class Server(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype high_availability: ~azure.mgmt.rdbms.mysql_flexibleservers.models.HighAvailability :ivar network: Network related properties of a server. :vartype network: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Network + :ivar private_endpoint_connections: PrivateEndpointConnections related properties of a server. + :vartype private_endpoint_connections: + list[~azure.mgmt.rdbms.mysql_flexibleservers.models.PrivateEndpointConnection] :ivar maintenance_window: Maintenance window of a server. :vartype maintenance_window: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MaintenanceWindow + :ivar import_source_properties: Source properties for import from storage. + :vartype import_source_properties: + ~azure.mgmt.rdbms.mysql_flexibleservers.models.ImportSourceProperties """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "location": {"required": True}, "system_data": {"readonly": True}, + "location": {"required": True}, "replica_capacity": {"readonly": True, "minimum": 0}, "state": {"readonly": True}, "fully_qualified_domain_name": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, - "identity": {"key": "identity", "type": "Identity"}, - "sku": {"key": "sku", "type": "Sku"}, - "system_data": {"key": "systemData", "type": "SystemData"}, + "identity": {"key": "identity", "type": "MySQLServerIdentity"}, + "sku": {"key": "sku", "type": "MySQLServerSku"}, "administrator_login": {"key": "properties.administratorLogin", "type": "str"}, "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, "version": {"key": "properties.version", "type": "str"}, @@ -1768,7 +2326,12 @@ class Server(TrackedResource): # pylint: disable=too-many-instance-attributes "backup": {"key": "properties.backup", "type": "Backup"}, "high_availability": {"key": "properties.highAvailability", "type": "HighAvailability"}, "network": {"key": "properties.network", "type": "Network"}, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, "maintenance_window": {"key": "properties.maintenanceWindow", "type": "MaintenanceWindow"}, + "import_source_properties": {"key": "properties.importSourceProperties", "type": "ImportSourceProperties"}, } def __init__( # pylint: disable=too-many-locals @@ -1776,8 +2339,8 @@ def __init__( # pylint: disable=too-many-locals *, location: str, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.Identity"] = None, - sku: Optional["_models.Sku"] = None, + identity: Optional["_models.MySQLServerIdentity"] = None, + sku: Optional["_models.MySQLServerSku"] = None, administrator_login: Optional[str] = None, administrator_login_password: Optional[str] = None, version: Optional[Union[str, "_models.ServerVersion"]] = None, @@ -1792,6 +2355,7 @@ def __init__( # pylint: disable=too-many-locals high_availability: Optional["_models.HighAvailability"] = None, network: Optional["_models.Network"] = None, maintenance_window: Optional["_models.MaintenanceWindow"] = None, + import_source_properties: Optional["_models.ImportSourceProperties"] = None, **kwargs: Any ) -> None: """ @@ -1800,9 +2364,9 @@ def __init__( # pylint: disable=too-many-locals :keyword location: The geo-location where the resource lives. Required. :paramtype location: str :keyword identity: The cmk identity for the server. - :paramtype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Identity + :paramtype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerIdentity :keyword sku: The SKU (pricing tier) of the server. - :paramtype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Sku + :paramtype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerSku :keyword administrator_login: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). :paramtype administrator_login: str @@ -1837,11 +2401,13 @@ def __init__( # pylint: disable=too-many-locals :paramtype network: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Network :keyword maintenance_window: Maintenance window of a server. :paramtype maintenance_window: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MaintenanceWindow + :keyword import_source_properties: Source properties for import from storage. + :paramtype import_source_properties: + ~azure.mgmt.rdbms.mysql_flexibleservers.models.ImportSourceProperties """ super().__init__(tags=tags, location=location, **kwargs) self.identity = identity self.sku = sku - self.system_data = None self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.version = version @@ -1858,7 +2424,9 @@ def __init__( # pylint: disable=too-many-locals self.backup = backup self.high_availability = high_availability self.network = network + self.private_endpoint_connections = None self.maintenance_window = maintenance_window + self.import_source_properties = import_source_properties class ServerBackup(ProxyResource): @@ -1866,15 +2434,16 @@ class ServerBackup(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~azure.mgmt.rdbms.mysql_flexibleservers.models.SystemData :ivar backup_type: Backup type. :vartype backup_type: str @@ -1918,7 +2487,6 @@ def __init__( :paramtype source: str """ super().__init__(**kwargs) - self.system_data = None self.backup_type = backup_type self.completed_time = completed_time self.source = source @@ -1987,13 +2555,57 @@ def __init__(self, **kwargs: Any) -> None: self.supported_server_versions = None +class ServerEditionCapabilityV2(_serialization.Model): + """Server edition capabilities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Server edition name. + :vartype name: str + :ivar default_sku: Default Sku name. + :vartype default_sku: str + :ivar default_storage_size: Default storage size. + :vartype default_storage_size: int + :ivar supported_storage_editions: A list of supported storage editions. + :vartype supported_storage_editions: + list[~azure.mgmt.rdbms.mysql_flexibleservers.models.StorageEditionCapability] + :ivar supported_skus: A list of supported Skus. + :vartype supported_skus: list[~azure.mgmt.rdbms.mysql_flexibleservers.models.SkuCapabilityV2] + """ + + _validation = { + "name": {"readonly": True}, + "default_sku": {"readonly": True}, + "default_storage_size": {"readonly": True}, + "supported_storage_editions": {"readonly": True}, + "supported_skus": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "default_sku": {"key": "defaultSku", "type": "str"}, + "default_storage_size": {"key": "defaultStorageSize", "type": "int"}, + "supported_storage_editions": {"key": "supportedStorageEditions", "type": "[StorageEditionCapability]"}, + "supported_skus": {"key": "supportedSkus", "type": "[SkuCapabilityV2]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.default_sku = None + self.default_storage_size = None + self.supported_storage_editions = None + self.supported_skus = None + + class ServerForUpdate(_serialization.Model): # pylint: disable=too-many-instance-attributes """Parameters allowed to update for a server. :ivar identity: The cmk identity for the server. - :vartype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Identity + :vartype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerIdentity :ivar sku: The SKU (pricing tier) of the server. - :vartype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Sku + :vartype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerSku :ivar tags: Application-specific metadata in the form of key-value pairs. :vartype tags: dict[str, str] :ivar administrator_login_password: The password of the administrator login. @@ -2019,8 +2631,8 @@ class ServerForUpdate(_serialization.Model): # pylint: disable=too-many-instanc """ _attribute_map = { - "identity": {"key": "identity", "type": "Identity"}, - "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "MySQLServerIdentity"}, + "sku": {"key": "sku", "type": "MySQLServerSku"}, "tags": {"key": "tags", "type": "{str}"}, "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, "version": {"key": "properties.version", "type": "str"}, @@ -2036,8 +2648,8 @@ class ServerForUpdate(_serialization.Model): # pylint: disable=too-many-instanc def __init__( self, *, - identity: Optional["_models.Identity"] = None, - sku: Optional["_models.Sku"] = None, + identity: Optional["_models.MySQLServerIdentity"] = None, + sku: Optional["_models.MySQLServerSku"] = None, tags: Optional[Dict[str, str]] = None, administrator_login_password: Optional[str] = None, version: Optional[Union[str, "_models.ServerVersion"]] = None, @@ -2052,9 +2664,9 @@ def __init__( ) -> None: """ :keyword identity: The cmk identity for the server. - :paramtype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Identity + :paramtype identity: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerIdentity :keyword sku: The SKU (pricing tier) of the server. - :paramtype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Sku + :paramtype sku: ~azure.mgmt.rdbms.mysql_flexibleservers.models.MySQLServerSku :keyword tags: Application-specific metadata in the form of key-value pairs. :paramtype tags: dict[str, str] :keyword administrator_login_password: The password of the administrator login. @@ -2094,9 +2706,9 @@ def __init__( class ServerGtidSetParameter(_serialization.Model): - """Server gtid set parameters. + """Server Gtid set parameters. - :ivar gtid_set: The gtid set of server. + :ivar gtid_set: The Gtid set of server. :vartype gtid_set: str """ @@ -2106,7 +2718,7 @@ class ServerGtidSetParameter(_serialization.Model): def __init__(self, *, gtid_set: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword gtid_set: The gtid set of server. + :keyword gtid_set: The Gtid set of server. :paramtype gtid_set: str """ super().__init__(**kwargs) @@ -2205,39 +2817,27 @@ def __init__(self, **kwargs: Any) -> None: self.supported_skus = None -class Sku(_serialization.Model): - """Billing information related properties of a server. +class ServerVersionCapabilityV2(_serialization.Model): + """Server version capabilities. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the sku, e.g. Standard_D32s_v3. Required. + :ivar name: server version. :vartype name: str - :ivar tier: The tier of the particular SKU, e.g. GeneralPurpose. Required. Known values are: - "Burstable", "GeneralPurpose", and "MemoryOptimized". - :vartype tier: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.SkuTier """ _validation = { - "name": {"required": True}, - "tier": {"required": True}, + "name": {"readonly": True}, } _attribute_map = { "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, } - def __init__(self, *, name: str, tier: Union[str, "_models.SkuTier"], **kwargs: Any) -> None: - """ - :keyword name: The name of the sku, e.g. Standard_D32s_v3. Required. - :paramtype name: str - :keyword tier: The tier of the particular SKU, e.g. GeneralPurpose. Required. Known values are: - "Burstable", "GeneralPurpose", and "MemoryOptimized". - :paramtype tier: str or ~azure.mgmt.rdbms.mysql_flexibleservers.models.SkuTier - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.name = name - self.tier = tier + self.name = None class SkuCapability(_serialization.Model): @@ -2278,6 +2878,54 @@ def __init__(self, **kwargs: Any) -> None: self.supported_memory_per_v_core_mb = None +class SkuCapabilityV2(_serialization.Model): + """Sku capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: vCore name. + :vartype name: str + :ivar v_cores: supported vCores. + :vartype v_cores: int + :ivar supported_iops: supported IOPS. + :vartype supported_iops: int + :ivar supported_memory_per_v_core_mb: supported memory per vCore in MB. + :vartype supported_memory_per_v_core_mb: int + :ivar supported_zones: Supported zones. + :vartype supported_zones: list[str] + :ivar supported_ha_mode: Supported high availability mode. + :vartype supported_ha_mode: list[str] + """ + + _validation = { + "name": {"readonly": True}, + "v_cores": {"readonly": True}, + "supported_iops": {"readonly": True}, + "supported_memory_per_v_core_mb": {"readonly": True}, + "supported_zones": {"readonly": True}, + "supported_ha_mode": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "v_cores": {"key": "vCores", "type": "int"}, + "supported_iops": {"key": "supportedIops", "type": "int"}, + "supported_memory_per_v_core_mb": {"key": "supportedMemoryPerVCoreMB", "type": "int"}, + "supported_zones": {"key": "supportedZones", "type": "[str]"}, + "supported_ha_mode": {"key": "supportedHAMode", "type": "[str]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.v_cores = None + self.supported_iops = None + self.supported_memory_per_v_core_mb = None + self.supported_zones = None + self.supported_ha_mode = None + + class Storage(_serialization.Model): """Storage Profile properties of a server. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_my_sql_management_client_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_my_sql_management_client_enums.py index e6f82ca2ebcc..19915c2cff25 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_my_sql_management_client_enums.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/models/_my_sql_management_client_enums.py @@ -25,8 +25,8 @@ class AdministratorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class BackupFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE).""" - NONE = "None" COLLATED_FORMAT = "CollatedFormat" + RAW = "Raw" class ConfigurationSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -86,6 +86,12 @@ class HighAvailabilityState(str, Enum, metaclass=CaseInsensitiveEnumMeta): REMOVING_STANDBY = "RemovingStandby" +class ImportSourceStorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Storage type of import source.""" + + AZURE_BLOB = "AzureBlob" + + class IsConfigPendingRestart(str, Enum, metaclass=CaseInsensitiveEnumMeta): """If is the configuration pending restart or not.""" @@ -130,6 +136,23 @@ class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation has been Canceled""" +class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + + +class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The private endpoint connection status.""" + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + + class ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The replication role.""" @@ -145,6 +168,14 @@ class ResetAllToDefault(str, Enum, metaclass=CaseInsensitiveEnumMeta): FALSE = "False" +class ServerSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The tier of the particular SKU, e.g. GeneralPurpose.""" + + BURSTABLE = "Burstable" + GENERAL_PURPOSE = "GeneralPurpose" + MEMORY_OPTIMIZED = "MemoryOptimized" + + class ServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of a server.""" @@ -162,11 +193,3 @@ class ServerVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): FIVE7 = "5.7" EIGHT0_21 = "8.0.21" - - -class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The tier of the particular SKU, e.g. GeneralPurpose.""" - - BURSTABLE = "Burstable" - GENERAL_PURPOSE = "GeneralPurpose" - MEMORY_OPTIMIZED = "MemoryOptimized" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/__init__.py index 08c628080505..357a2f586b56 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/__init__.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/__init__.py @@ -14,11 +14,14 @@ from ._firewall_rules_operations import FirewallRulesOperations from ._servers_operations import ServersOperations from ._replicas_operations import ReplicasOperations +from ._servers_migration_operations import ServersMigrationOperations from ._log_files_operations import LogFilesOperations from ._location_based_capabilities_operations import LocationBasedCapabilitiesOperations +from ._location_based_capability_set_operations import LocationBasedCapabilitySetOperations from ._check_virtual_network_subnet_usage_operations import CheckVirtualNetworkSubnetUsageOperations from ._check_name_availability_operations import CheckNameAvailabilityOperations from ._check_name_availability_without_location_operations import CheckNameAvailabilityWithoutLocationOperations +from ._operation_results_operations import OperationResultsOperations from ._get_private_dns_zone_suffix_operations import GetPrivateDnsZoneSuffixOperations from ._operations import Operations @@ -35,11 +38,14 @@ "FirewallRulesOperations", "ServersOperations", "ReplicasOperations", + "ServersMigrationOperations", "LogFilesOperations", "LocationBasedCapabilitiesOperations", + "LocationBasedCapabilitySetOperations", "CheckVirtualNetworkSubnetUsageOperations", "CheckNameAvailabilityOperations", "CheckNameAvailabilityWithoutLocationOperations", + "OperationResultsOperations", "GetPrivateDnsZoneSuffixOperations", "Operations", ] diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_azure_ad_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_azure_ad_administrators_operations.py index 5de13d01fda2..6dc3fed9e446 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_azure_ad_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_azure_ad_administrators_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -57,7 +59,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -65,7 +67,7 @@ def build_create_or_update_request( "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +90,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +99,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -105,7 +107,7 @@ def build_delete_request( "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +128,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +137,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -143,7 +145,7 @@ def build_get_request( "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -160,7 +162,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,14 +171,14 @@ def build_list_by_server_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url("server_name", server_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -47,10 +48,10 @@ def build_execute_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability" ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -152,14 +153,14 @@ def execute( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.NameAvailability] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(name_availability_request, (IO, bytes)): + if isinstance(name_availability_request, (IOBase, bytes)): _content = name_availability_request else: _json = self._serialize.body(name_availability_request, "NameAvailabilityRequest") @@ -186,7 +187,8 @@ def execute( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("NameAvailability", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_check_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_check_virtual_network_subnet_usage_operations.py index d8de6bf1cf5a..ca84fe8a120a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_check_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_check_virtual_network_subnet_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -25,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +39,7 @@ def build_execute_request(location_name: str, subscription_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -48,11 +49,11 @@ def build_execute_request(location_name: str, subscription_id: str, **kwargs: An "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkVirtualNetworkSubnetUsage", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str", min_length=1, pattern=r"^[ \w]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,14 +160,14 @@ def execute( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualNetworkSubnetUsageResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualNetworkSubnetUsageParameter") @@ -194,7 +195,8 @@ def execute( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualNetworkSubnetUsageResult", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_configurations_operations.py index 264dd65b9f00..0e07971031b5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_configurations_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +45,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -53,7 +55,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -61,7 +63,7 @@ def build_create_or_update_request( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +82,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -90,7 +92,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -98,7 +100,7 @@ def build_update_request( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,7 +119,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +128,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -134,7 +136,7 @@ def build_get_request( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +153,7 @@ def build_batch_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -161,14 +163,14 @@ def build_batch_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/updateConfigurations", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url("server_name", server_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def execute(self, **kwargs: Any) -> _models.GetPrivateDnsZoneSuffixResponse: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GetPrivateDnsZoneSuffixResponse] = kwargs.pop("cls", None) request = build_execute_request( @@ -113,7 +113,8 @@ def execute(self, **kwargs: Any) -> _models.GetPrivateDnsZoneSuffixResponse: if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("GetPrivateDnsZoneSuffixResponse", pipeline_response) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capabilities_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capabilities_operations.py index bf26af8fa045..ecc787144ec9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capabilities_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capabilities_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +40,7 @@ def build_list_request(location_name: str, subscription_id: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -48,11 +49,11 @@ def build_list_request(location_name: str, subscription_id: str, **kwargs: Any) "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilities", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str", min_length=1, pattern=r"^[ \w]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +99,7 @@ def list(self, location_name: str, **kwargs: Any) -> Iterable["_models.Capabilit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CapabilitiesListResult] = kwargs.pop("cls", None) error_map = { @@ -124,7 +125,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -148,7 +160,8 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capability_set_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capability_set_operations.py new file mode 100644 index 000000000000..961001a89391 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_location_based_capability_set_operations.py @@ -0,0 +1,265 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str", min_length=1, pattern=r"^[ \w]+$"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + location_name: str, subscription_id: str, capability_set_name: str = "default", **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str", min_length=1, pattern=r"^[ \w]+$"), + "capabilitySetName": _SERIALIZER.url( + "capability_set_name", capability_set_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? Iterable["_models.Capability"]: + """Get capabilities at specified location in a given subscription. + + :param location_name: The name of the location. Required. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Capability or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.rdbms.mysql_flexibleservers.models.Capability] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.CapabilitySetsList] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("CapabilitySetsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets" + } + + @distributed_trace + def get(self, location_name: str, capability_set_name: str = "default", **kwargs: Any) -> _models.Capability: + """Get capabilities at specified location in a given subscription. + + :param location_name: The name of the location. Required. + :type location_name: str + :param capability_set_name: Name of capability set. Default value is "default". + :type capability_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Capability or the result of cls(response) + :rtype: ~azure.mgmt.rdbms.mysql_flexibleservers.models.Capability + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Capability] = kwargs.pop("cls", None) + + request = build_get_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + capability_set_name=capability_set_name, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Capability", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilitySets/{capabilitySetName}" + } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_log_files_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_log_files_operations.py index 9d9cfbb3f818..5ff86487d428 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_log_files_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_log_files_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +42,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,14 +51,14 @@ def build_list_by_server_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/logFiles", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url("server_name", server_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str", min_length=1, pattern=r"^[ \w]+$"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OperationResultsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.rdbms.mysql_flexibleservers.MySQLManagementClient`'s + :attr:`operation_results` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location_name: str, operation_id: str, **kwargs: Any) -> _models.OperationStatusExtendedResult: + """Get the operation result for a long running operation. + + Get the operation result for a long running operation. + + :param location_name: The name of the location. Required. + :type location_name: str + :param operation_id: The operation Id. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusExtendedResult or the result of cls(response) + :rtype: ~azure.mgmt.rdbms.mysql_flexibleservers.models.OperationStatusExtendedResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationStatusExtendedResult] = kwargs.pop("cls", None) + + request = build_get_request( + location_name=location_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusExtendedResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/operationResults/{operationId}" + } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_operations.py index 85816f0b3fad..167e4969e593 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -39,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +86,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -109,7 +110,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -133,7 +145,8 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_replicas_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_replicas_operations.py index d0770d19db1b..65d4ced575c1 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_replicas_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_replicas_operations.py @@ -7,6 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +42,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,14 +51,14 @@ def build_list_by_server_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/replicas", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url("server_name", server_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "serverName": _SERIALIZER.url("server_name", server_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? Optional[_models.Server]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) + + request = build_cutover_migration_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._cutover_migration_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("Server", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _cutover_migration_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration" + } + + @distributed_trace + def begin_cutover_migration( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> LROPoller[_models.Server]: + """Cutover migration for MySQL import, it will switch source elastic server DNS to flexible + server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Server or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.rdbms.mysql_flexibleservers.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Server] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._cutover_migration_initial( + resource_group_name=resource_group_name, + server_name=server_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Server", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_cutover_migration.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/cutoverMigration" + } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_servers_operations.py index 0137338622fc..b00629d91802 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_servers_operations.py @@ -6,7 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +45,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -53,14 +55,14 @@ def build_create_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url("server_name", server_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/flexibleServers") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -233,7 +235,7 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,14 +244,14 @@ def build_failover_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/failover", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url("server_name", server_name, "str", pattern=r"^[a-z0-9][-a-z0-9]*(? _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( @@ -1020,7 +1025,8 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Server", pipeline_response) @@ -1048,7 +1054,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -1074,7 +1080,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -1098,7 +1115,8 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1120,7 +1138,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Server"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -1145,7 +1163,18 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" @@ -1169,7 +1198,8 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1191,7 +1221,7 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -1215,7 +1245,8 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1252,7 +1283,7 @@ def begin_failover(self, resource_group_name: str, server_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1310,14 +1341,14 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerRestartParameter") @@ -1346,7 +1377,8 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1465,7 +1497,7 @@ def begin_restart( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1522,7 +1554,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( @@ -1546,7 +1578,8 @@ def _start_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1583,7 +1616,7 @@ def begin_start(self, resource_group_name: str, server_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1637,7 +1670,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -1661,7 +1694,8 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1698,7 +1732,7 @@ def begin_stop(self, resource_group_name: str, server_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1756,14 +1790,14 @@ def _reset_gtid_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerGtidSetParameter") @@ -1792,7 +1826,8 @@ def _reset_gtid_initial( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1911,7 +1946,7 @@ def begin_reset_gtid( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-30-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_create.py index d86c6891feb9..2f03934a9e1c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorCreate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_delete.py index 8c5aadbe6e2d..38be79418db6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_get.py index c021d7db88cb..397805406246 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrator_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrators_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrators_list_by_server.py index 54bebced8414..762a50004c25 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrators_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/azure_ad_administrators_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2023-06-01-preview/examples/AzureADAdministratorsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_and_export.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_and_export.py index 6147d67ad608..63ebf2c6e132 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_and_export.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_and_export.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupAndExport.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupAndExport.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_get.py index 6c93542ae329..ce5a8f0a3f21 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupGet.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_put.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_put.py index da1d4ea69afc..8dddb91531af 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_put.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backup_put.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupPut.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupPut.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backups_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backups_list_by_server.py index 3496d3d3b5fe..9be6257d2059 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backups_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/backups_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupsListByServer.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/BackupsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capabilities_by_location_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capabilities_by_location_list.py index 13ec4fd038fe..389a8b458481 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capabilities_by_location_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capabilities_by_location_list.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitiesByLocationList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_by_location.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_by_location.py new file mode 100644 index 000000000000..c0392de7daa0 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_by_location.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-rdbms +# USAGE + python capability_set_by_location.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MySQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", + ) + + response = client.location_based_capability_set.get( + location_name="WestUS", + ) + print(response) + + +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitySetByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_list_by_location.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_list_by_location.py new file mode 100644 index 000000000000..67ddebc29c80 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/capability_set_list_by_location.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-rdbms +# USAGE + python capability_set_list_by_location.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MySQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", + ) + + response = client.location_based_capability_set.list( + location_name="WestUS", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CapabilitySetListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_name_availability.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_name_availability.py index 3948152e5cfc..8ffb99c9604a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_name_availability.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_name_availability.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CheckNameAvailability.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_virtual_network_subnet_usage.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_virtual_network_subnet_usage.py index 5b0d759d5e4e..9c28c50e1bf3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_virtual_network_subnet_usage.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/check_virtual_network_subnet_usage.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CheckVirtualNetworkSubnetUsage.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/CheckVirtualNetworkSubnetUsage.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_create_or_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_create_or_update.py index e2e37f5fb370..0c9398384f1e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_create_or_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationCreateOrUpdate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_get.py index 749d9e8ae110..9935db4b9cf9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationGet.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_update.py index d6df7dfeec1f..08955bebea59 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configuration_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationUpdate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_batch_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_batch_update.py index 3dc2bc4de090..736c821c0c2f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_batch_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_batch_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsBatchUpdate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationsBatchUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_list_by_server.py index e6cf1136fc09..8b3706eea3b7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/configurations_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2023-06-01-preview/examples/ConfigurationsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/cutover_migration.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/cutover_migration.py new file mode 100644 index 000000000000..717607e57ec7 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/cutover_migration.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-rdbms +# USAGE + python cutover_migration.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MySQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", + ) + + response = client.servers_migration.begin_cutover_migration( + resource_group_name="testrg", + server_name="mysqltestserver", + ).result() + print(response) + + +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/CutoverMigration.json +if __name__ == "__main__": + main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_create.py index ea8fea781c69..7eb45b08d236 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseCreate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabaseCreate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_delete.py index 4d350ce01998..debbb263c9b0 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseDelete.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_get.py index e719597fbf11..f4e7a738c65a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/database_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabaseGet.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/databases_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/databases_list_by_server.py index b733eb5a73bd..f1790e988b7e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/databases_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/databases_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2021-12-01-preview/examples/DatabasesListByServer.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Databases/preview/2023-06-01-preview/examples/DatabasesListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_create.py index 49a327452aa9..cc3f9feee022 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleCreate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_delete.py index 2286b8baff14..402bbd68e2f3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleDelete.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_get.py index 2ffa0b85c970..f1b8672b4025 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rule_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRuleGet.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rules_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rules_list_by_server.py index 036fd3e409d6..4806dd1ca818 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rules_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/firewall_rules_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2023-06-01-preview/examples/FirewallRulesListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/get_private_dns_zone_suffix.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/get_private_dns_zone_suffix.py index f5c2cfa45f32..63b8da2df747 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/get_private_dns_zone_suffix.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/get_private_dns_zone_suffix.py @@ -33,6 +33,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/GetPrivateDnsZoneSuffix.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/log_files_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/log_files_list_by_server.py index f4435795bd93..ad763754dd4a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/log_files_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/log_files_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2021-12-01-preview/examples/LogFilesListByServer.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/LogFiles/preview/2023-06-01-preview/examples/LogFilesListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operation_results_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operation_results_get.py new file mode 100644 index 000000000000..e5ddb4280673 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operation_results_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.rdbms.mysql_flexibleservers import MySQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-rdbms +# USAGE + python operation_results_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = MySQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="11111111-2222-3333-4444-555555555555", + ) + + response = client.operation_results.get( + location_name="westus", + operation_id="resource-provisioning-id-farmBeatsResourceName", + ) + print(response) + + +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/OperationResults_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operations_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operations_list.py index 40c0e81971a6..209f634cabc3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operations_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2023-06-01-preview/examples/OperationsList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/replicas_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/replicas_list_by_server.py index d75d59b9315e..144020ff2675 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/replicas_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/replicas_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ReplicasListByServer.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ReplicasListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create.py index 395267c508e9..41f5c8d8d731 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerCreate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_replica.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_replica.py index 5ef355538e17..8a2f639c5d16 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_replica.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_replica.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateReplica.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerCreateReplica.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_byok.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_byok.py index 46c5ebf88f78..bccd564b76b8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_byok.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_byok.py @@ -64,6 +64,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithBYOK.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerCreateWithBYOK.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_point_in_time_restore.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_point_in_time_restore.py index f27da32732d3..80812cc77466 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_point_in_time_restore.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_create_with_point_in_time_restore.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerCreateWithPointInTimeRestore.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerCreateWithPointInTimeRestore.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_delete.py index 78c8f6268804..4a77e9974b65 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_delete.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerDelete.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_failover.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_failover.py index 99886c67472e..c01a48223971 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_failover.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_failover.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerFailover.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerFailover.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get.py index af9dbdd503df..be5b4296158c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGet.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get_with_vnet.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get_with_vnet.py index bab81a30fdae..b8227b99e9d8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get_with_vnet.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_get_with_vnet.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerGetWithVnet.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerGetWithVnet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_reset_gtid.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_reset_gtid.py index 750ece198bf4..0efde0ad7172 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_reset_gtid.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_reset_gtid.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerResetGtid.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerResetGtid.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_restart.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_restart.py index 7e4e577eda73..4da6c3db5f7e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_restart.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_restart.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerRestart.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerRestart.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_start.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_start.py index dac56fd7bb33..8843e096e7b7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_start.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_start.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStart.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerStart.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_stop.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_stop.py index 1c04d4102e4f..d1a062fa90ea 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_stop.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_stop.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerStop.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerStop.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update.py index c9a66a1237f7..205df43eda9d 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update.py @@ -34,13 +34,14 @@ def main(): server_name="mysqltestserver", parameters={ "properties": { - "storage": {"autoGrow": "Disabled", "autoIoScaling": "Disabled", "iops": 200, "storageSizeGB": 30} + "network": {"publicNetworkAccess": "Disabled"}, + "storage": {"autoGrow": "Disabled", "autoIoScaling": "Disabled", "iops": 200, "storageSizeGB": 30}, } }, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdate.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_byok.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_byok.py index 8d3114373e11..d93cc765c0b8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_byok.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_byok.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithBYOK.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerUpdateWithBYOK.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_customer_maintenance_window.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_customer_maintenance_window.py index d27504a10957..1a110ca8a5c3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_customer_maintenance_window.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/server_update_with_customer_maintenance_window.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list.py index 9ecca6824c82..3ea1e661d87c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersList.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServersList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list_by_resource_group.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list_by_resource_group.py index e054e22e4d95..598ebb1c76c1 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list_by_resource_group.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/servers_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2023-06-01-preview/examples/ServersListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/validate_backup.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/validate_backup.py index b6976fba5040..39ad71e29e32 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/validate_backup.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/mysql_flexibleservers/validate_backup.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/ValidateBackup.json +# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2023-06-01-preview/examples/ValidateBackup.json if __name__ == "__main__": main()