Skip to content

Commit 07507c1

Browse files
committed
Merge branch 'master' into issue1839
2 parents 0c794d4 + 1c9d0a6 commit 07507c1

File tree

20 files changed

+82
-58
lines changed

20 files changed

+82
-58
lines changed

SoftLayer/CLI/block/replication/disaster_recovery_failover.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
After using this method, to failback to the original volume, please open a support ticket.
1616
If you wish to test failover, please use replica-failover.""")
1717
@click.argument('volume-id')
18-
@click.option('--replicant-id', help="ID of the replicant volume")
18+
@click.option('--replicant-id', help="ID of the replicant volume.")
1919
@environment.pass_env
2020
def cli(env, volume_id, replicant_id):
2121
"""Failover an inaccessible block volume to its available replicant volume."""

SoftLayer/CLI/block/replication/failback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@click.argument('volume-id')
1111
@environment.pass_env
1212
def cli(env, volume_id):
13-
"""Failback a block volume from the given replicant volume."""
13+
"""Failback a block volume from the given replica volume."""
1414
block_storage_manager = SoftLayer.BlockStorageManager(env.client)
1515

1616
success = block_storage_manager.failback_from_replicant(volume_id)

SoftLayer/CLI/block/replication/failover.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
1010
@click.argument('volume-id')
11-
@click.option('--replicant-id', help="ID of the replicant volume")
11+
@click.option('--replicant-id', help="ID of the replicant volume.")
1212
@environment.pass_env
1313
def cli(env, volume_id, replicant_id):
14-
"""Failover a block volume to the given replicant volume."""
14+
"""Failover a block volume to the given replica volume."""
1515
block_storage_manager = SoftLayer.BlockStorageManager(env.client)
1616

1717
success = block_storage_manager.failover_to_replicant(

SoftLayer/CLI/block/replication/locations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222

2323
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
2424
@click.argument('volume-id')
25-
@click.option('--sortby', help='Column to sort by', default='Long Name')
2625
@click.option('--columns',
2726
callback=column_helper.get_formatter(COLUMNS),
2827
help='Columns to display. Options: {0}'.format(
2928
', '.join(column.name for column in COLUMNS)),
3029
default=','.join(DEFAULT_COLUMNS))
30+
@click.option('--sortby', help='Column to sort by', default='Long Name')
3131
@environment.pass_env
3232
def cli(env, columns, sortby, volume_id):
3333
"""List suitable replication datacenters for the given volume."""

SoftLayer/CLI/block/replication/order.py

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,16 @@
1414

1515
@click.command(cls=SoftLayer.CLI.command.SLCommand, context_settings=CONTEXT_SETTINGS)
1616
@click.argument('volume_id')
17-
@click.option('--snapshot-schedule', '-s',
18-
help='Snapshot schedule to use for replication, '
19-
'(HOURLY | DAILY | WEEKLY)',
20-
required=True,
21-
type=click.Choice(['HOURLY', 'DAILY', 'WEEKLY']))
22-
@click.option('--location', '-l',
23-
help='Short name of the data center for the replicant '
24-
'(e.g.: dal09)',
17+
@click.option('--datacenter', '-d',
18+
help='Short name of the datacenter for the replica (e.g.: dal09)',
2519
required=True)
26-
@click.option('--tier',
27-
help='Endurance Storage Tier (IOPS per GB) of the primary'
28-
' volume for which a replicant is ordered [optional]',
29-
type=click.Choice(['0.25', '2', '4', '10']))
30-
@click.option('--os-type',
31-
help='Operating System Type (e.g.: LINUX) of the primary'
32-
' volume for which a replica is ordered [optional]',
20+
@click.option('--iops', '-i',
21+
help='Performance Storage IOPs, between 100 and 6000 in multiples of 100. If no IOPS value is specified,'
22+
' the IOPS value of the original volume will be used.',
23+
type=int)
24+
@click.option('--os-type', '-o',
25+
help='Operating System Type (eg. LINUX) of the primary volume for '
26+
'which a replica is ordered [optional].',
3327
type=click.Choice([
3428
'HYPER_V',
3529
'LINUX',
@@ -38,22 +32,39 @@
3832
'WINDOWS_GPT',
3933
'WINDOWS',
4034
'XEN']))
35+
@click.option('--snapshot-schedule', '-s',
36+
help='Snapshot schedule to use for replication. Options are: '
37+
'HOURLY, DAILY, WEEKLY',
38+
required=True,
39+
type=click.Choice(['HOURLY', 'DAILY', 'WEEKLY']))
40+
@click.option('--tier', '-t',
41+
help='Endurance Storage Tier (IOPS per GB) of the primary volume for which a replica is ordered '
42+
'[optional]. If no tier is specified, the tier of the original volume will be used',
43+
type=click.Choice(['0.25', '2', '4', '10']))
4144
@environment.pass_env
42-
def cli(env, volume_id, snapshot_schedule, location, tier, os_type):
45+
def cli(env, volume_id, snapshot_schedule, datacenter, tier, os_type, iops):
4346
"""Order a block storage replica volume."""
4447
block_manager = SoftLayer.BlockStorageManager(env.client)
4548
block_volume_id = helpers.resolve_id(block_manager.resolve_ids, volume_id, 'Block Volume')
4649

4750
if tier is not None:
4851
tier = float(tier)
4952

53+
if iops is not None:
54+
if iops < 100 or iops > 6000:
55+
raise exceptions.ArgumentError(f"Invalid value for '--iops' / '-i': '{iops}' is not one "
56+
"of between 100 and 6000.")
57+
if iops % 100 != 0:
58+
raise exceptions.ArgumentError(f"Invalid value for '--iops' / '-i': '{iops}' is not a multiple of 100.")
59+
5060
try:
5161
order = block_manager.order_replicant_volume(
5262
block_volume_id,
5363
snapshot_schedule=snapshot_schedule,
54-
location=location,
64+
location=datacenter,
5565
tier=tier,
5666
os_type=os_type,
67+
iops=iops
5768
)
5869
except ValueError as ex:
5970
raise exceptions.ArgumentError(str(ex))

SoftLayer/CLI/block/replication/partners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
1616
@click.argument('volume-id')
17-
@click.option('--sortby', help='Column to sort by', default='Username')
1817
@click.option('--columns',
1918
callback=column_helper.get_formatter(COLUMNS),
2019
help='Columns to display. Options: {0}'.format(
2120
', '.join(column.name for column in COLUMNS)),
2221
default=','.join(DEFAULT_COLUMNS))
22+
@click.option('--sortby', help='Column to sort by', default='Username')
2323
@environment.pass_env
2424
def cli(env, columns, sortby, volume_id):
25-
"""List existing replicant volumes for a block volume."""
25+
"""List existing replica volumes for a block volume."""
2626
block_storage_manager = SoftLayer.BlockStorageManager(env.client)
2727

2828
legal_volumes = block_storage_manager.get_replication_partners(

SoftLayer/CLI/virt/capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def cli(env, identifier, name, all, note):
2929
table.align['name'] = 'r'
3030
table.align['value'] = 'l'
3131

32-
table.add_row(['vs_id', capture['guestId']])
32+
table.add_row(['globalIdentifier', capture['globalIdentifier']])
3333
table.add_row(['date', capture['createDate'][:10]])
3434
table.add_row(['time', capture['createDate'][11:19]])
3535
table.add_row(['transaction', formatting.transaction_status(capture)])

SoftLayer/CLI/vlan/list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def cli(env, sortby, datacenter, number, name, limit):
6565
vlan.get('vlanNumber'),
6666
vlan.get('fullyQualifiedName'),
6767
vlan.get('name') or formatting.blank(),
68-
vlan.get('networkSpace').capitalize(),
68+
vlan.get('networkSpace', 'Direct Link').capitalize(),
6969
utils.lookup(vlan, 'primaryRouter', 'datacenter', 'name'),
7070
get_pod_with_closed_announcement(vlan, pods),
7171
get_gateway_firewall(vlan),

SoftLayer/fixtures/SoftLayer_Account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@
485485

486486
getNetworkVlans = [{
487487
'id': 1,
488-
'networkSpace': 'PRIVATE',
488+
'networkSpace': '',
489489
'hardwareCount': 0,
490490
'hardware': [],
491491
'vlanNumber': 12,

SoftLayer/fixtures/SoftLayer_Virtual_Guest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,14 +716,15 @@
716716
setUserMetadata = ['meta']
717717
reloadOperatingSystem = 'OK'
718718
setTags = True
719-
createArchiveTransaction = {
719+
createArchiveTemplate = {
720720
'createDate': '2018-12-10T17:29:18-06:00',
721721
'elapsedSeconds': 0,
722722
'guestId': 12345678,
723723
'hardwareId': None,
724724
'id': 12345,
725725
'modifyDate': '2018-12-10T17:29:18-06:00',
726-
'statusChangeDate': '2018-12-10T17:29:18-06:00'
726+
'statusChangeDate': '2018-12-10T17:29:18-06:00',
727+
'globalIdentifier': '495c47c2-80af-4fef-87a9-97faf132345678'
727728
}
728729

729730
executeRescueLayer = True

0 commit comments

Comments
 (0)