3535 generate_password , parse_maintenance_window , get_current_time , build_identity_and_data_encryption , \
3636 _is_resource_name , get_tenant_id , get_case_insensitive_key_value , get_enum_value_true_false , \
3737 get_postgres_tiers , get_postgres_skus
38- from ._flexible_server_location_capabilities_util import get_postgres_location_capability_info
38+ from ._flexible_server_location_capabilities_util import get_postgres_location_capability_info , get_postgres_server_capability_info
3939from ._util import get_autonomous_tuning_settings_map
4040from .flexible_server_custom_common import create_firewall_rule
4141from .flexible_server_virtual_network import prepare_private_network , prepare_private_dns_zone , prepare_public_network
@@ -479,8 +479,8 @@ def flexible_server_update_custom_func(cmd, client, instance,
479479 if zonal_resiliency .lower () == 'disabled' :
480480 high_availability = 'Disabled'
481481 else :
482- list_location_capability_info = get_postgres_location_capability_info (cmd , location )
483- single_az = list_location_capability_info ['single_az' ]
482+ list_capability_info = get_postgres_server_capability_info (cmd , resource_group_name , server_name )
483+ single_az = list_capability_info ['single_az' ]
484484 high_availability = 'SameZone' if single_az and allow_same_zone else 'ZoneRedundant'
485485 if high_availability :
486486 high_availability_param .mode = high_availability
@@ -1057,7 +1057,7 @@ def flexible_server_identity_remove(cmd, client, resource_group_name, server_nam
10571057 for identity in identities :
10581058 identities_map [identity ] = None
10591059
1060- system_assigned_identity = instance .identity and 'principalId' in instance .identity .additional_properties and instance . identity . additional_properties [ 'principalId' ] is not None
1060+ system_assigned_identity = instance .identity and instance .identity .principal_id is not None
10611061
10621062 # if there are no user-assigned identities or all user-assigned identities are already removed
10631063 if not (instance .identity and instance .identity .user_assigned_identities ) or \
@@ -1134,9 +1134,11 @@ def flexible_server_microsoft_entra_admin_set(cmd, client, resource_group_name,
11341134# Create Microsoft Entra admin
11351135def _create_admin (client , resource_group_name , server_name , principal_name , sid , principal_type = None , no_wait = False ):
11361136 parameters = {
1137- 'principal_name' : principal_name ,
1138- 'tenant_id' : get_tenant_id (),
1139- 'principal_type' : principal_type
1137+ 'properties' : {
1138+ 'principalName' : principal_name ,
1139+ 'tenantId' : get_tenant_id (),
1140+ 'principalType' : principal_type
1141+ }
11401142 }
11411143
11421144 return sdk_no_wait (no_wait , client .begin_create_or_update , resource_group_name , server_name , sid , parameters )
@@ -1418,9 +1420,10 @@ def virtual_endpoint_create_func(cmd, client, resource_group_name, server_name,
14181420 validate_virtual_endpoint_name_availability (cmd , virtual_endpoint_name )
14191421
14201422 parameters = {
1421- 'name' : virtual_endpoint_name ,
1422- 'endpoint_type' : endpoint_type ,
1423- 'members' : [members ]
1423+ 'properties' : {
1424+ 'endpointType' : endpoint_type ,
1425+ 'members' : [members ]
1426+ }
14241427 }
14251428
14261429 return client .begin_create (
@@ -1469,9 +1472,10 @@ def virtual_endpoint_update_func(cmd, client, resource_group_name, server_name,
14691472 validate_citus_cluster (cmd , resource_group_name , server_name )
14701473
14711474 parameters = {
1472- 'name' : virtual_endpoint_name ,
1473- 'endpoint_type' : endpoint_type ,
1474- 'members' : [members ]
1475+ 'properties' : {
1476+ 'endpointType' : endpoint_type ,
1477+ 'members' : [members ]
1478+ }
14751479 }
14761480
14771481 return client .begin_update (
@@ -1497,19 +1501,19 @@ def ltr_precheck_func(client, resource_group_name, server_name, backup_name):
14971501 return client .check_prerequisites (
14981502 resource_group_name = resource_group_name ,
14991503 server_name = server_name ,
1500- parameters = {"backup_settings " : {"backup_name " : backup_name }}
1504+ parameters = {"backupSettings " : {"backupName " : backup_name }}
15011505 )
15021506
15031507
15041508def ltr_start_func (client , resource_group_name , server_name , backup_name , sas_url ):
15051509 validate_resource_group (resource_group_name )
15061510
15071511 parameters = {
1508- "backup_settings " : {
1509- "backup_name " : backup_name
1512+ "backupSettings " : {
1513+ "backupName " : backup_name
15101514 },
1511- "target_details " : {
1512- "sas_uri_list " : [sas_url ]
1515+ "targetDetails " : {
1516+ "sasUriList " : [sas_url ]
15131517 }
15141518 }
15151519
@@ -1658,12 +1662,8 @@ def index_tuning_update(cmd, client, resource_group_name, server_name, index_tun
16581662 source = "user-override"
16591663
16601664 if index_tuning_enabled == "True" :
1661- subscription = get_subscription_id (cmd .cli_ctx )
1662- postgres_source_client = get_postgresql_flexible_management_client (cmd .cli_ctx , subscription )
1663- source_server_object = postgres_source_client .servers .get (resource_group_name , server_name )
1664- location = '' .join (source_server_object .location .lower ().split ())
1665- list_location_capability_info = get_postgres_location_capability_info (cmd , location , is_offer_restriction_check_required = True )
1666- autonomous_tuning_supported = list_location_capability_info ['autonomous_tuning_supported' ]
1665+ list_capability_info = get_postgres_server_capability_info (cmd , resource_group_name , server_name , is_offer_restriction_check_required = True )
1666+ autonomous_tuning_supported = list_capability_info ['autonomous_tuning_supported' ]
16671667 if not autonomous_tuning_supported :
16681668 raise CLIError ("Index tuning is not supported for the server." )
16691669
@@ -1835,6 +1835,12 @@ def autonomous_tuning_table_recommendations_list(cmd, resource_group_name, serve
18351835 )
18361836
18371837
1838+ def flexible_server_migrate_network (client , resource_group_name , server_name , no_wait = False ):
1839+ validate_resource_group (resource_group_name )
1840+
1841+ return sdk_no_wait (no_wait , client .begin_migrate_network_mode , resource_group_name , server_name )
1842+
1843+
18381844def _update_private_endpoint_connection_status (cmd , client , resource_group_name , server_name ,
18391845 private_endpoint_connection_name , is_approved = True , description = None ): # pylint: disable=unused-argument
18401846 validate_resource_group (resource_group_name )
0 commit comments