|
| 1 | +"""List all options for ordering a file storage.""" |
| 2 | +# :license: MIT, see LICENSE for more details. |
| 3 | + |
| 4 | +import click |
| 5 | + |
| 6 | +import SoftLayer |
| 7 | +from SoftLayer.CLI.command import SLCommand |
| 8 | +from SoftLayer.CLI import environment |
| 9 | +from SoftLayer.CLI import formatting |
| 10 | + |
| 11 | +volume_size = ['20', '40', '80', '100', '250', '500', '1000', '2000-3000', '4000-7000', '8000-9000', '10000-12000'] |
| 12 | + |
| 13 | + |
| 14 | +@click.command(cls=SLCommand) |
| 15 | +@environment.pass_env |
| 16 | +def cli(env): |
| 17 | + """List all options for ordering a file storage""" |
| 18 | + |
| 19 | + network_manager = SoftLayer.NetworkManager(env.client) |
| 20 | + datacenters = network_manager.get_datacenter() |
| 21 | + |
| 22 | + table = formatting.Table(['Name', 'Value'], title='Volume table') |
| 23 | + |
| 24 | + table.add_row(['Storage Type', 'performance,endurance']) |
| 25 | + table.add_row(['Size (GB)', str(volume_size)]) |
| 26 | + |
| 27 | + iops_table = formatting.Table(['Size (GB)', '20', '40', '80', '100', '250', '500', '1000', '2000-3000', |
| 28 | + '4000-7000', '8000-9000', '10000-12000'], title='IOPS table') |
| 29 | + snapshot_table = formatting.Table(['Storage Size (GB)', 'Available Snapshot Size (GB)'], title="Snapshot table") |
| 30 | + |
| 31 | + datacenter_str = ','.join([str(dc['longName']) for dc in datacenters]) |
| 32 | + iops_table.add_row(['Size (GB)', *volume_size]) |
| 33 | + iops_table.add_row(['Min IOPS', '100', '100', '100', '100', '100', '100', '100', '200', '300', '500', '1000']) |
| 34 | + iops_table.add_row(['Max IOPS', '1000', '2000', '4000', '6000', '6000', '6000 or 10000', '6000 or 20000', |
| 35 | + '6000 or 40000', '6000 or 48000', '6000 or 48000', '6000 or 48000']) |
| 36 | + # table.add_row(['iops', iops_table]) |
| 37 | + table.add_row(['Tier', '0.25,2,4,10']) |
| 38 | + table.add_row(['location', datacenter_str]) |
| 39 | + |
| 40 | + snapshot_table.add_row(['20', '0,5,10,20']) |
| 41 | + snapshot_table.add_row(['40', '0,5,10,20,40']) |
| 42 | + snapshot_table.add_row(['80', '0,5,10,20,40,60,80']) |
| 43 | + snapshot_table.add_row(['100', '0,5,10,20,40,60,80,100']) |
| 44 | + snapshot_table.add_row(['250', '0,5,10,20,40,60,80,100,150,200,250']) |
| 45 | + snapshot_table.add_row(['500', '0,5,10,20,40,60,80,100,150,200,250,300,350,400,450,500']) |
| 46 | + snapshot_table.add_row(['1000', '0,5,10,20,40,60,80,100,150,200,250,300,350,400,450,500,600,700,1000']) |
| 47 | + snapshot_table.add_row(['2000-3000', '0,5,10,20,40,60,80,100,150,200,250,300,350,400,450,500,600,700,1000,2000']) |
| 48 | + snapshot_table.add_row( |
| 49 | + ['4000-7000', '0,5,10,20,40,60,80,100,150,200,250,300,350,400,450,500,600,700,1000,2000,4000']) |
| 50 | + snapshot_table.add_row( |
| 51 | + ['8000-9000', '0,5,10,20,40,60,80,100,150,200,250,300,350,400,450,500,600,700,1000,2000,4000']) |
| 52 | + snapshot_table.add_row( |
| 53 | + ['10000-12000', '0,5,10,20,40,60,80,100,150,200,250,300,350,400,450,500,600,700,1000,2000,4000']) |
| 54 | + |
| 55 | + # table.add_row(['Snapshot Size (GB)', snapshot_table]) |
| 56 | + table.add_row(['Note:', |
| 57 | + 'IOPs limit above 6000 available in select data centers, refer to:' |
| 58 | + 'http://knowledgelayer.softlayer.com/articles/new-ibm-block-and-file-storage-location-and-features']) |
| 59 | + env.fout(table) |
| 60 | + env.fout(iops_table) |
| 61 | + env.fout(snapshot_table) |
0 commit comments