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
4 changes: 2 additions & 2 deletions SoftLayer/CLI/block/replication/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
@click.argument('volume_id')
@click.option('--snapshot-schedule', '-s',
help='Snapshot schedule to use for replication, '
'(HOURLY | DAILY | WEEKLY)',
'(INTERVAL | HOURLY | DAILY | WEEKLY)',
required=True,
type=click.Choice(['HOURLY', 'DAILY', 'WEEKLY']))
type=click.Choice(['INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY']))
@click.option('--location', '-l',
help='Short name of the data center for the replicant '
'(e.g.: dal09)',
Expand Down
7 changes: 3 additions & 4 deletions SoftLayer/CLI/block/snapshot/disable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
@click.command()
@click.argument('volume_id')
@click.option('--schedule-type',
help='Snapshot schedule [HOURLY|DAILY|WEEKLY]',
help='Snapshot schedule [INTERVAL|HOURLY|DAILY|WEEKLY]',
required=True)
@environment.pass_env
def cli(env, volume_id, schedule_type):
"""Disables snapshots on the specified schedule for a given volume"""

if (schedule_type != 'HOURLY' and schedule_type != 'DAILY'
and schedule_type != 'WEEKLY'):
if (schedule_type not in ['INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY']):
raise exceptions.CLIAbort(
'--schedule-type must be HOURLY, DAILY, or WEEKLY')
'--schedule-type must be INTERVAL, HOURLY, DAILY, or WEEKLY')

block_manager = SoftLayer.BlockStorageManager(env.client)
disabled = block_manager.disable_snapshots(volume_id, schedule_type)
Expand Down
11 changes: 7 additions & 4 deletions SoftLayer/CLI/block/snapshot/enable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@click.command()
@click.argument('volume_id')
@click.option('--schedule-type',
help='Snapshot schedule [HOURLY|DAILY|WEEKLY]',
help='Snapshot schedule [INTERVAL|HOURLY|DAILY|WEEKLY]',
required=True)
@click.option('--retention-count',
help='Number of snapshots to retain',
Expand All @@ -30,15 +30,18 @@ def cli(env, volume_id, schedule_type, retention_count,
"""Enables snapshots for a given volume on the specified schedule"""
block_manager = SoftLayer.BlockStorageManager(env.client)

valid_schedule_types = {'HOURLY', 'DAILY', 'WEEKLY'}
valid_schedule_types = {'INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY'}
valid_days = {'SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY',
'FRIDAY', 'SATURDAY'}

if schedule_type not in valid_schedule_types:
raise exceptions.CLIAbort(
'--schedule-type must be HOURLY, DAILY, or WEEKLY, not '
+ schedule_type)
'--schedule-type must be INTERVAL, HOURLY, DAILY,' +
'or WEEKLY, not ' + schedule_type)

if schedule_type == 'INTERVAL' and (minute < 30 or minute > 59):
raise exceptions.CLIAbort(
'--minute value must be between 30 and 59')
if minute < 0 or minute > 59:
raise exceptions.CLIAbort(
'--minute value must be between 0 and 59')
Expand Down
4 changes: 2 additions & 2 deletions SoftLayer/CLI/file/replication/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
@click.argument('volume_id')
@click.option('--snapshot-schedule', '-s',
help='Snapshot schedule to use for replication, '
'(HOURLY | DAILY | WEEKLY)',
'(INTERVAL | HOURLY | DAILY | WEEKLY)',
required=True,
type=click.Choice(['HOURLY', 'DAILY', 'WEEKLY']))
type=click.Choice(['INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY']))
@click.option('--location', '-l',
help='Short name of the data center for the replicant '
'(e.g.: dal09)',
Expand Down
7 changes: 3 additions & 4 deletions SoftLayer/CLI/file/snapshot/disable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
@click.command()
@click.argument('volume_id')
@click.option('--schedule-type',
help='Snapshot schedule [HOURLY|DAILY|WEEKLY]',
help='Snapshot schedule [INTERVAL|HOURLY|DAILY|WEEKLY]',
required=True)
@environment.pass_env
def cli(env, volume_id, schedule_type):
"""Disables snapshots on the specified schedule for a given volume"""

if (schedule_type != 'HOURLY' and schedule_type != 'DAILY'
and schedule_type != 'WEEKLY'):
if (schedule_type not in ['INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY']):
raise exceptions.CLIAbort(
'--schedule_type must be HOURLY, DAILY, or WEEKLY')
'--schedule_type must be INTERVAL, HOURLY, DAILY, or WEEKLY')

