Skip to content

Commit

Permalink
Merge pull request #2075 from softlayer/jayasilan-issue2028
Browse files Browse the repository at this point in the history
slcli file snapshot-list, snapshot-order, snapshot-restore command example addition #2028
  • Loading branch information
allmightyspiff committed Aug 21, 2023
2 parents bb5a260 + 78b05d8 commit a208d40
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion SoftLayer/CLI/file/snapshot/list.py
Expand Up @@ -35,7 +35,12 @@
default=','.join(DEFAULT_COLUMNS))
@environment.pass_env
def cli(env, volume_id, sortby, columns):
"""List file storage snapshots."""
"""List file storage snapshots.
Example::
slcli file snapshot-list 12345678 --sortby id
This command lists all snapshots of volume with ID 12345678 and sorts them by ID.
"""
file_manager = SoftLayer.FileStorageManager(env.client)
resolved_id = helpers.resolve_id(file_manager.resolve_ids, volume_id, 'Volume Id')
snapshots = file_manager.get_file_volume_snapshot_list(
Expand Down
7 changes: 6 additions & 1 deletion SoftLayer/CLI/file/snapshot/order.py
Expand Up @@ -25,7 +25,12 @@
is_flag=True)
@environment.pass_env
def cli(env, volume_id, capacity, tier, upgrade):
"""Order snapshot space for a file storage volume."""
"""Order snapshot space for a file storage volume.
Example::
slcli file snapshot-order 12345678 -s 1000 -t 4
This command orders snapshot space for volume with ID 12345678, the size is 1000GB, the tier level is 4 IOPS per GB.
"""
file_manager = SoftLayer.FileStorageManager(env.client)

if tier is not None:
Expand Down
7 changes: 6 additions & 1 deletion SoftLayer/CLI/file/snapshot/restore.py
Expand Up @@ -13,7 +13,12 @@
' to restore the block volume')
@environment.pass_env
def cli(env, volume_id, snapshot_id):
"""Restore file volume using a given snapshot"""
"""Restore file volume using a given snapshot
Example::
slcli file snapshot-restore 12345678 -s 87654321
This command restores volume with ID 12345678 from snapshot with ID 87654321.
"""
file_manager = SoftLayer.FileStorageManager(env.client)
success = file_manager.restore_from_snapshot(volume_id, snapshot_id)

Expand Down

0 comments on commit a208d40

Please sign in to comment.