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' ,
6360@environment .pass_env
6461def cli (env , storage_type , size , iops , tier , os_type ,
6562 location , snapshot_size , service_offering , billing ):
66- """Order a block storage volume."""
63+ """Order a block storage volume.
64+
65+ Valid size and iops options can be found here:
66+ https://console.bluemix.net/docs/infrastructure/BlockStorage/index.html#provisioning
67+ """
6768 block_manager = SoftLayer .BlockStorageManager (env .client )
6869 storage_type = storage_type .lower ()
6970
7071 hourly_billing_flag = False
7172 if billing .lower () == "hourly" :
7273 hourly_billing_flag = True
7374
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- )
75+ if service_offering != 'storage_as_a_service' :
76+ click .secho ('{} is a legacy storage offering' .format (service_offering ), fg = 'red' )
77+ if hourly_billing_flag :
78+ raise exceptions .CLIAbort (
79+ 'Hourly billing is only available for the storage_as_a_service service offering'
80+ )
7981
8082 if storage_type == 'performance' :
8183 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- )
84+ raise exceptions .CLIAbort ('Option --iops required with Performance' )
8985
9086 if service_offering == 'performance' and snapshot_size is not None :
9187 raise exceptions .CLIAbort (
92- '--snapshot-size is not available for performance volumes '
93- 'ordered with the \' performance \' service offering option '
88+ '--snapshot-size is not available for performance service offerings. '
89+ 'Use -- service- offering storage_as_a_service '
9490 )
9591
9692 try :
@@ -110,8 +106,7 @@ def cli(env, storage_type, size, iops, tier, os_type,
110106 if storage_type == 'endurance' :
111107 if tier is None :
112108 raise exceptions .CLIAbort (
113- 'Option --tier required with Endurance in IOPS/GB '
114- '[0.25,2,4,10]'
109+ 'Option --tier required with Endurance in IOPS/GB [0.25,2,4,10]'
115110 )
116111
117112 try :
@@ -134,5 +129,4 @@ def cli(env, storage_type, size, iops, tier, os_type,
134129 for item in order ['placedOrder' ]['items' ]:
135130 click .echo (" > %s" % item ['description' ])
136131 else :
137- click .echo ("Order could not be placed! Please verify your options " +
138- "and try again." )
132+ click .echo ("Order could not be placed! Please verify your options and try again." )
0 commit comments