@@ -491,39 +491,41 @@ def flexible_server_import_create(cmd, client,
491
491
create_mode = 'Create'
492
492
if data_source_type .lower () == 'mysql_single' :
493
493
if mode .lower () == 'offline' :
494
- # Generating source_server_id from data_source depending on whether it is a server_name or resource_id
495
- if not is_valid_resource_id (data_source ):
496
- if len (data_source .split ('/' )) == 1 :
497
- source_server_id = resource_id (
498
- subscription = get_subscription_id (cmd .cli_ctx ),
499
- resource_group = resource_group_name ,
500
- namespace = provider ,
501
- type = 'servers' ,
502
- name = data_source )
503
- else :
504
- raise ValidationError ('The provided data-source {} is invalid.' .format (data_source ))
505
- else :
506
- source_server_id = data_source
507
-
508
- single_server_client = cf_mysql_servers (cli_ctx = cmd .cli_ctx , _ = None )
509
494
create_mode = 'Migrate'
510
- # Mapping the single server configuration to flexible server configuration
511
- (tier , sku_name , location , storage_gb , auto_grow , backup_retention ,
512
- geo_redundant_backup , version , tags , public_access , administrator_login ) = map_single_server_configuration (single_server_client = single_server_client ,
513
- source_server_id = source_server_id ,
514
- tier = tier ,
515
- sku_name = sku_name ,
516
- location = location ,
517
- storage_gb = storage_gb ,
518
- auto_grow = auto_grow ,
519
- backup_retention = backup_retention ,
520
- geo_redundant_backup = geo_redundant_backup ,
521
- version = version ,
522
- tags = tags ,
523
- public_access = public_access ,
524
- subnet = subnet ,
525
- administrator_login = administrator_login ,
526
- administrator_login_password = administrator_login_password )
495
+ elif mode .lower () == 'online' :
496
+ create_mode = 'OnlineMigrate'
497
+ # Generating source_server_id from data_source depending on whether it is a server_name or resource_id
498
+ if not is_valid_resource_id (data_source ):
499
+ if len (data_source .split ('/' )) == 1 :
500
+ source_server_id = resource_id (
501
+ subscription = get_subscription_id (cmd .cli_ctx ),
502
+ resource_group = resource_group_name ,
503
+ namespace = provider ,
504
+ type = 'servers' ,
505
+ name = data_source )
506
+ else :
507
+ raise ValidationError ('The provided data-source {} is invalid.' .format (data_source ))
508
+ else :
509
+ source_server_id = data_source
510
+
511
+ single_server_client = cf_mysql_servers (cli_ctx = cmd .cli_ctx , _ = None )
512
+ # Mapping the single server configuration to flexible server configuration
513
+ (tier , sku_name , location , storage_gb , auto_grow , backup_retention ,
514
+ geo_redundant_backup , version , tags , public_access , administrator_login ) = map_single_server_configuration (single_server_client = single_server_client ,
515
+ source_server_id = source_server_id ,
516
+ tier = tier ,
517
+ sku_name = sku_name ,
518
+ location = location ,
519
+ storage_gb = storage_gb ,
520
+ auto_grow = auto_grow ,
521
+ backup_retention = backup_retention ,
522
+ geo_redundant_backup = geo_redundant_backup ,
523
+ version = version ,
524
+ tags = tags ,
525
+ public_access = public_access ,
526
+ subnet = subnet ,
527
+ administrator_login = administrator_login ,
528
+ administrator_login_password = administrator_login_password )
527
529
elif data_source_type .lower () == 'azure_blob' :
528
530
(tier , sku_name , storage_gb , auto_grow , backup_retention ,
529
531
geo_redundant_backup , version , administrator_login ) = get_default_flex_configuration (tier = tier ,
0 commit comments