From f3ba174d82052f26a138780710f01f7dc8d35923 Mon Sep 17 00:00:00 2001 From: Shravan Kumar Raghu Date: Fri, 28 Oct 2016 17:06:27 +0000 Subject: [PATCH] Changes to File volume list and detail commands to display NFS MountPoint for Volumes --- CONTRIBUTORS | 1 + SoftLayer/CLI/file/detail.py | 6 ++++++ SoftLayer/CLI/file/list.py | 5 ++++- SoftLayer/fixtures/SoftLayer_Account.py | 1 + SoftLayer/fixtures/SoftLayer_Network_Storage.py | 1 + SoftLayer/managers/file.py | 4 +++- tests/CLI/modules/file_tests.py | 4 +++- 7 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6197a85fb..c0971279a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -21,6 +21,7 @@ Ryan Hanson Scott Thompson Sergio Carlos Shane Poage +Shravan Kumar Raghu simplydave SoftLayer suppandi diff --git a/SoftLayer/CLI/file/detail.py b/SoftLayer/CLI/file/detail.py index b73ecc0de..25cdb956a 100644 --- a/SoftLayer/CLI/file/detail.py +++ b/SoftLayer/CLI/file/detail.py @@ -55,6 +55,12 @@ def cli(env, volume_id): file_volume['serviceResourceBackendIpAddress'], ]) + if file_volume['fileNetworkMountAddress']: + table.add_row([ + 'Mount Address', + file_volume['fileNetworkMountAddress'], + ]) + if file_volume['snapshotCapacityGb']: table.add_row([ 'Snapshot Capacity (GB)', diff --git a/SoftLayer/CLI/file/list.py b/SoftLayer/CLI/file/list.py index a3266362e..40399538c 100644 --- a/SoftLayer/CLI/file/list.py +++ b/SoftLayer/CLI/file/list.py @@ -27,6 +27,8 @@ mask="serviceResourceBackendIpAddress"), column_helper.Column('active_transactions', ('activeTransactionCount',), mask="activeTransactionCount"), + column_helper.Column('mount_addr', ('fileNetworkMountAddress',), + mask="fileNetworkMountAddress",), column_helper.Column( 'created_by', ('billingItem', 'orderItem', 'order', 'userRecord', 'username')), @@ -40,7 +42,8 @@ 'capacity_gb', 'bytes_used', 'ip_addr', - 'active_transactions' + 'active_transactions', + 'mount_addr' ] diff --git a/SoftLayer/fixtures/SoftLayer_Account.py b/SoftLayer/fixtures/SoftLayer_Account.py index 88f0eb605..561ff3926 100644 --- a/SoftLayer/fixtures/SoftLayer_Account.py +++ b/SoftLayer/fixtures/SoftLayer_Account.py @@ -479,6 +479,7 @@ 'password': 'pass', 'serviceResourceBackendIpAddress': '127.0.0.1', 'storageType': {'keyName': 'ENDURANCE_STORAGE'}, + 'fileNetworkMountAddress': '127.0.0.1:/TEST', }] getActiveQuotes = [{ diff --git a/SoftLayer/fixtures/SoftLayer_Network_Storage.py b/SoftLayer/fixtures/SoftLayer_Network_Storage.py index 52a178e3a..43012eb7a 100644 --- a/SoftLayer/fixtures/SoftLayer_Network_Storage.py +++ b/SoftLayer/fixtures/SoftLayer_Network_Storage.py @@ -31,6 +31,7 @@ }], 'serviceResource': {'datacenter': {'id': 449500, 'name': 'dal05'}}, 'serviceResourceBackendIpAddress': '10.1.2.3', + 'fileNetworkMountAddress': '127.0.0.1:/TEST', 'serviceResourceName': 'Storage Type 01 Aggregate staaspar0101_pc01', 'username': 'username', 'storageType': {'keyName': 'ENDURANCE_STORAGE'}, diff --git a/SoftLayer/managers/file.py b/SoftLayer/managers/file.py index ae1792064..717d4edd5 100644 --- a/SoftLayer/managers/file.py +++ b/SoftLayer/managers/file.py @@ -35,7 +35,8 @@ def list_file_volumes(self, datacenter=None, username=None, 'bytesUsed', 'serviceResource.datacenter[name]', 'serviceResourceBackendIpAddress', - 'activeTransactionCount' + 'activeTransactionCount', + 'fileNetworkMountAddress' ] kwargs['mask'] = ','.join(items) @@ -81,6 +82,7 @@ def get_file_volume_details(self, volume_id, **kwargs): 'storageType.keyName', 'serviceResource.datacenter[name]', 'serviceResourceBackendIpAddress', + 'fileNetworkMountAddress', 'storageTierLevel', 'iops', 'lunId', diff --git a/tests/CLI/modules/file_tests.py b/tests/CLI/modules/file_tests.py index 3cbce5266..3bd43015e 100644 --- a/tests/CLI/modules/file_tests.py +++ b/tests/CLI/modules/file_tests.py @@ -86,7 +86,8 @@ def test_volume_list(self): 'ip_addr': '127.0.0.1', 'storage_type': 'ENDURANCE', 'username': 'user', - 'active_transactions': None + 'active_transactions': None, + 'mount_addr': '127.0.0.1:/TEST' }], json.loads(result.output)) @@ -122,6 +123,7 @@ def test_volume_detail(self): 'Used Space': '0B', 'Endurance Tier': '2 IOPS per GB', 'IOPs': 1000, + 'Mount Address': '127.0.0.1:/TEST', 'Snapshot Capacity (GB)': '10', 'Snapshot Used (Bytes)': 1024, 'Capacity (GB)': '20GB',