Skip to content

Commit 4eb112a

Browse files
Merge pull request #1452 from caberos/issue1448
add the Hardware components on "slcli hardware detail"
2 parents 938076e + 6a8a2d5 commit 4eb112a

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']])
@@ -119,3 +121,13 @@ def _bw_table(bw_data):
119121

120122
table.add_row([bw_type, bw_point['amountIn'], bw_point['amountOut'], allotment])
121123
return table
124+
125+
126+
def _system_table(system_data):
127+
table = formatting.Table(['Type', 'name'])
128+
for system in system_data:
129+
table.add_row([utils.lookup(system, 'hardwareComponentModel',
130+
'hardwareGenericComponentModel',
131+
'hardwareComponentType', 'keyName'),
132+
utils.lookup(system, 'hardwareComponentModel', 'longDescription')])
133+
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)