55import SoftLayer
66from SoftLayer .CLI import environment
77from SoftLayer .CLI import exceptions
8+ from SoftLayer .CLI import formatting
89
910
1011CONTEXT_SETTINGS = {'token_normalize_func' : lambda x : x .upper ()}
5859 show_default = True ,
5960 help = 'Whether or not this duplicate will be a dependent duplicate'
6061 'of the origin volume.' )
62+ @click .option ('--force' , default = False , is_flag = True , help = "Force modify" )
6163@environment .pass_env
6264def cli (env , origin_volume_id , origin_snapshot_id , duplicate_size ,
6365 duplicate_iops , duplicate_tier , duplicate_snapshot_size , billing ,
64- dependent_duplicate ):
65- """Order a duplicate file storage volume."""
66+ dependent_duplicate , force ):
67+ """Order a duplicate file storage volume.
68+
69+ EXAMPLE::
70+ slcli file volume-duplicate 12345678
71+ This command shows order a new volume by duplicating the volume with ID 12345678.
72+ """
6673 file_manager = SoftLayer .FileStorageManager (env .client )
6774
6875 hourly_billing_flag = False
@@ -72,6 +79,11 @@ def cli(env, origin_volume_id, origin_snapshot_id, duplicate_size,
7279 if duplicate_tier is not None :
7380 duplicate_tier = float (duplicate_tier )
7481
82+ if not force :
83+ if not (env .skip_confirmations or formatting .confirm ("This action will incur charges on your account."
84+ "Continue?" )):
85+ raise exceptions .CLIAbort ('Aborted.' )
86+
7587 try :
7688 order = file_manager .order_duplicate_volume (
7789 origin_volume_id ,
0 commit comments