1717 required = True )
1818@click .option ('--size' ,
1919 type = int ,
20- help = 'Size of block storage volume in GB. Permitted Sizes:\n '
21- '20, 40, 80, 100, 250, 500, 1000, 2000, 4000, 8000, 12000' ,
20+ help = 'Size of block storage volume in GB.' ,
2221 required = True )
2322@click .option ('--iops' ,
2423 type = int ,
25- help = 'Performance Storage IOPs,'
26- ' between 100 and 6000 in multiples of 100'
27- ' [required for storage-type performance]' )
24+ help = """Performance Storage IOPs. Options vary based on storage size.
25+ [required for storage-type performance]""" )
2826@click .option ('--tier' ,
29- help = 'Endurance Storage Tier (IOP per GB)'
30- ' [required for storage-type endurance]' ,
27+ help = 'Endurance Storage Tier (IOP per GB) [required for storage-type endurance]' ,
3128 type = click .Choice (['0.25' , '2' , '4' , '10' ]))
3229@click .option ('--os-type' ,
3330 help = 'Operating System' ,
4946 'space along with endurance block storage; specifies '
5047 'the size (in GB) of snapshot space to order' )
5148@click .option ('--service-offering' ,
52- help = ' The service offering package to use for placing '
53- 'the order [optional, default is \' storage_as_a_service\' ]' ,
49+ help = """ The service offering package to use for placing the order.
50+ [optional, default is \' storage_as_a_service\' ]. enterprise and performance are depreciated""" ,
5451 default = 'storage_as_a_service' ,
5552 type = click .Choice ([
5653 'storage_as_a_service' ,
@@ -71,26 +68,21 @@ def cli(env, storage_type, size, iops, tier, os_type,
7168 if billing .lower () == "hourly" :
7269 hourly_billing_flag = True
7370
74- if hourly_billing_flag and service_offering != 'storage_as_a_service' :
75- raise exceptions .CLIAbort (
76- 'Hourly billing is only available for the storage_as_a_service '
77- 'service offering'
78- )
71+ if service_offering != 'storage_as_a_service' :
72+ click .secho ('{} is a legacy storage offering' .format (service_offering ), fg = 'red' )
73+ if hourly_billing_flag :
74+ raise exceptions .CLIAbort (
75+ 'Hourly billing is only available for the storage_as_a_service service offering'
76+ )
7977
8078 if storage_type == 'performance' :
8179 if iops is None :
82- raise exceptions .CLIAbort (
83- 'Option --iops required with Performance' )
84-
85- if iops % 100 != 0 :
86- raise exceptions .CLIAbort (
87- 'Option --iops must be a multiple of 100'
88- )
80+ raise exceptions .CLIAbort ('Option --iops required with Performance' )
8981
9082 if service_offering == 'performance' and snapshot_size is not None :
9183 raise exceptions .CLIAbort (
92- '--snapshot-size is not available for performance volumes '
93- 'ordered with the \' performance \' service offering option '
84+ '--snapshot-size is not available for performance service offerings. '
85+ 'Use -- service- offering storage_as_a_service '
9486 )
9587
9688 try :
@@ -110,8 +102,7 @@ def cli(env, storage_type, size, iops, tier, os_type,
110102 if storage_type == 'endurance' :
111103 if tier is None :
112104 raise exceptions .CLIAbort (
113- 'Option --tier required with Endurance in IOPS/GB '
114- '[0.25,2,4,10]'
105+ 'Option --tier required with Endurance in IOPS/GB [0.25,2,4,10]'
115106 )
116107
117108 try :
@@ -134,5 +125,4 @@ def cli(env, storage_type, size, iops, tier, os_type,
134125 for item in order ['placedOrder' ]['items' ]:
135126 click .echo (" > %s" % item ['description' ])
136127 else :
137- click .echo ("Order could not be placed! Please verify your options " +
138- "and try again." )
128+ click .echo ("Order could not be placed! Please verify your options and try again." )
0 commit comments