Skip to content

Commit 3db1007

Browse files
Merge pull request #1446 from caberos/issue1445
add billing and lastTransaction on hardware detail
2 parents 170418c + 19f2898 commit 3db1007

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

SoftLayer/CLI/hardware/detail.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def cli(env, identifier, passwords, price):
6262
table.add_row(['created', result['provisionDate'] or formatting.blank()])
6363
table.add_row(['owner', owner or formatting.blank()])
6464

65+
last_transaction = "{} ({})".format(utils.lookup(result, 'lastTransaction', 'transactionGroup', 'name'),
66+
utils.clean_time(utils.lookup(result, 'lastTransaction', 'modifyDate')))
67+
68+
table.add_row(['last_transaction', last_transaction])
69+
table.add_row(['billing', 'Hourly' if result['hourlyBillingFlag'] else'Monthly'])
70+
6571
vlan_table = formatting.Table(['type', 'number', 'id'])
6672
for vlan in result['networkVlans']:
6773
vlan_table.add_row([vlan['networkSpace'], vlan['vlanNumber'], vlan['id']])

SoftLayer/managers/hardware.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ def get_hardware(self, hardware_id, **kwargs):
265265
'nextInvoiceChildren[nextInvoiceTotalRecurringAmount],'
266266
'orderItem.order.userRecord[username]'
267267
'],'
268+
'lastTransaction[transactionGroup],'
268269
'hourlyBillingFlag,'
269270
'tagReferences[id,tag[name,id]],'
270271
'networkVlans[id,vlanNumber,networkSpace],'

0 commit comments

Comments
 (0)