Skip to content
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
10 changes: 6 additions & 4 deletions SoftLayer/CLI/block/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,18 @@ def cli(env, volume_id):
replicant['id']])
replicant_table.add_row([
'Volume Name',
replicant['username']])
utils.lookup(replicant, 'username')])
replicant_table.add_row([
'Target IP',
replicant['serviceResourceBackendIpAddress']])
utils.lookup(replicant, 'serviceResourceBackendIpAddress')])
replicant_table.add_row([
'Data Center',
replicant['serviceResource']['datacenter']['name']])
utils.lookup(replicant,
'serviceResource', 'datacenter', 'name')])
replicant_table.add_row([
'Schedule',
replicant['replicationSchedule']['type']['keyname']])
utils.lookup(replicant,
'replicationSchedule', 'type', 'keyname')])
replicant_list.append(replicant_table)
table.add_row(['Replicant Volumes', replicant_list])

Expand Down
31 changes: 19 additions & 12 deletions SoftLayer/CLI/block/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@
help='Optional parameter for ordering snapshot '
'space along with endurance block storage; specifies '
'the size (in GB) of snapshot space to order')
@click.option('--service-offering',
help='The service offering package to use for placing '
'the order [optional, default is \'storage_as_a_service\']',
default='storage_as_a_service',
type=click.Choice([
'storage_as_a_service',
'enterprise',
'performance']))
@environment.pass_env
def cli(env, storage_type, size, iops, tier, os_type,
location, snapshot_size):
location, snapshot_size, service_offering):
"""Order a block storage volume."""
block_manager = SoftLayer.BlockStorageManager(env.client)
storage_type = storage_type.lower()
Expand All @@ -60,28 +68,26 @@ def cli(env, storage_type, size, iops, tier, os_type,
raise exceptions.CLIAbort(
'Option --iops required with Performance')

if iops < 100 or iops > 6000:
raise exceptions.CLIAbort(
'Option --iops must be between 100 and 6000, inclusive')

if iops % 100 != 0:
raise exceptions.CLIAbort(
'Option --iops must be a multiple of 100'
)

if snapshot_size is not None:
if service_offering == 'performance' and snapshot_size is not None:
raise exceptions.CLIAbort(
'Option --snapshot-size not allowed for performance volumes.'
'Snapshots are only available for endurance storage.'
'--snapshot-size is not available for performance volumes '
'ordered with the \'performance\' service offering option'
)

try:
order = block_manager.order_block_volume(
storage_type='performance_storage_iscsi',
storage_type=storage_type,
location=location,
size=int(size),
iops=iops,
os_type=os_type
os_type=os_type,
snapshot_size=snapshot_size,
service_offering=service_offering
)
except ValueError as ex:
raise exceptions.ArgumentError(str(ex))
Expand All @@ -95,12 +101,13 @@ def cli(env, storage_type, size, iops, tier, os_type,

try:
order = block_manager.order_block_volume(
storage_type='storage_service_enterprise',
storage_type=storage_type,
location=location,
size=int(size),
tier_level=float(tier),
os_type=os_type,
snapshot_size=snapshot_size
snapshot_size=snapshot_size,
service_offering=service_offering
)
except ValueError as ex:
raise exceptions.ArgumentError(str(ex))
Expand Down
5 changes: 3 additions & 2 deletions SoftLayer/CLI/block/snapshot/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
required=True)
@click.option('--tier',
help='Endurance Storage Tier (IOPS per GB) of the block'
' volume for which space is ordered [optional]',
type=click.Choice(['0.25', '2', '4']))
' volume for which space is ordered [optional, and only'
' valid for endurance storage volumes]',
type=click.Choice(['0.25', '2', '4', '10']))
@click.option('--upgrade',
type=bool,
help='Flag to indicate that the order is an upgrade',
Expand Down
10 changes: 6 additions & 4 deletions SoftLayer/CLI/file/detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@ def cli(env, volume_id):
replicant['id']])
replicant_table.add_row([
'Volume Name',
replicant['username']])
utils.lookup(replicant, 'username')])
replicant_table.add_row([
'Target IP',
replicant['serviceResourceBackendIpAddress']])
utils.lookup(replicant, 'serviceResourceBackendIpAddress')])
replicant_table.add_row([
'Data Center',
replicant['serviceResource']['datacenter']['name']])
utils.lookup(replicant,
'serviceResource', 'datacenter', 'name')])
replicant_table.add_row([
'Schedule',
replicant['replicationSchedule']['type']['keyname']])
utils.lookup(replicant,
'replicationSchedule', 'type', 'keyname')])
replicant_list.append(replicant_table)
table.add_row(['Replicant Volumes', replicant_list])

Expand Down
31 changes: 19 additions & 12 deletions SoftLayer/CLI/file/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@
help='Optional parameter for ordering snapshot '
'space along with endurance file storage; specifies '
'the size (in GB) of snapshot space to order')
@click.option('--service-offering',
help='The service offering package to use for placing '
'the order [optional, default is \'storage_as_a_service\']',
default='storage_as_a_service',
type=click.Choice([
'storage_as_a_service',
'enterprise',
'performance']))
@environment.pass_env
def cli(env, storage_type, size, iops, tier,
location, snapshot_size):
location, snapshot_size, service_offering):
"""Order a file storage volume."""
file_manager = SoftLayer.FileStorageManager(env.client)
storage_type = storage_type.lower()
Expand All @@ -48,27 +56,25 @@ def cli(env, storage_type, size, iops, tier,
raise exceptions.CLIAbort(
'Option --iops required with Performance')

if iops < 100 or iops > 6000:
raise exceptions.CLIAbort(
'Option --iops must be between 100 and 6000, inclusive')

if iops % 100 != 0:
raise exceptions.CLIAbort(
'Option --iops must be a multiple of 100'
)

if snapshot_size is not None:
if service_offering == 'performance' and snapshot_size is not None:
raise exceptions.CLIAbort(
'Option --snapshot-size not allowed for performance volumes.'
' Snapshots are only available for endurance storage.'
'--snapshot-size is not available for performance volumes '
'ordered with the \'performance\' service offering option'
)

try:
order = file_manager.order_file_volume(
storage_type='performance_storage_nfs',
storage_type=storage_type,
location=location,
size=size,
iops=iops
iops=iops,
snapshot_size=snapshot_size,
service_offering=service_offering
)
except ValueError as ex:
raise exceptions.ArgumentError(str(ex))
Expand All @@ -82,11 +88,12 @@ def cli(env, storage_type, size, iops, tier,

try:
order = file_manager.order_file_volume(
storage_type='storage_service_enterprise',
storage_type=storage_type,
location=location,
size=size,
tier_level=float(tier),
snapshot_size=snapshot_size
snapshot_size=snapshot_size,
service_offering=service_offering
)
except ValueError as ex:
raise exceptions.ArgumentError(str(ex))
Expand Down
5 changes: 3 additions & 2 deletions SoftLayer/CLI/file/snapshot/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
required=True)
@click.option('--tier',
help='Endurance Storage Tier (IOPS per GB) of the file'
' volume for which space is ordered [optional]',
type=click.Choice(['0.25', '2', '4']))
' volume for which space is ordered [optional, and only'
' valid for endurance storage volumes]',
type=click.Choice(['0.25', '2', '4', '10']))
@click.option('--upgrade',
type=bool,
help='Flag to indicate that the order is an upgrade',
Expand Down
Loading