@@ -170,50 +170,72 @@ class CreateTransfer(show.ShowOne):
170170 """Create a new transfer"""
171171 def get_parser (self , prog_name ):
172172 parser = super (CreateTransfer , self ).get_parser (prog_name )
173- parser .add_argument ('--origin-endpoint' , required = True ,
174- help = 'The origin endpoint id' )
175- parser .add_argument ('--destination-endpoint' , required = True ,
176- help = 'The destination endpoint id' )
177- parser .add_argument ('--instance' , action = 'append' , required = True ,
178- dest = "instances" , metavar = "INSTANCE_IDENTIFIER" ,
179- help = 'The identifier of a source instance to be '
180- 'transferred. Can be specified multiple '
181- 'times' )
182- parser .add_argument ('--scenario' ,
183- dest = "scenario" , metavar = "SCENARIO" ,
184- choices = [
185- TRANSFER_SCENARIO_REPLICA ,
186- TRANSFER_SCENARIO_LIVE_MIGRATION ],
187- default = TRANSFER_SCENARIO_REPLICA ,
188- help = 'The type of scenario to use when creating '
189- 'the Transfer. "replica" will create a '
190- 'monthly-billed Replica which can be '
191- 'executed and deployed as many times as '
192- 'desired, while "live_migration" will '
193- 'create a Transfer which can be synced '
194- 'as many times as needed but only '
195- 'deployed once.' )
196- parser .add_argument ('--notes' , dest = 'notes' ,
197- help = 'Notes about the transfer' )
198- parser .add_argument ('--user-script-global' , action = 'append' ,
199- required = False ,
200- dest = "global_scripts" ,
201- type = cli_utils .comma_separated_kv_to_dict ,
202- help = 'A script that will run for a particular '
203- 'os_type. This option can be used multiple '
204- 'times. Use: linux=/path/to/script.sh or '
205- 'windows=/path/to/script.ps1' )
206- parser .add_argument ('--user-script-instance' , action = 'append' ,
207- required = False ,
208- dest = "instance_scripts" ,
209- type = cli_utils .comma_separated_kv_to_dict ,
210- help = 'A script that will run for a particular '
211- 'instance specified by the --instance option. '
212- 'This option can be used multiple times. '
213- 'Use: "instance_name"=/path/to/script.sh.'
214- ' This option overwrites any OS specific script '
215- 'specified in --user-script-global for this '
216- 'instance' )
173+ parser .add_argument (
174+ '--origin-endpoint' ,
175+ required = True ,
176+ help = 'The origin endpoint id' )
177+ parser .add_argument (
178+ '--destination-endpoint' ,
179+ required = True ,
180+ help = 'The destination endpoint id' )
181+ parser .add_argument (
182+ '--instance' ,
183+ action = 'append' ,
184+ required = True ,
185+ dest = "instances" ,
186+ metavar = "INSTANCE_IDENTIFIER" ,
187+ help = 'The identifier of a source instance to be '
188+ 'transferred. Can be specified multiple times' )
189+ parser .add_argument (
190+ '--scenario' ,
191+ dest = "scenario" ,
192+ metavar = "SCENARIO" ,
193+ choices = [
194+ TRANSFER_SCENARIO_REPLICA ,
195+ TRANSFER_SCENARIO_LIVE_MIGRATION ],
196+ default = TRANSFER_SCENARIO_REPLICA ,
197+ help = 'The type of scenario to use when creating '
198+ 'the Transfer. "replica" will create a '
199+ 'monthly-billed Replica which can be '
200+ 'executed and deployed as many times as '
201+ 'desired, while "live_migration" will '
202+ 'create a Transfer which can be synced '
203+ 'as many times as needed but only '
204+ 'deployed once.' )
205+ parser .add_argument (
206+ '--notes' ,
207+ dest = 'notes' ,
208+ help = 'Notes about the transfer' )
209+ parser .add_argument (
210+ '--user-script-global' ,
211+ action = 'append' ,
212+ required = False ,
213+ dest = "global_scripts" ,
214+ type = cli_utils .comma_separated_kv_to_dict ,
215+ help = 'A script that will run for a particular '
216+ 'os_type. This option can be used multiple '
217+ 'times. Use: linux=/path/to/script.sh or '
218+ 'windows=/path/to/script.ps1.'
219+ 'Can optionally include a script phase: '
220+ 'windows=/path/to/script.ps1,phase=osmorphing_pre_os_mount. '
221+ 'Supported phases: osmorphing_post_os_mount (default), '
222+ 'osmorphing_pre_os_mount.' )
223+ parser .add_argument (
224+ '--user-script-instance' , action = 'append' ,
225+ required = False ,
226+ dest = "instance_scripts" ,
227+ type = cli_utils .comma_separated_kv_to_dict ,
228+ help = 'A script that will run for a particular '
229+ 'instance specified by the --instance option. '
230+ 'This option can be used multiple times. '
231+ 'Use: "instance_name"=/path/to/script.sh.'
232+ ' This option overwrites any OS specific script '
233+ 'specified in --user-script-global for this '
234+ 'instance. Can optionally include a script phase: '
235+ 'instance_name=/path/to/script.ps1,'
236+ 'phase=osmorphing_pre_os_mount. '
237+ 'Supported phases: osmorphing_post_os_mount (default), '
238+ 'osmorphing_pre_os_mount.' )
217239
218240 cli_utils .add_args_for_json_option_to_parser (
219241 parser , 'destination-environment' )
@@ -358,27 +380,42 @@ class UpdateTransfer(show.ShowOne):
358380 def get_parser (self , prog_name ):
359381 parser = super (UpdateTransfer , self ).get_parser (prog_name )
360382 parser .add_argument ('id' , help = 'The transfer\' s id' )
361- parser .add_argument ('--notes' , dest = 'notes' ,
362- help = 'Notes about the transfer.' )
363- parser .add_argument ('--user-script-global' , action = 'append' ,
364- required = False ,
365- dest = "global_scripts" ,
366- type = cli_utils .comma_separated_kv_to_dict ,
367- help = 'A script that will run for a particular '
368- 'os_type. This option can be used multiple '
369- 'times. Use: linux=/path/to/script.sh or '
370- 'windows=/path/to/script.ps1' )
371- parser .add_argument ('--user-script-instance' , action = 'append' ,
372- required = False ,
373- dest = "instance_scripts" ,
374- type = cli_utils .comma_separated_kv_to_dict ,
375- help = 'A script that will run for a particular '
376- 'instance specified by the --instance option. '
377- 'This option can be used multiple times. '
378- 'Use: "instance_name"=/path/to/script.sh.'
379- ' This option overwrites any OS specific script '
380- 'specified in --user-script-global for this '
381- 'instance' )
383+ parser .add_argument (
384+ '--notes' ,
385+ dest = 'notes' ,
386+ help = 'Notes about the transfer.' )
387+ parser .add_argument (
388+ '--user-script-global' ,
389+ action = 'append' ,
390+ required = False ,
391+ dest = "global_scripts" ,
392+ type = cli_utils .comma_separated_kv_to_dict ,
393+ help = 'A script that will run for a particular '
394+ 'os_type. This option can be used multiple '
395+ 'times. Use: linux=/path/to/script.sh or '
396+ 'windows=/path/to/script.ps1. '
397+ 'Omit the path to unregister the script, e.g. "linux=".'
398+ 'Can optionally include a script phase: '
399+ 'windows=/path/to/script.ps1,phase=osmorphing_pre_os_mount. '
400+ 'Supported phases: osmorphing_post_os_mount (default), '
401+ 'osmorphing_pre_os_mount.' )
402+ parser .add_argument (
403+ '--user-script-instance' , action = 'append' ,
404+ required = False ,
405+ dest = "instance_scripts" ,
406+ type = cli_utils .comma_separated_kv_to_dict ,
407+ help = 'A script that will run for a particular '
408+ 'instance specified by the --instance option. '
409+ 'This option can be used multiple times. '
410+ 'Use: "instance_name"=/path/to/script.sh.'
411+ ' This option overwrites any OS specific script '
412+ 'specified in --user-script-global for this instance.'
413+ 'Omit the path to unregister the script, e.g. "linux=".'
414+ 'Can optionally include a script phase: '
415+ 'instance_name=/path/to/script.ps1,'
416+ 'phase=osmorphing_pre_os_mount. '
417+ 'Supported phases: osmorphing_post_os_mount (default), '
418+ 'osmorphing_pre_os_mount.' )
382419
383420 cli_utils .add_args_for_json_option_to_parser (
384421 parser , 'destination-environment' )
0 commit comments