Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block|file volume-options improvements #1700

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions SoftLayer/CLI/block/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ def cli(env):

iops_table = formatting.Table(['Id', 'Description', 'KeyName'], title='IOPS')
snapshot_table = formatting.Table(['Id', 'Description', 'KeyName'], title='Snapshot')
storage_table = formatting.Table(['Id', 'Description', 'KeyName'], title='Storage')
storage_table = formatting.Table(['Id', 'Description', 'KeyName', 'Capacity Minimum'], title='Storage')
datacenter_table = formatting.Table(['Id', 'Description', 'KeyName'], title='Datacenter')

storage_table.align['Description'] = 'l'
storage_table.align['KeyName'] = 'l'
storage_table.sortby = 'Id'
for datacenter in datacenters:
datacenter_table.add_row([datacenter['location']['locationId'],
datacenter.get('description'),
Expand All @@ -33,7 +36,7 @@ def cli(env):
for item in items:
if item['itemCategory']['categoryCode'] == 'performance_storage_space':
storage_table.add_row([item.get('id'), item.get('description'),
item.get('keyName')])
item.get('keyName'), item.get('capacityMinimum') or '-'])

if item['itemCategory']['categoryCode'] == 'storage_tier_level':
iops_table.add_row([item.get('id'), item.get('description'),
Expand Down
12 changes: 7 additions & 5 deletions SoftLayer/CLI/file/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting


PACKAGE_STORAGE = 759


Expand All @@ -23,18 +22,21 @@ def cli(env):

iops_table = formatting.Table(['Id', 'Description', 'KeyName'], title='IOPS')
snapshot_table = formatting.Table(['Id', 'Description', 'KeyName'], title='Snapshot')
storage_table = formatting.Table(['Id', 'Description', 'KeyName'], title='Storage')
file_storage_table = formatting.Table(['Id', 'Description', 'KeyName', 'Capacity Minimum'], title='Storage')
datacenter_table = formatting.Table(['Id', 'Description', 'KeyName'], title='Datacenter')

file_storage_table.align['Description'] = 'l'
file_storage_table.align['KeyName'] = 'l'
file_storage_table.sortby = 'Id'
for datacenter in datacenters:
datacenter_table.add_row([datacenter['location']['locationId'],
datacenter.get('description'),
datacenter['keyname']])

for item in items:
if item['itemCategory']['categoryCode'] == 'performance_storage_space':
storage_table.add_row([item.get('id'), item.get('description'),
item.get('keyName')])
file_storage_table.add_row([item.get('id'), item.get('description'),
item.get('keyName'), item.get('capacityMinimum') or '-'])

if item['itemCategory']['categoryCode'] == 'storage_tier_level':
iops_table.add_row([item.get('id'), item.get('description'),
Expand All @@ -46,5 +48,5 @@ def cli(env):

env.fout(datacenter_table)
env.fout(iops_table)
env.fout(storage_table)
env.fout(file_storage_table)
env.fout(snapshot_table)