file_manager = SoftLayer.FileStorageManager(env.client)
disabled = file_manager.disable_snapshots(volume_id, schedule_type)
Expand Down
11 changes: 7 additions & 4 deletions SoftLayer/CLI/file/snapshot/enable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@click.command()
@click.argument('volume_id')
@click.option('--schedule-type',
help='Snapshot schedule [HOURLY|DAILY|WEEKLY]',
help='Snapshot schedule [INTERVAL|HOURLY|DAILY|WEEKLY]',
required=True)
@click.option('--retention-count',
help='Number of snapshots to retain',
Expand All @@ -30,15 +30,18 @@ def cli(env, volume_id, schedule_type, retention_count,
"""Enables snapshots for a given volume on the specified schedule"""
file_manager = SoftLayer.FileStorageManager(env.client)

valid_schedule_types = {'HOURLY', 'DAILY', 'WEEKLY'}
valid_schedule_types = {'INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY'}
valid_days = {'SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY',
'FRIDAY', 'SATURDAY'}

if schedule_type not in valid_schedule_types:
raise exceptions.CLIAbort(
'--schedule-type must be HOURLY, DAILY, or WEEKLY, not '
+ schedule_type)
'--schedule-type must be INTERVAL, HOURLY, ' +
'DAILY, or WEEKLY, not ' + schedule_type)

if schedule_type == 'INTERVAL' and (minute < 30 or minute > 59):
raise exceptions.CLIAbort(
'--minute value must be between 30 and 59')
if minute < 0 or minute > 59:
raise exceptions.CLIAbort(
'--minute value must be between 0 and 59')
Expand Down
5 changes: 3 additions & 2 deletions SoftLayer/managers/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def get_block_volume_snapshot_list(self, volume_id, **kwargs):
'snapshotSizeBytes',
'storageType[keyName]',
'snapshotCreationTimestamp',
'intervalSchedule',
'hourlySchedule',
'dailySchedule',
'weeklySchedule'
Expand Down Expand Up @@ -237,8 +238,8 @@ def order_replicant_volume(self, volume_id, snapshot_schedule,
block_mask = 'billingItem[activeChildren,hourlyFlag],'\
'storageTierLevel,osType,staasVersion,'\
'hasEncryptionAtRest,snapshotCapacityGb,schedules,'\
'hourlySchedule,dailySchedule,weeklySchedule,'\
'storageType[keyName],provisionedIops'
'intervalSchedule,hourlySchedule,dailySchedule,'\
'weeklySchedule,storageType[keyName],provisionedIops'
block_volume = self.get_block_volume_details(volume_id,
mask=block_mask)

Expand Down
7 changes: 4 additions & 3 deletions SoftLayer/managers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def get_file_volume_snapshot_list(self, volume_id, **kwargs):
'snapshotSizeBytes',
'storageType[keyName]',
'snapshotCreationTimestamp',
'intervalSchedule',
'hourlySchedule',
'dailySchedule',
'weeklySchedule'
Expand Down Expand Up @@ -214,10 +215,10 @@ def order_replicant_volume(self, volume_id, snapshot_schedule,
"""

file_mask = 'billingItem[activeChildren,hourlyFlag],'\
'storageTierLevel,staasVersion,'\
'storageTierLevel,osType,staasVersion,'\
'hasEncryptionAtRest,snapshotCapacityGb,schedules,'\
'hourlySchedule,dailySchedule,weeklySchedule,'\
'storageType[keyName],provisionedIops'
'intervalSchedule,hourlySchedule,dailySchedule,'\
'weeklySchedule,storageType[keyName],provisionedIops'
file_volume = self.get_file_volume_details(volume_id,
mask=file_mask)

Expand Down