Skip to content

Commit 6a8a2d5

Browse files
author
caberos
committed
add the Hardware components on "slcli hardware detail"
1 parent c897382 commit 6a8a2d5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

SoftLayer/CLI/hardware/detail.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def cli(env, identifier, passwords, price):
7171
bandwidth = hardware.get_bandwidth_allocation(hardware_id)
7272
bw_table = _bw_table(bandwidth)
7373
table.add_row(['Bandwidth', bw_table])
74+
system_table = _system_table(result['activeComponents'])
75+
table.add_row(['System_data', system_table])
7476

7577
if result.get('notes'):
7678
table.add_row(['notes', result['notes']])
@@ -117,3 +119,13 @@ def _bw_table(bw_data):
117119

118120
table.add_row([bw_type, bw_point['amountIn'], bw_point['amountOut'], allotment])
119121
return table
122+
123+
124+
def _system_table(system_data):
125+
table = formatting.Table(['Type', 'name'])
126+
for system in system_data:
127+
table.add_row([utils.lookup(system, 'hardwareComponentModel',
128+
'hardwareGenericComponentModel',
129+
'hardwareComponentType', 'keyName'),
130+
utils.lookup(system, 'hardwareComponentModel', 'longDescription')])
131+
return table

SoftLayer/managers/hardware.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ def get_hardware(self, hardware_id, **kwargs):
239239
'primaryIpAddress,'
240240
'networkManagementIpAddress,'
241241
'userData,'
242+
'activeComponents[id,hardwareComponentModel['
243+
'hardwareGenericComponentModel[id,hardwareComponentType[keyName]]]],'
242244
'datacenter,'
243245
'''networkComponents[id, status, speed, maxSpeed, name,
244246
ipmiMacAddress, ipmiIpAddress, macAddress, primaryIpAddress,

0 commit comments

Comments
 (0)