From a534ef40fccdb1a9c2a4f1a13a8181921a579823 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 17 May 2023 03:59:38 +0000 Subject: [PATCH] CodeGen from PR 23929 in Azure/azure-rest-api-specs Merge b27295de54181ddbe8e0ce7c25c4dc301fbc7383 into 5d2adf9b7fda669b4a2538c65e937ee74fe3f966 --- sdk/rdbms/azure-mgmt-rdbms/_meta.json | 8 +-- .../azure/mgmt/rdbms/postgresql/_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 +- ...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 | 5 +- .../_virtual_network_rules_operations.py | 3 +- .../_check_name_availability_operations.py | 3 +- .../operations/_configurations_operations.py | 3 +- .../operations/_databases_operations.py | 3 +- .../operations/_firewall_rules_operations.py | 3 +- ...private_endpoint_connections_operations.py | 5 +- .../_server_administrators_operations.py | 3 +- .../operations/_server_keys_operations.py | 3 +- .../_server_parameters_operations.py | 3 +- ...rver_security_alert_policies_operations.py | 3 +- .../operations/_servers_operations.py | 5 +- .../_virtual_network_rules_operations.py | 3 +- .../postgresql_flexibleservers/_version.py | 2 +- .../operations/_administrators_operations.py | 3 +- .../_check_name_availability_operations.py | 3 +- ...e_availability_with_location_operations.py | 3 +- .../operations/_configurations_operations.py | 5 +- .../aio/operations/_databases_operations.py | 3 +- .../operations/_firewall_rules_operations.py | 3 +- .../aio/operations/_servers_operations.py | 7 +- ...virtual_network_subnet_usage_operations.py | 3 +- .../models/_models_py3.py | 43 ++++++++---- .../_postgre_sql_management_client_enums.py | 1 - .../operations/_administrators_operations.py | 3 +- .../_check_name_availability_operations.py | 3 +- ...e_availability_with_location_operations.py | 3 +- .../operations/_configurations_operations.py | 5 +- .../operations/_databases_operations.py | 3 +- .../operations/_firewall_rules_operations.py | 3 +- .../operations/_servers_operations.py | 7 +- ...virtual_network_subnet_usage_operations.py | 3 +- ...s_batch_update.py => administrator_add.py} | 23 +++---- ...ver_upgrade.py => administrator_delete.py} | 15 ++--- ...inistrator_get.py => administrator_get.py} | 14 ++-- ...er.py => administrators_list_by_server.py} | 12 ++-- .../advisors_list_by_server.py | 42 ------------ .../azure_ad_administrator_create.py | 51 -------------- .../azure_ad_administrators_list_by_server.py | 42 ------------ .../generated_samples/backup_get.py | 8 +-- ..._by_server.py => backup_list_by_server.py} | 10 +-- .../generated_samples/backup_put.py | 42 ------------ ...rs_list.py => capabilities_by_location.py} | 12 ++-- .../capabilities_by_location_list.py | 41 ------------ .../check_name_availability.py | 8 +-- ...check_name_availability_location_based.py} | 15 ++--- .../configuration_create_or_update.py | 8 +-- .../generated_samples/configuration_get.py | 8 +-- .../configuration_list_by_server.py | 10 +-- .../generated_samples/configuration_update.py | 6 +- .../configurations_list_by_server.py | 42 ------------ .../configurations_update_by_server.py | 14 ++-- .../generated_samples/database_create.py | 8 +-- .../generated_samples/database_delete.py | 9 ++- .../generated_samples/database_get.py | 6 +- .../database_list_by_server.py | 6 +- .../databases_list_by_server.py | 6 +- .../generated_samples/firewall_rule_create.py | 6 +- .../generated_samples/firewall_rule_delete.py | 9 ++- .../generated_samples/firewall_rule_get.py | 6 +- .../firewall_rule_list_by_server.py | 6 +- .../firewall_rules_list_by_server.py | 42 ------------ .../get_private_dns_zone_suffix.py | 8 +-- .../log_file_list_by_server.py | 6 +- .../generated_samples/operation_list.py | 6 +- .../generated_samples/operations_list.py | 39 ----------- .../performance_tiers_list_by_location.py | 6 +- .../performance_tiers_list_by_server.py | 10 +-- .../private_endpoint_connection_delete.py | 9 ++- .../private_endpoint_connection_get.py | 6 +- .../private_endpoint_connection_list.py | 6 +- .../private_endpoint_connection_update.py | 6 +- ...private_endpoint_connection_update_tags.py | 8 +-- .../private_link_resources_get.py | 6 +- .../private_link_resources_list.py | 6 +- .../query_performance_insight_reset_data.py | 41 ------------ .../generated_samples/query_texts_get.py | 42 ------------ .../query_texts_list_by_server.py | 43 ------------ .../recommended_action_session_create.py | 43 ------------ ...mmended_action_session_operation_status.py | 41 ------------ .../recommended_action_session_result.py | 42 ------------ .../recommended_actions_get.py | 43 ------------ .../recommended_actions_list_by_server.py | 43 ------------ .../recoverable_servers_get.py | 8 +-- .../replicas_list_by_server.py | 10 +-- .../server_admin_create_update.py | 8 +-- .../generated_samples/server_admin_delete.py | 11 ++-- .../generated_samples/server_admin_get.py | 8 +-- .../generated_samples/server_admin_list.py | 8 +-- .../generated_samples/server_create.py | 15 +++-- ...estore.py => server_create_geo_restore.py} | 22 +++---- .../server_create_geo_restore_mode.py | 8 +-- .../server_create_point_in_time_restore.py | 10 +-- .../server_create_replica.py | 15 +++-- .../server_create_replica_mode.py | 15 +++-- .../server_create_with_aad_auth_enabled.py | 66 +++++++++++++++++++ ...er_create_with_data_encryption_enabled.py} | 38 ++++++----- .../generated_samples/server_delete.py | 9 ++- .../generated_samples/server_get.py | 8 +-- .../generated_samples/server_get_with_vnet.py | 8 +-- .../server_key_create_or_update.py | 6 +- .../generated_samples/server_key_delete.py | 9 ++- .../generated_samples/server_key_get.py | 6 +- .../generated_samples/server_key_list.py | 6 +- .../generated_samples/server_list.py | 6 +- .../server_list_by_resource_group.py | 8 +-- .../generated_samples/server_reset_gtid.py | 42 ------------ .../generated_samples/server_restart.py | 9 ++- ...ver.py => server_restart_with_failover.py} | 13 ++-- .../server_security_alerts_create_max.py | 6 +- .../server_security_alerts_create_min.py | 6 +- .../server_security_alerts_get.py | 6 +- .../server_security_alerts_list_by_server.py | 6 +- .../generated_samples/server_start.py | 11 ++-- .../generated_samples/server_stop.py | 11 ++-- .../generated_samples/server_update.py | 14 ++-- ...=> server_update_with_aad_auth_enabled.py} | 26 +++++--- ...update_with_customer_maintenance_window.py | 11 ++-- ...er_update_with_data_encryption_enabled.py} | 27 ++++---- ...rver_update_with_major_version_upgrade.py} | 14 ++-- .../servers_list_by_resource_group.py | 41 ------------ .../top_query_statistics_get.py | 42 ------------ .../top_query_statistics_list_by_server.py | 52 --------------- .../generated_samples/validate_backup.py | 41 ------------ .../virtual_network_rules_create_or_update.py | 6 +- .../virtual_network_rules_delete.py | 9 ++- .../virtual_network_rules_get.py | 6 +- .../virtual_network_rules_list.py | 6 +- ...age.py => virtual_network_subnet_usage.py} | 14 ++-- .../generated_samples/wait_statistics_get.py | 42 ------------ .../wait_statistics_list_by_server.py | 49 -------------- 142 files changed, 571 insertions(+), 1424 deletions(-) rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{configurations_batch_update.py => administrator_add.py} (66%) rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{server_upgrade.py => administrator_delete.py} (73%) rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{azure_ad_administrator_get.py => administrator_get.py} (74%) rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{log_files_list_by_server.py => administrators_list_by_server.py} (76%) delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/advisors_list_by_server.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_create.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrators_list_by_server.py rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{backups_list_by_server.py => backup_list_by_server.py} (80%) delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_put.py rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{servers_list.py => capabilities_by_location.py} (75%) delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/capabilities_by_location_list.py rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{advisors_get.py => check_name_availability_location_based.py} (69%) delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_list_by_server.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rules_list_by_server.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/operations_list.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_performance_insight_reset_data.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_get.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_list_by_server.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_create.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_operation_status.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_result.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_get.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_list_by_server.py rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{server_create_with_point_in_time_restore.py => server_create_geo_restore.py} (63%) create mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_aad_auth_enabled.py rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{server_create_with_byok.py => server_create_with_data_encryption_enabled.py} (53%) delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_reset_gtid.py rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{server_failover.py => server_restart_with_failover.py} (76%) rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{backup_and_export.py => server_update_with_aad_auth_enabled.py} (57%) rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{server_update_with_byok.py => server_update_with_data_encryption_enabled.py} (60%) rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{azure_ad_administrator_delete.py => server_update_with_major_version_upgrade.py} (72%) delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/servers_list_by_resource_group.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_get.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_list_by_server.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/validate_backup.py rename sdk/rdbms/azure-mgmt-rdbms/generated_samples/{check_virtual_network_subnet_usage.py => virtual_network_subnet_usage.py} (67%) delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_get.py delete mode 100644 sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_list_by_server.py diff --git a/sdk/rdbms/azure-mgmt-rdbms/_meta.json b/sdk/rdbms/azure-mgmt-rdbms/_meta.json index 57858c5cc15e..a8cd1a9f82e8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/_meta.json +++ b/sdk/rdbms/azure-mgmt-rdbms/_meta.json @@ -1,11 +1,11 @@ { - "commit": "06bf50ba45fe22722dfc6340b58fe45a3a71f7c6", + "commit": "916c2ea4ecf5fcb30d007371ccf8b96f5ec8fb09", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.4.8", + "@autorest/python@6.4.12", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/mysql/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.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", - "readme": "specification/mysql/resource-manager/readme.md" + "autorest_command": "autorest specification/postgresql/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.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "readme": "specification/postgresql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py index 9c09839970a2..e5754a47ce68 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.2.0b8" +VERSION = "1.0.0b1" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_check_name_availability_operations.py index 590aa07915f7..930d697f6c09 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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/postgresql/aio/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_configurations_operations.py index e090fbe7c081..644ecfeb9b61 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -84,7 +85,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/postgresql/aio/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_databases_operations.py index 7bded7fadee6..3137310395d7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -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, "Database") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py index 3acdd835396e..0ba05229bfc8 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -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, "FirewallRule") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py index 3ef9fba9443a..b91403600ed3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -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, "PrivateEndpointConnection") @@ -507,7 +508,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/postgresql/aio/operations/_server_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_administrators_operations.py index 2a94dadbeef3..7b404ea3a887 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -148,7 +149,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/postgresql/aio/operations/_server_keys_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_keys_operations.py index fa25c3b05db0..15f5e8a44359 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_keys_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -228,7 +229,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/postgresql/aio/operations/_server_parameters_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_parameters_operations.py index a46ffd0e60db..bc06fc849adf 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_parameters_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -77,7 +78,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/postgresql/aio/operations/_server_security_alert_policies_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_security_alert_policies_operations.py index 174c7e3256ae..ac59f0a9b29b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_security_alert_policies_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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/postgresql/aio/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_servers_operations.py index 367731a6fae2..21f083f2ecb4 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -83,7 +84,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") @@ -305,7 +306,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") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_virtual_network_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_virtual_network_rules_operations.py index 1a37eebed624..d7a609d46b81 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_virtual_network_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 @@ -152,7 +153,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/postgresql/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_check_name_availability_operations.py index 598bb7598d1a..102aa7f70a76 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -158,7 +159,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/postgresql/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_configurations_operations.py index c69fd57a5164..ed9cb53ccbae 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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/postgresql/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_databases_operations.py index 09b25d05df65..d1a049fd044a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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/postgresql/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_firewall_rules_operations.py index 858ddb03d15c..41360d26d7bf 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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/postgresql/operations/_private_endpoint_connections_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_private_endpoint_connections_operations.py index 76a02a81dceb..66829cabf918 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_private_endpoint_connections_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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") @@ -702,7 +703,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/postgresql/operations/_server_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_administrators_operations.py index 6c99ee844c9c..7770cd96fb24 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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/postgresql/operations/_server_keys_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_keys_operations.py index f5daaeb6e054..28b34583d82d 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_keys_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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/postgresql/operations/_server_parameters_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_parameters_operations.py index 98408fb78bab..29db4c441342 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_parameters_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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/postgresql/operations/_server_security_alert_policies_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_security_alert_policies_operations.py index c65f8706cc74..1d4b5badf40c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_server_security_alert_policies_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -266,7 +267,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/postgresql/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_servers_operations.py index 3a882af2e699..0749b6f7ff8c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -300,7 +301,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") @@ -519,7 +520,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") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_virtual_network_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_virtual_network_rules_operations.py index 8accc417bbd8..5c27c7a5acb3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/_virtual_network_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/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 ( @@ -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/postgresql_flexibleservers/_version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py index 9c09839970a2..e5754a47ce68 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.2.0b8" +VERSION = "1.0.0b1" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_administrators_operations.py index 34ab0bc15a77..451fb1a81512 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_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 import urllib.parse @@ -86,7 +87,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, "ActiveDirectoryAdministratorAdd") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py index 02e9cda951db..1b41abcc7dc9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_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 ( @@ -127,7 +128,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, "CheckNameAvailabilityRequest") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_location_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_location_operations.py index ab6ac1f7142b..f3ec1ab320af 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_location_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_with_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 ( @@ -142,7 +143,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, "CheckNameAvailabilityRequest") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py index 15d9316f1943..3c5983d80460 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -247,7 +248,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, "ConfigurationForUpdate") @@ -497,7 +498,7 @@ async def _put_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/postgresql_flexibleservers/aio/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py index 6edf93a12aee..f884afd924fa 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -86,7 +87,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, "Database") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py index fbda0b67c636..b5ebbd995b48 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -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/postgresql_flexibleservers/aio/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py index 20bc8acce7b1..faaf67c9e97e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -86,7 +87,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, "Server") @@ -315,7 +316,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, "ServerForUpdate") @@ -899,7 +900,7 @@ async def _restart_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: if parameters is not None: diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py index 3dbb69a1ffc2..a2a6acf624d3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_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 ( @@ -132,7 +133,7 @@ async def execute( 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") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py index 2d0cbb9a961e..57657b24931b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py @@ -1335,9 +1335,13 @@ class Network(_serialization.Model): "Enabled" and "Disabled". :vartype public_network_access: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerPublicNetworkAccessState - :ivar delegated_subnet_resource_id: delegated subnet arm resource id. + :ivar delegated_subnet_resource_id: Delegated subnet arm resource id. This is required to be + passed during create, in case we want the server to be VNET injected, i.e. Private access + server. During update, pass this only if we want to update the value for Private DNS zone. :vartype delegated_subnet_resource_id: str - :ivar private_dns_zone_arm_resource_id: private dns zone arm resource id. + :ivar private_dns_zone_arm_resource_id: Private dns zone arm resource id. This is required to + be passed during create, in case we want the server to be VNET injected, i.e. Private access + server. During update, pass this only if we want to update the value for Private DNS zone. :vartype private_dns_zone_arm_resource_id: str """ @@ -1352,12 +1356,20 @@ class Network(_serialization.Model): } def __init__( - self, *, delegated_subnet_resource_id: str = "", private_dns_zone_arm_resource_id: str = "", **kwargs: Any + self, + *, + delegated_subnet_resource_id: Optional[str] = None, + private_dns_zone_arm_resource_id: Optional[str] = None, + **kwargs: Any ) -> None: """ - :keyword delegated_subnet_resource_id: delegated subnet arm resource id. + :keyword delegated_subnet_resource_id: Delegated subnet arm resource id. This is required to be + passed during create, in case we want the server to be VNET injected, i.e. Private access + server. During update, pass this only if we want to update the value for Private DNS zone. :paramtype delegated_subnet_resource_id: str - :keyword private_dns_zone_arm_resource_id: private dns zone arm resource id. + :keyword private_dns_zone_arm_resource_id: Private dns zone arm resource id. This is required + to be passed during create, in case we want the server to be VNET injected, i.e. Private access + server. During update, pass this only if we want to update the value for Private DNS zone. :paramtype private_dns_zone_arm_resource_id: str """ super().__init__(**kwargs) @@ -1651,7 +1663,8 @@ class Server(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype data_encryption: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.DataEncryption :ivar backup: Backup properties of a server. :vartype backup: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Backup - :ivar network: Network properties of a server. + :ivar network: Network properties of a server. This Network property is required to be passed + only in case you want the server to be Private access server. :vartype network: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Network :ivar high_availability: High availability properties of a server. :vartype high_availability: @@ -1769,7 +1782,8 @@ def __init__( # pylint: disable=too-many-locals :paramtype data_encryption: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.DataEncryption :keyword backup: Backup properties of a server. :paramtype backup: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Backup - :keyword network: Network properties of a server. + :keyword network: Network properties of a server. This Network property is required to be + passed only in case you want the server to be Private access server. :paramtype network: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Network :keyword high_availability: High availability properties of a server. :paramtype high_availability: @@ -1945,6 +1959,9 @@ class ServerForUpdate(_serialization.Model): # pylint: disable=too-many-instanc "AsyncReplica", and "GeoAsyncReplica". :vartype replication_role: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ReplicationRole + :ivar network: Network properties of a server. These are required to be passed only in case if + server is a private access server. + :vartype network: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Network """ _attribute_map = { @@ -1961,6 +1978,7 @@ class ServerForUpdate(_serialization.Model): # pylint: disable=too-many-instanc "data_encryption": {"key": "properties.dataEncryption", "type": "DataEncryption"}, "create_mode": {"key": "properties.createMode", "type": "str"}, "replication_role": {"key": "properties.replicationRole", "type": "str"}, + "network": {"key": "properties.network", "type": "Network"}, } def __init__( @@ -1979,6 +1997,7 @@ def __init__( data_encryption: Optional["_models.DataEncryption"] = None, create_mode: Optional[Union[str, "_models.CreateModeForUpdate"]] = None, replication_role: Optional[Union[str, "_models.ReplicationRole"]] = None, + network: Optional["_models.Network"] = None, **kwargs: Any ) -> None: """ @@ -2014,6 +2033,9 @@ def __init__( "AsyncReplica", and "GeoAsyncReplica". :paramtype replication_role: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ReplicationRole + :keyword network: Network properties of a server. These are required to be passed only in case + if server is a private access server. + :paramtype network: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Network """ super().__init__(**kwargs) self.sku = sku @@ -2029,6 +2051,7 @@ def __init__( self.data_encryption = data_encryption self.create_mode = create_mode self.replication_role = replication_role + self.network = network class ServerListResult(_serialization.Model): @@ -2353,8 +2376,7 @@ class UserAssignedIdentity(_serialization.Model): :vartype user_assigned_identities: dict[str, ~azure.mgmt.rdbms.postgresql_flexibleservers.models.UserIdentity] :ivar type: the types of identities associated with this resource; currently restricted to - 'SystemAssigned and UserAssigned'. Required. Known values are: "None", "SystemAssigned", and - "UserAssigned". + 'SystemAssigned and UserAssigned'. Required. Known values are: "None" and "UserAssigned". :vartype type: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.IdentityType """ @@ -2379,8 +2401,7 @@ def __init__( :paramtype user_assigned_identities: dict[str, ~azure.mgmt.rdbms.postgresql_flexibleservers.models.UserIdentity] :keyword type: the types of identities associated with this resource; currently restricted to - 'SystemAssigned and UserAssigned'. Required. Known values are: "None", "SystemAssigned", and - "UserAssigned". + 'SystemAssigned and UserAssigned'. Required. Known values are: "None" and "UserAssigned". :paramtype type: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.IdentityType """ super().__init__(**kwargs) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py index c03e83c00b24..3a186bfb133b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py @@ -97,7 +97,6 @@ class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" USER_ASSIGNED = "UserAssigned" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_administrators_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_administrators_operations.py index 045ddd22e9a5..69612b1c1a3b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_administrators_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_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 import urllib.parse @@ -229,7 +230,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, "ActiveDirectoryAdministratorAdd") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py index de27763f681c..bdf87e5bf71b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 ( @@ -159,7 +160,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, "CheckNameAvailabilityRequest") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_location_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_location_operations.py index 95113177646c..aa91dafe7842 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_location_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_with_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 ( @@ -176,7 +177,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, "CheckNameAvailabilityRequest") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py index 4068f2bc20c5..654cdda4b3a2 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -399,7 +400,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, "ConfigurationForUpdate") @@ -648,7 +649,7 @@ def _put_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/postgresql_flexibleservers/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py index 5380ea47664b..6ee5d9adbbe6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -229,7 +230,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, "Database") diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py index 429a14b3f282..ae7e32344090 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -235,7 +236,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/postgresql_flexibleservers/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py index 2d24e97de453..34bdbf799261 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/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 import urllib.parse @@ -382,7 +383,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, "Server") @@ -607,7 +608,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, "ServerForUpdate") @@ -1187,7 +1188,7 @@ def _restart_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: if parameters is not None: diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py index ac7b61000770..dbdd7d8355cf 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_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 ( @@ -166,7 +167,7 @@ def execute( 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") diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_batch_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_add.py similarity index 66% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_batch_update.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_add.py index 2280e20d73f0..dc4a86af2743 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_batch_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_add.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python configurations_batch_update.py + python administrator_add.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, @@ -24,25 +24,26 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.configurations.begin_batch_update( + response = client.administrators.begin_create( resource_group_name="testrg", - server_name="mysqltestserver", + server_name="testserver", + object_id="oooooooo-oooo-oooo-oooo-oooooooooooo", parameters={ - "resetAllToDefault": "False", - "value": [ - {"name": "event_scheduler", "properties": {"value": "OFF"}}, - {"name": "div_precision_increment", "properties": {"value": "8"}}, - ], + "properties": { + "principalName": "testuser1@microsoft.com", + "principalType": "User", + "tenantId": "tttttttt-tttt-tttt-tttt-tttttttttttt", + } }, ).result() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorAdd.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_upgrade.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_delete.py similarity index 73% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_upgrade.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_delete.py index 13a03f9aa2ef..95b8c103497c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_upgrade.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_delete.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python server_upgrade.py + python administrator_delete.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, @@ -24,19 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.servers.begin_upgrade( - resource_group_name="TestGroup", + client.administrators.begin_delete( + resource_group_name="testrg", server_name="testserver", - parameters={"properties": {"targetServerVersion": "5.7"}}, + object_id="oooooooo-oooo-oooo-oooo-oooooooooooo", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2020-01-01/examples/ServerUpgrade.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_get.py similarity index 74% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_get.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_get.py index bf67d9888156..020ac5a07946 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrator_get.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python azure_ad_administrator_get.py + python administrator_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, @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.azure_ad_administrators.get( + response = client.administrators.get( resource_group_name="testrg", - server_name="mysqltestsvc4", - administrator_name="ActiveDirectory", + server_name="pgtestsvc1", + object_id="oooooooo-oooo-oooo-oooo-oooooooooooo", ) 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/log_files_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrators_list_by_server.py similarity index 76% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/log_files_list_by_server.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrators_list_by_server.py index 9d9c36edc5a2..d5228160ec82 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/log_files_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/administrators_list_by_server.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python log_files_list_by_server.py + python administrators_list_by_server.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, @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.log_files.list_by_server( + response = client.administrators.list_by_server( resource_group_name="testrg", - server_name="mysqltestsvc1", + server_name="pgtestsvc1", ) for item in response: 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/advisors_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/advisors_list_by_server.py deleted file mode 100644 index e98238907185..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/advisors_list_by_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python advisors_list_by_server.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.advisors.list_by_server( - resource_group_name="testResourceGroupName", - server_name="testServerName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/AdvisorsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_create.py deleted file mode 100644 index 8a9d0fe92ea2..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_create.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python azure_ad_administrator_create.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.azure_ad_administrators.begin_create_or_update( - resource_group_name="testrg", - server_name="mysqltestsvc4", - administrator_name="ActiveDirectory", - parameters={ - "properties": { - "administratorType": "ActiveDirectory", - "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi", - "login": "bob@contoso.com", - "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", - "tenantId": "c12b7025-bfe2-46c1-b463-993b5e4cd467", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrators_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrators_list_by_server.py deleted file mode 100644 index 91cba30ca17b..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrators_list_by_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python azure_ad_administrators_list_by_server.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.azure_ad_administrators.list_by_server( - resource_group_name="testrg", - server_name="mysqltestsvc4", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_get.py index 1a59cd0de32b..fa6d2b9d9077 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.backups.get( resource_group_name="TestGroup", - server_name="mysqltestserver", + server_name="postgresqltestserver", backup_name="daily_20210615T160516", ) 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backups_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_list_by_server.py similarity index 80% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/backups_list_by_server.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_list_by_server.py index 711b8bb25565..811b1a07af2e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backups_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_list_by_server.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python backups_list_by_server.py + python backup_list_by_server.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, @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.backups.list_by_server( resource_group_name="TestGroup", - server_name="mysqltestserver", + server_name="postgresqltestserver", ) for item in response: 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_put.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_put.py deleted file mode 100644 index d0024fa44409..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_put.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python backup_put.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.backups.put( - resource_group_name="TestGroup", - server_name="mysqltestserver", - backup_name="mybackup", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/BackupPut.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/servers_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/capabilities_by_location.py similarity index 75% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/servers_list.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/capabilities_by_location.py index 5e38428a0502..aa0621bc75b2 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/servers_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/capabilities_by_location.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python servers_list.py + python capabilities_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, @@ -24,16 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.servers.list() + response = client.location_based_capabilities.execute( + location_name="westus", + ) for item in response: 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CapabilitiesByLocation.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/capabilities_by_location_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/capabilities_by_location_list.py deleted file mode 100644 index d2dc22ef3de7..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/capabilities_by_location_list.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python capabilities_by_location_list.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_capabilities.list( - location_name="WestUS", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/CapabilitiesByLocationList.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_name_availability.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_name_availability.py index 9e3ef6db4767..0921ec893978 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_name_availability.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_name_availability.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,17 +24,17 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.check_name_availability.execute( - name_availability_request={"name": "name1", "type": "Microsoft.DBforMySQL"}, + name_availability_request={"name": "name1", "type": "Microsoft.DBforPostgreSQL"}, ) print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/CheckNameAvailability.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/advisors_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_name_availability_location_based.py similarity index 69% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/advisors_get.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_name_availability_location_based.py index ea56fbccf483..8fba0e2d0460 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/advisors_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_name_availability_location_based.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python advisors_get.py + python check_name_availability_location_based.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, @@ -24,19 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.advisors.get( - resource_group_name="testResourceGroupName", - server_name="testServerName", - advisor_name="Index", + response = client.check_name_availability_with_location.execute( + location_name="westus", + name_availability_request={"name": "name1", "type": "Microsoft.DBforPostgreSQL/flexibleServers"}, ) print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/AdvisorsGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CheckNameAvailabilityLocationBased.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_create_or_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_create_or_update.py index b86df333c888..c99866042768 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_create_or_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_create_or_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -32,12 +32,12 @@ def main(): response = client.configurations.begin_create_or_update( resource_group_name="TestGroup", server_name="testserver", - configuration_name="event_scheduler", + configuration_name="array_nulls", parameters={"properties": {"source": "user-override", "value": "off"}}, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_get.py index e4ce84ed0522..6d88d709bfe5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -32,11 +32,11 @@ def main(): response = client.configurations.get( resource_group_name="TestGroup", server_name="testserver", - configuration_name="event_scheduler", + configuration_name="array_nulls", ) print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ConfigurationGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_list_by_server.py index 2cc9881e755b..bd8dcabf2dd2 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.configurations.list_by_server( - resource_group_name="testrg", - server_name="mysqltestsvc1", + resource_group_name="TestGroup", + server_name="testserver", ) for item in response: print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ConfigurationListByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_update.py index 331b953e30aa..e7b49e468b48 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configuration_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_list_by_server.py deleted file mode 100644 index 8be7ded59d00..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_list_by_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python configurations_list_by_server.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.configurations.list_by_server( - resource_group_name="testrg", - server_name="mysqltestserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Configurations/preview/2021-12-01-preview/examples/ConfigurationsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_update_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_update_by_server.py index f40bafcde0ec..fd68770d08b3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_update_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/configurations_update_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,22 +24,22 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.server_parameters.begin_list_update_configurations( - resource_group_name="testrg", - server_name="mysqltestsvc1", + resource_group_name="TestGroup", + server_name="testserver", value=[ - {"name": "event_scheduler", "properties": {"value": "OFF"}}, - {"name": "div_precision_increment", "properties": {"value": "4"}}, + {"name": "array_nulls", "properties": {"value": "on"}}, + {"name": "backslash_quote", "properties": {"value": "on"}}, ], ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_create.py index c949ecbd8358..770ec8060aed 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_create.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -33,11 +33,11 @@ def main(): resource_group_name="TestGroup", server_name="testserver", database_name="db1", - parameters={"properties": {"charset": "utf8", "collation": "utf8_general_ci"}}, + parameters={"properties": {"charset": "UTF8", "collation": "English_United States.1252"}}, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/DatabaseCreate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseCreate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_delete.py index 2e84b298e34c..e2438058af82 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.databases.begin_delete( + client.databases.begin_delete( resource_group_name="TestGroup", server_name="testserver", database_name="db1", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/DatabaseDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_get.py index 850b564fb5ae..d054c6b475d3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/DatabaseGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_list_by_server.py index a0934ff1492b..454818759b47 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/database_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/DatabaseListByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/databases_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/databases_list_by_server.py index 76f6f69952f7..d0e65052babc 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/databases_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/databases_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabasesListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_create.py index e5ea3c2ba963..74fae897a3b9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_create.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/FirewallRuleCreate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_delete.py index fb1a28ce6b8c..ed9c161134b2 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.firewall_rules.begin_delete( + client.firewall_rules.begin_delete( resource_group_name="TestGroup", server_name="testserver", firewall_rule_name="rule1", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/FirewallRuleDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_get.py index 16ab6af7c1d4..15057f6dda11 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/FirewallRuleGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_list_by_server.py index 3ddd50df2e7e..426b086fb1bd 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rule_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/FirewallRuleListByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rules_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rules_list_by_server.py deleted file mode 100644 index 496fea7c213b..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/firewall_rules_list_by_server.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python firewall_rules_list_by_server.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.firewall_rules.list_by_server( - resource_group_name="TestGroup", - server_name="testserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Firewall/preview/2021-12-01-preview/examples/FirewallRulesListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/get_private_dns_zone_suffix.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/get_private_dns_zone_suffix.py index dd94b67541bd..fffd719f1787 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/get_private_dns_zone_suffix.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/get_private_dns_zone_suffix.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,15 +24,15 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.get_private_dns_zone_suffix.execute() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/GetPrivateDnsZoneSuffix.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/log_file_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/log_file_list_by_server.py index 0245032a27a4..877b0de52027 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/log_file_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/log_file_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/LogFileListByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/LogFileListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/operation_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/operation_list.py index 392b60f745b8..30fd17d192dd 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/operation_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/operation_list.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="SUBSCRIPTION_ID", ) @@ -33,6 +33,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/OperationList.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/OperationList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/operations_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/operations_list.py deleted file mode 100644 index 487f4265edbb..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/operations_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python operations_list.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="SUBSCRIPTION_ID", - ) - - response = client.operations.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/ServiceOperations/preview/2021-12-01-preview/examples/OperationsList.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_location.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_location.py index 6252b506688f..fa9932529812 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_location.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_location.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/PerformanceTiersListByLocation.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_server.py index 4a6ef3fd14a3..d91d761ed47e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/performance_tiers_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.server_based_performance_tier.list( - resource_group_name="testrg", - server_name="mysqltestsvc1", + resource_group_name="TestGroup", + server_name="testserver", ) for item in response: print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/PerformanceTiersListByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_delete.py index 2f5b17d576ef..02a60b770916 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.private_endpoint_connections.begin_delete( + client.private_endpoint_connections.begin_delete( resource_group_name="Default", server_name="test-svr", private_endpoint_connection_name="private-endpoint-connection-name", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_get.py index af0e6f00579a..b3e1a5b3b9a5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_list.py index 528f3a9dddf7..e874a4b180fe 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_list.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/PrivateEndpointConnectionList.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update.py index b76b7549c621..db4d5ea7fe3c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update_tags.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update_tags.py index 31de9b186f8c..25a364ffa1d6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update_tags.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_endpoint_connection_update_tags.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -33,11 +33,11 @@ def main(): resource_group_name="Default", server_name="test-svr", private_endpoint_connection_name="private-endpoint-connection-name", - parameters={"tags": {"key1": "val1", "key2": "val2"}}, + parameters={"tags": {"key1": "val1", "key2": "val2", "key3": "val3"}}, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_get.py index 7d29edee6ce7..4c35923893d4 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/PrivateLinkResourcesGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_list.py index 63b6775951fc..a8703cecc24e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/private_link_resources_list.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/PrivateLinkResourcesList.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_performance_insight_reset_data.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_performance_insight_reset_data.py deleted file mode 100644 index c70be33dba67..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_performance_insight_reset_data.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python query_performance_insight_reset_data.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.reset_query_performance_insight_data( - resource_group_name="testResourceGroupName", - server_name="testServerName", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/QueryPerformanceInsightResetData.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_get.py deleted file mode 100644 index 3c394f79f7ac..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python query_texts_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="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.query_texts.get( - resource_group_name="testResourceGroupName", - server_name="testServerName", - query_id="1", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/QueryTextsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_list_by_server.py deleted file mode 100644 index 06e8320410d4..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/query_texts_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python query_texts_list_by_server.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.query_texts.list_by_server( - resource_group_name="testResourceGroupName", - server_name="testServerName", - query_ids=["1", "2"], - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/QueryTextsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_create.py deleted file mode 100644 index 001d3f500a77..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_create.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python recommended_action_session_create.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.begin_create_recommended_action_session( - resource_group_name="testResourceGroupName", - server_name="testServerName", - advisor_name="Index", - database_name="someDatabaseName", - ).result() - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/RecommendedActionSessionCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_operation_status.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_operation_status.py deleted file mode 100644 index 08330cc8ec8a..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_operation_status.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python recommended_action_session_operation_status.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_recommended_action_sessions_operation_status.get( - location_name="WestUS", - operation_id="aaaabbbb-cccc-dddd-0000-111122223333", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_result.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_result.py deleted file mode 100644 index b3a07ad5927e..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_action_session_result.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python recommended_action_session_result.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_recommended_action_sessions_result.list( - location_name="WestUS", - operation_id="aaaabbbb-cccc-dddd-0000-111122223333", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/RecommendedActionSessionResult.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_get.py deleted file mode 100644 index 33ff5b0cb357..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python recommended_actions_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="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.recommended_actions.get( - resource_group_name="testResourceGroupName", - server_name="testServerName", - advisor_name="Index", - recommended_action_name="Index-1", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/RecommendedActionsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_list_by_server.py deleted file mode 100644 index 27c3877460bd..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recommended_actions_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python recommended_actions_list_by_server.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.recommended_actions.list_by_server( - resource_group_name="testResourceGroupName", - server_name="testServerName", - advisor_name="Index", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/RecommendedActionsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recoverable_servers_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recoverable_servers_get.py index a40c7296d53c..42276e352d24 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recoverable_servers_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/recoverable_servers_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.recoverable_servers.get( resource_group_name="testrg", - server_name="testsvc4", + server_name="pgtestsvc4", ) print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/RecoverableServersGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/RecoverableServersGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/replicas_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/replicas_list_by_server.py index 212f2b96fd15..d6b340648809 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/replicas_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/replicas_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.replicas.list_by_server( - resource_group_name="TestGroup", - server_name="testmaster", + resource_group_name="TestGroup_WestCentralUS", + server_name="testserver-master", ) for item in response: print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ReplicasListByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ReplicasListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_create_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_create_update.py index b4b59922e3da..1cd20f1bc552 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_create_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_create_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,14 +24,14 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.server_administrators.begin_create_or_update( resource_group_name="testrg", - server_name="mysqltestsvc4", + server_name="pgtestsvc4", properties={ "properties": { "administratorType": "ActiveDirectory", @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerAdminCreateUpdate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_delete.py index d050ed55c57c..c524e1571703 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,17 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.server_administrators.begin_delete( + client.server_administrators.begin_delete( resource_group_name="testrg", - server_name="mysqltestsvc4", + server_name="pgtestsvc4", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerAdminDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_get.py index 334c740d3cab..86f8c77de383 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.server_administrators.get( resource_group_name="testrg", - server_name="mysqltestsvc4", + server_name="pgtestsvc4", ) print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerAdminGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_list.py index 84e5438a3ee9..23e93a15ff9b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_admin_list.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.server_administrators.list( resource_group_name="testrg", - server_name="mysqltestsvc4", + server_name="pgtestsvc4", ) for item in response: print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerAdminList.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create.py index 828b69ffa687..e0bdc86b98f7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,30 +24,31 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_create( - resource_group_name="testrg", - server_name="mysqltestsvc4", + resource_group_name="TestGroup", + server_name="pgtestsvc4", parameters={ "location": "westus", "properties": { "administratorLogin": "cloudsa", "administratorLoginPassword": "", "createMode": "Default", + "minimalTlsVersion": "TLS1_2", "sslEnforcement": "Enabled", - "storageProfile": {"backupRetentionDays": 7, "geoRedundantBackup": "Enabled", "storageMB": 128000}, + "storageProfile": {"backupRetentionDays": 7, "geoRedundantBackup": "Disabled", "storageMB": 128000}, }, - "sku": {"capacity": 2, "family": "Gen5", "name": "GP_Gen5_2", "tier": "GeneralPurpose"}, + "sku": {"capacity": 2, "family": "Gen5", "name": "B_Gen5_2", "tier": "Basic"}, "tags": {"ElasticServer": "1"}, }, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerCreate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_point_in_time_restore.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_geo_restore.py similarity index 63% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_point_in_time_restore.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_geo_restore.py index 46bd1dc60aa7..9dabcfe2d962 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_point_in_time_restore.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_geo_restore.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python server_create_with_point_in_time_restore.py + python server_create_geo_restore.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, @@ -24,28 +24,26 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_create( - resource_group_name="TargetResourceGroup", - server_name="targetserver", + resource_group_name="testrg", + server_name="pgtestsvc5geo", parameters={ - "location": "SoutheastAsia", + "location": "eastus", "properties": { - "createMode": "PointInTimeRestore", - "restorePointInTime": "2021-06-24T00:00:37.467Z", - "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver", + "createMode": "GeoRestore", + "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00", + "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername", }, - "sku": {"name": "Standard_D14_v2", "tier": "GeneralPurpose"}, - "tags": {"num": "1"}, }, ).result() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateGeoRestore.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_geo_restore_mode.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_geo_restore_mode.py index e910b741df5f..0df1bd90a35e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_geo_restore_mode.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_geo_restore_mode.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -36,7 +36,7 @@ def main(): "location": "westus", "properties": { "createMode": "GeoRestore", - "sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver", + "sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver", }, "sku": {"capacity": 2, "family": "Gen5", "name": "GP_Gen5_2", "tier": "GeneralPurpose"}, "tags": {"ElasticServer": "1"}, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerCreateGeoRestoreMode.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateGeoRestoreMode.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_point_in_time_restore.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_point_in_time_restore.py index f339f4c941e4..69a0a1528e5e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_point_in_time_restore.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_point_in_time_restore.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,15 +37,15 @@ def main(): "properties": { "createMode": "PointInTimeRestore", "restorePointInTime": "2017-12-14T00:00:37.467Z", - "sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver", + "sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver", }, - "sku": {"capacity": 2, "family": "Gen5", "name": "GP_Gen5_2", "tier": "GeneralPurpose"}, + "sku": {"capacity": 2, "family": "Gen5", "name": "B_Gen5_2", "tier": "Basic"}, "tags": {"ElasticServer": "1"}, }, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica.py index b07d126d3a4b..f6c8bdc85d0c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,25 +24,26 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_create( - resource_group_name="testgr", - server_name="replica-server", + resource_group_name="testrg", + server_name="pgtestsvc5rep", parameters={ - "location": "SoutheastAsia", + "location": "westus", "properties": { "createMode": "Replica", - "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server", + "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00", + "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername", }, }, ).result() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateReplica.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica_mode.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica_mode.py index 6eb52442b895..1cf8d6f03057 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica_mode.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_replica_mode.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,25 +24,26 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_create( - resource_group_name="TargetResourceGroup", - server_name="targetserver", + resource_group_name="TestGroup_WestCentralUS", + server_name="testserver-replica1", parameters={ - "location": "westus", + "location": "westcentralus", "properties": { "createMode": "Replica", - "sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver", + "sourceServerId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master", }, + "sku": {"capacity": 2, "family": "Gen5", "name": "GP_Gen5_2", "tier": "GeneralPurpose"}, }, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerCreateReplicaMode.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreateReplicaMode.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_aad_auth_enabled.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_aad_auth_enabled.py new file mode 100644 index 000000000000..71b63a44e3a9 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_aad_auth_enabled.py @@ -0,0 +1,66 @@ +# 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 import PostgreSQLManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-rdbms +# USAGE + python server_create_with_aad_auth_enabled.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 = PostgreSQLManagementClient( + credential=DefaultAzureCredential(), + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", + ) + + response = client.servers.begin_create( + resource_group_name="testrg", + server_name="pgtestsvc4", + parameters={ + "location": "westus", + "properties": { + "administratorLogin": "cloudsa", + "administratorLoginPassword": "password", + "authConfig": { + "activeDirectoryAuth": "Enabled", + "passwordAuth": "Enabled", + "tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt", + }, + "availabilityZone": "1", + "backup": {"backupRetentionDays": 7, "geoRedundantBackup": "Disabled"}, + "createMode": "Create", + "dataEncryption": {"type": "SystemManaged"}, + "highAvailability": {"mode": "ZoneRedundant"}, + "network": { + "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet", + "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com", + }, + "storage": {"storageSizeGB": 512}, + "version": "12", + }, + "sku": {"name": "Standard_D4s_v3", "tier": "GeneralPurpose"}, + "tags": {"ElasticServer": "1"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithAadAuthEnabled.json +if __name__ == "__main__": + main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_byok.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_data_encryption_enabled.py similarity index 53% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_byok.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_data_encryption_enabled.py index 12a5b451224b..c818b5eb21d7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_byok.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_create_with_data_encryption_enabled.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python server_create_with_byok.py + python server_create_with_data_encryption_enabled.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, @@ -24,46 +24,48 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_create( resource_group_name="testrg", - server_name="mysqltestserver", + server_name="pgtestsvc4", parameters={ "identity": { "type": "UserAssigned", "userAssignedIdentities": { - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {} }, }, - "location": "southeastasia", + "location": "westus", "properties": { "administratorLogin": "cloudsa", - "administratorLoginPassword": "your_password", + "administratorLoginPassword": "password", "availabilityZone": "1", "backup": {"backupRetentionDays": 7, "geoRedundantBackup": "Disabled"}, - "createMode": "Default", + "createMode": "Create", "dataEncryption": { - "geoBackupKeyURI": "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a", - "geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity", - "primaryKeyURI": "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a", - "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity", + "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787", + "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", "type": "AzureKeyVault", }, - "highAvailability": {"mode": "ZoneRedundant", "standbyAvailabilityZone": "3"}, - "storage": {"autoGrow": "Disabled", "iops": 600, "storageSizeGB": 100}, - "version": "5.7", + "highAvailability": {"mode": "ZoneRedundant"}, + "network": { + "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet", + "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com", + }, + "storage": {"storageSizeGB": 512}, + "version": "12", }, - "sku": {"name": "Standard_D2ds_v4", "tier": "GeneralPurpose"}, - "tags": {"num": "1"}, + "sku": {"name": "Standard_D4s_v3", "tier": "GeneralPurpose"}, + "tags": {"ElasticServer": "1"}, }, ).result() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithDataEncryptionEnabled.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_delete.py index 309e4f2f78aa..5900fd6fc4d5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,17 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.servers.begin_delete( + client.servers.begin_delete( resource_group_name="TestGroup", server_name="testserver", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get.py index 95fc8b96cad2..497f58b435fe 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.get( resource_group_name="testrg", - server_name="mysqltestsvc4", + server_name="pgtestsvc1", ) print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get_with_vnet.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get_with_vnet.py index 1d7224a64a6b..e4d905e4b8c7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get_with_vnet.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_get_with_vnet.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.get( resource_group_name="testrg", - server_name="mysqltestserver", + server_name="pgtestsvc4", ) 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerGetWithVnet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_create_or_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_create_or_update.py index 67677f32a360..ddc69f814bea 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_create_or_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_create_or_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2020-01-01/examples/ServerKeyCreateOrUpdate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_delete.py index 2cae28a8bd79..b8e4ee25d5b1 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.server_keys.begin_delete( + client.server_keys.begin_delete( server_name="testserver", key_name="someVault_someKey_01234567890123456789012345678901", resource_group_name="testrg", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2020-01-01/examples/ServerKeyDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_get.py index 7f7486e3f867..380f35e37603 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2020-01-01/examples/ServerKeyGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_list.py index e3a56d6dc2b1..284bc739a551 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_key_list.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2020-01-01/examples/ServerKeyList.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list.py index 23f279e1e85a..c720e67e1c27 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerList.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list_by_resource_group.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list_by_resource_group.py index 60a8dd79a4a0..f3bb05884d32 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list_by_resource_group.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_list_by_resource_group.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.list_by_resource_group( - resource_group_name="testrg", + resource_group_name="TestGroup", ) for item in response: print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerListByResourceGroup.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_reset_gtid.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_reset_gtid.py deleted file mode 100644 index 03f75fc423b3..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_reset_gtid.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python server_reset_gtid.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.begin_reset_gtid( - resource_group_name="TestGroup", - server_name="testserver", - parameters={"gtidSet": "4aff5b51-97ba-11ed-a955-002248036acc:1-16"}, - ).result() - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerResetGtid.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_restart.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_restart.py index 7ffad75f5298..448dc35138bf 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_restart.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_restart.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,17 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.servers.begin_restart( + client.servers.begin_restart( resource_group_name="TestGroup", server_name="testserver", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerRestart.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerRestart.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_failover.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_restart_with_failover.py similarity index 76% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_failover.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_restart_with_failover.py index 01b1724d0a6e..441f25561dd9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_failover.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_restart_with_failover.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python server_failover.py + python server_restart_with_failover.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, @@ -24,18 +24,17 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.servers.begin_failover( - resource_group_name="TestGroup", + client.servers.begin_restart( + resource_group_name="testrg", server_name="testserver", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServerFailover.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerRestartWithFailover.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_max.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_max.py index 30993b34e3ed..027f44abad10 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_max.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_max.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerSecurityAlertsCreateMax.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_min.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_min.py index 7079ac24ccb6..de88d9d359b2 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_min.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_create_min.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerSecurityAlertsCreateMin.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_get.py index c1d4de2acc68..e4d55c3cc0fe 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerSecurityAlertsGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_list_by_server.py index e84a042d25f3..b27d9d3217d0 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_list_by_server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_security_alerts_list_by_server.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="00000000-1111-2222-3333-444444444444", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerSecurityAlertsListByServer.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_start.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_start.py index b51d4d6be4e1..a53be2baf898 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_start.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_start.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,17 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.servers.begin_start( - resource_group_name="TestGroup", + client.servers.begin_start( + resource_group_name="testrg", server_name="testserver", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2020-01-01/examples/ServerStart.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStart.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_stop.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_stop.py index 17a5b5b51893..530b840178f4 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_stop.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_stop.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,18 +24,17 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.servers.begin_stop( - resource_group_name="TestGroup", + client.servers.begin_stop( + resource_group_name="testrg", server_name="testserver", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2020-01-01/examples/ServerStop.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStop.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update.py index 0483d72e7836..e2b1ae13a6e2 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,21 +24,25 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_update( resource_group_name="testrg", - server_name="mysqltestsvc4", + server_name="pgtestsvc4", parameters={ - "properties": {"administratorLoginPassword": "", "sslEnforcement": "Disabled"} + "properties": { + "administratorLoginPassword": "", + "minimalTlsVersion": "TLS1_2", + "sslEnforcement": "Enabled", + } }, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/ServerUpdate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_and_export.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_aad_auth_enabled.py similarity index 57% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_and_export.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_aad_auth_enabled.py index edffe5c94e53..b15ad4fb89da 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/backup_and_export.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_aad_auth_enabled.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python backup_and_export.py + python server_update_with_aad_auth_enabled.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, @@ -24,22 +24,32 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.backup_and_export.begin_create( + response = client.servers.begin_update( resource_group_name="TestGroup", - server_name="mysqltestserver", + server_name="pgtestsvc4", parameters={ - "backupSettings": {"backupName": "customer-backup-name"}, - "targetDetails": {"objectType": "FullBackupStoreDetails", "sasUriList": ["sasuri1", "sasuri2"]}, + "properties": { + "administratorLoginPassword": "newpassword", + "authConfig": { + "activeDirectoryAuth": "Enabled", + "passwordAuth": "Enabled", + "tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt", + }, + "backup": {"backupRetentionDays": 20}, + "createMode": "Update", + "storage": {"storageSizeGB": 1024}, + }, + "sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"}, }, ).result() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithAadAuthEnabled.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_customer_maintenance_window.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_customer_maintenance_window.py index 9450e971122d..428b621b5fce 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_customer_maintenance_window.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_customer_maintenance_window.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,23 +24,24 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_update( resource_group_name="testrg", - server_name="mysqltestserver", + server_name="pgtestsvc4", parameters={ "properties": { - "maintenanceWindow": {"customWindow": "Enabled", "dayOfWeek": 1, "startHour": 8, "startMinute": 0} + "createMode": "Update", + "maintenanceWindow": {"customWindow": "Enabled", "dayOfWeek": 0, "startHour": 8, "startMinute": 0}, } }, ).result() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithCustomerMaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_byok.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_data_encryption_enabled.py similarity index 60% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_byok.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_data_encryption_enabled.py index 714d736f1181..7f6b63cfb74b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_byok.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_data_encryption_enabled.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python server_update_with_byok.py + python server_update_with_data_encryption_enabled.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, @@ -24,35 +24,38 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.servers.begin_update( - resource_group_name="testrg", - server_name="mysqltestserver", + resource_group_name="TestGroup", + server_name="pgtestsvc4", parameters={ "identity": { "type": "UserAssigned", "userAssignedIdentities": { - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity": {} + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {} }, }, "properties": { + "administratorLoginPassword": "newpassword", + "backup": {"backupRetentionDays": 20}, + "createMode": "Update", "dataEncryption": { - "geoBackupKeyURI": "https://test-geo.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a", - "geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-identity", - "primaryKeyURI": "https://test.vault.azure.net/keys/key/c8a92236622244c0a4fdb892666f671a", - "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-identity", + "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787", + "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", "type": "AzureKeyVault", - } + }, + "storage": {"storageSizeGB": 1024}, }, + "sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"}, }, ).result() 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithDataEncryptionEnabled.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_major_version_upgrade.py similarity index 72% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_delete.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_major_version_upgrade.py index 121b4015abe0..ed6238e83a44 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/azure_ad_administrator_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/server_update_with_major_version_upgrade.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python azure_ad_administrator_delete.py + python server_update_with_major_version_upgrade.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, @@ -24,19 +24,19 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.azure_ad_administrators.begin_delete( + response = client.servers.begin_update( resource_group_name="testrg", - server_name="mysqltestsvc4", - administrator_name="ActiveDirectory", + server_name="pgtestsvc4", + parameters={"properties": {"createMode": "Update", "version": "14"}}, ).result() print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/AAD/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithMajorVersionUpgrade.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/servers_list_by_resource_group.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/servers_list_by_resource_group.py deleted file mode 100644 index 2c0ea1869acd..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/servers_list_by_resource_group.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python servers_list_by_resource_group.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.list_by_resource_group( - resource_group_name="TestGroup", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/preview/2022-09-30-preview/examples/ServersListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_get.py deleted file mode 100644 index dd292150b4e9..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python top_query_statistics_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="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.top_query_statistics.get( - resource_group_name="testResourceGroupName", - server_name="testServerName", - query_statistic_id="66-636923268000000000-636923277000000000-avg-duration", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/TopQueryStatisticsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_list_by_server.py deleted file mode 100644 index fd05f88012fc..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/top_query_statistics_list_by_server.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python top_query_statistics_list_by_server.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.top_query_statistics.list_by_server( - resource_group_name="testResourceGroupName", - server_name="testServerName", - parameters={ - "properties": { - "aggregationFunction": "avg", - "aggregationWindow": "PT15M", - "numberOfTopQueries": 5, - "observationEndTime": "2019-05-07T20:00:00.000Z", - "observationStartTime": "2019-05-01T20:00:00.000Z", - "observedMetric": "duration", - } - }, - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/TopQueryStatisticsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/validate_backup.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/validate_backup.py deleted file mode 100644 index 88f07ed34a9d..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/validate_backup.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python validate_backup.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.backup_and_export.validate_backup( - resource_group_name="TestGroup", - server_name="mysqltestserver", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/Backups/preview/2022-09-30-preview/examples/ValidateBackup.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_create_or_update.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_create_or_update.py index 353def888dbe..99c3f4581e7c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_create_or_update.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_create_or_update.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/VirtualNetworkRulesCreateOrUpdate.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_delete.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_delete.py index 073417235d47..9993c565dd61 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_delete.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_delete.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,19 +24,18 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.virtual_network_rules.begin_delete( + client.virtual_network_rules.begin_delete( resource_group_name="TestGroup", server_name="vnet-test-svr", virtual_network_rule_name="vnet-firewall-rule", ).result() - print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/VirtualNetworkRulesDelete.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesDelete.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_get.py index 909c69b55d15..aa0c97dd1d3b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_get.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_get.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/VirtualNetworkRulesGet.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesGet.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_list.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_list.py index 5f9056166604..6f15fd3465af 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_list.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_rules_list.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES @@ -24,7 +24,7 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2017-12-01/examples/VirtualNetworkRulesList.json +# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesList.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_virtual_network_subnet_usage.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_subnet_usage.py similarity index 67% rename from sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_virtual_network_subnet_usage.py rename to sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_subnet_usage.py index cf9a19680364..396df2c4d1a1 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/check_virtual_network_subnet_usage.py +++ b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/virtual_network_subnet_usage.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.rdbms import MySQLManagementClient +from azure.mgmt.rdbms import PostgreSQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE - python check_virtual_network_subnet_usage.py + python virtual_network_subnet_usage.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, @@ -24,20 +24,20 @@ def main(): - client = MySQLManagementClient( + client = PostgreSQLManagementClient( credential=DefaultAzureCredential(), subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) - response = client.check_virtual_network_subnet_usage.execute( - location_name="WestUS", + response = client.virtual_network_subnet_usage.execute( + location_name="westus", parameters={ - "virtualNetworkResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet" + "virtualNetworkArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet" }, ) 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/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/VirtualNetworkSubnetUsage.json if __name__ == "__main__": main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_get.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_get.py deleted file mode 100644 index 22de0e73e781..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python wait_statistics_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="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.wait_statistics.get( - resource_group_name="testResourceGroupName", - server_name="testServerName", - wait_statistics_id="636927606000000000-636927615000000000-send-wait/io/socket/sql/client_connection-2--0", - ) - print(response) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/WaitStatisticsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_list_by_server.py b/sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_list_by_server.py deleted file mode 100644 index 3b36c20e2ef8..000000000000 --- a/sdk/rdbms/azure-mgmt-rdbms/generated_samples/wait_statistics_list_by_server.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 import MySQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-rdbms -# USAGE - python wait_statistics_list_by_server.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.wait_statistics.list_by_server( - resource_group_name="testResourceGroupName", - server_name="testServerName", - parameters={ - "properties": { - "aggregationWindow": "PT15M", - "observationEndTime": "2019-05-07T20:00:00.000Z", - "observationStartTime": "2019-05-01T20:00:00.000Z", - } - }, - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/stable/2018-06-01/examples/WaitStatisticsListByServer.json -if __name__ == "__main__": - main()