File tree Expand file tree Collapse file tree 5 files changed +197
-95
lines changed
Expand file tree Collapse file tree 5 files changed +197
-95
lines changed Original file line number Diff line number Diff line change 44import click
55import SoftLayer
66from SoftLayer .CLI import environment
7- from SoftLayer .CLI import exceptions
87
98
109@click .command ()
1110@click .argument ('volume_id' )
1211@environment .pass_env
1312def cli (env , volume_id ):
1413 """Get snapshots space usage threshold warning flag setting for a given volume"""
15-
1614 block_manager = SoftLayer .BlockStorageManager (env .client )
1715 enabled = block_manager .get_volume_snapshot_notification_status (volume_id )
1816
1917 if (enabled == '' ):
20- click .echo (
21- ' Enabled:Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
22- % (volume_id ))
18+ click .echo ("""
19+ Enabled:Snapshots space usage warning flag is null. Set to default value enable. For volume %s
20+ """ % (volume_id ))
2321 elif (enabled == 'True' ):
2422 click .echo (
2523 'Enabled:Snapshots space usage threshold warning flag setting is enabled for volume %s'
Original file line number Diff line number Diff line change 44import click
55import SoftLayer
66from SoftLayer .CLI import environment
7- from SoftLayer .CLI import exceptions
87
98
109@click .command ()
1110@click .argument ('volume_id' )
12- @click .option ('--enable/--disable' , default = True ,
13- help =
14- 'Enable/Disable snapshot usage warning notification. Use `slcli block snapshot-set-notification volumeId --enable` to enable' ,
11+ @click .option (
12+ '--enable/--disable' ,
13+ default = True ,
14+ help = """
15+ Enable/Disable snapshot notification. Use `slcli block snapshot-set-notification volumeId --enable` to enable
16+ """ ,
1517 required = True )
1618@environment .pass_env
1719def cli (env , volume_id , enable ):
1820 """Enables/Disables snapshot space usage threshold warning for a given volume"""
1921 block_manager = SoftLayer .BlockStorageManager (env .client )
2022
21- status = block_manager .set_volume_snapshot_notification (
22- volume_id , enable )
23+ status = block_manager .set_volume_snapshot_notification (volume_id , enable )
2324
2425 if status :
2526 click .echo (
2627 'Snapshots space usage threshold warning notification has bee set to %s for volume %s'
27- % (enabled , volume_id ))
28+ % (enable , volume_id ))
Original file line number Diff line number Diff line change 44import click
55import SoftLayer
66from SoftLayer .CLI import environment
7- from SoftLayer .CLI import exceptions
87
98
109@click .command ()
@@ -18,7 +17,7 @@ def cli(env, volume_id):
1817
1918 if (enabled == '' ):
2019 click .echo (
21- 'Enabled:Snapshots space usage threshold warning flag setting is null. Set to default value enable. For volume %s'
20+ 'Enabled:Snapshots space usage threshold warning flag is null. Set to default value enable. For volume %s'
2221 % (volume_id ))
2322 elif (enabled == 'True' ):
2423 click .echo (
Original file line number Diff line number Diff line change 44import click
55import SoftLayer
66from SoftLayer .CLI import environment
7- from SoftLayer .CLI import exceptions
87
98
109@click .command ()
1110@click .argument ('volume_id' )
12- @click .option ('--enable/--disable' , default = True ,
13- help =
14- 'Enable/Disable snapshot usage warning notification. Use `slcli block snapshot-set-notification volumeId --enable` to enable' ,
11+ @click .option (
12+ '--enable/--disable' ,
13+ default = True ,
14+ help = 'Enable/Disable snapshot notification. Use `slcli file snapshot-set-notification volumeId --enable` to enable' ,
1515 required = True )
1616@environment .pass_env
1717def cli (env , volume_id , enable ):
1818 """Enables/Disables snapshot space usage threshold warning for a given volume"""
1919 file_manager = SoftLayer .FileStorageManager (env .client )
2020
21- status = file_manager .set_volume_snapshot_notification (
22- volume_id , enable )
21+ status = file_manager .set_volume_snapshot_notification (volume_id , enable )
2322 if status :
2423 click .echo (
2524 'Snapshots space usage threshold warning notification has bee set to %s for volume %s'
26- % (enable , volume_id ))
25+ % (enable , volume_id ))
You can’t perform that action at this time.
0 commit comments