Skip to content

Commit f8db60b

Browse files
Merge pull request #2074 from ramkishor-ch/issue_2027
added Example for slcli file snapshot-create, slcli file snapshot-disable, slcli file snapshot-enable
2 parents a208d40 + e466c67 commit f8db60b

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

SoftLayer/CLI/file/snapshot/create.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
help='Notes to set on the new snapshot')
1313
@environment.pass_env
1414
def cli(env, volume_id, notes):
15-
"""Creates a snapshot on a given volume"""
15+
"""Creates a snapshot on a given volume
16+
17+
Example::
18+
19+
slcli file snapshot-create 12345678 --note snapshotforsoftlayer
20+
This command creates a snapshot for volume with ID 12345678 and with addition note as snapshotforsoftlayer.
21+
"""
1622
file_storage_manager = SoftLayer.FileStorageManager(env.client)
1723
snapshot = file_storage_manager.create_snapshot(volume_id, notes=notes)
1824

SoftLayer/CLI/file/snapshot/disable.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
required=True)
1515
@environment.pass_env
1616
def cli(env, volume_id, schedule_type):
17-
"""Disables snapshots on the specified schedule for a given volume"""
17+
"""Disables snapshots on the specified schedule for a given volume
18+
19+
Example::
20+
21+
slcli file snapshot-disable 12345678 -s DAILY
22+
This command disables daily snapshot for volume with ID 12345678.
23+
"""
1824

1925
if (schedule_type not in ['INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY']):
2026
raise exceptions.CLIAbort(

SoftLayer/CLI/file/snapshot/enable.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@
2727
@environment.pass_env
2828
def cli(env, volume_id, schedule_type, retention_count,
2929
minute, hour, day_of_week):
30-
"""Enables snapshots for a given volume on the specified schedule"""
30+
"""Enables snapshots for a given volume on the specified schedule
31+
32+
Example::
33+
34+
slcli file snapshot-enable 12345678 -s WEEKLY -c 5 -m 0 --hour 2 -d 0
35+
This command enables snapshot for volume with ID 12345678, snapshot is
36+
taken weekly on every Sunday at 2:00, and up to 5 snapshots are retained.
37+
"""
3138
file_manager = SoftLayer.FileStorageManager(env.client)
3239

3340
valid_schedule_types = {'INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY'}

0 commit comments

Comments
 (0)