diff --git a/SoftLayer/CLI/block/replication/order.py b/SoftLayer/CLI/block/replication/order.py index 5aebea17e..743c91c0e 100644 --- a/SoftLayer/CLI/block/replication/order.py +++ b/SoftLayer/CLI/block/replication/order.py @@ -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)', diff --git a/SoftLayer/CLI/block/snapshot/disable.py b/SoftLayer/CLI/block/snapshot/disable.py index f34d3483d..0d776bc7e 100644 --- a/SoftLayer/CLI/block/snapshot/disable.py +++ b/SoftLayer/CLI/block/snapshot/disable.py @@ -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) diff --git a/SoftLayer/CLI/block/snapshot/enable.py b/SoftLayer/CLI/block/snapshot/enable.py index 6ade94647..e81443e57 100644 --- a/SoftLayer/CLI/block/snapshot/enable.py +++ b/SoftLayer/CLI/block/snapshot/enable.py @@ -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', @@ -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') diff --git a/SoftLayer/CLI/file/replication/order.py b/SoftLayer/CLI/file/replication/order.py index 4b3231e66..9ba2c84f8 100644 --- a/SoftLayer/CLI/file/replication/order.py +++ b/SoftLayer/CLI/file/replication/order.py @@ -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)', diff --git a/SoftLayer/CLI/file/snapshot/disable.py b/SoftLayer/CLI/file/snapshot/disable.py index 9ec4fde82..07d68c467 100644 --- a/SoftLayer/CLI/file/snapshot/disable.py +++ b/SoftLayer/CLI/file/snapshot/disable.py @@ -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) diff --git a/SoftLayer/CLI/file/snapshot/enable.py b/SoftLayer/CLI/file/snapshot/enable.py index 7e73feefd..d4b3c104d 100644 --- a/SoftLayer/CLI/file/snapshot/enable.py +++ b/SoftLayer/CLI/file/snapshot/enable.py @@ -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', @@ -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') diff --git a/SoftLayer/managers/block.py b/SoftLayer/managers/block.py index 766312012..e8662ec74 100644 --- a/SoftLayer/managers/block.py +++ b/SoftLayer/managers/block.py @@ -141,6 +141,7 @@ def get_block_volume_snapshot_list(self, volume_id, **kwargs): 'snapshotSizeBytes', 'storageType[keyName]', 'snapshotCreationTimestamp', + 'intervalSchedule', 'hourlySchedule', 'dailySchedule', 'weeklySchedule' @@ -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) diff --git a/SoftLayer/managers/file.py b/SoftLayer/managers/file.py index 2ba39cca4..75e6abbf6 100644 --- a/SoftLayer/managers/file.py +++ b/SoftLayer/managers/file.py @@ -138,6 +138,7 @@ def get_file_volume_snapshot_list(self, volume_id, **kwargs): 'snapshotSizeBytes', 'storageType[keyName]', 'snapshotCreationTimestamp', + 'intervalSchedule', 'hourlySchedule', 'dailySchedule', 'weeklySchedule' @@ -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)