1010
1111
1212@click .command (cls = SLCommand )
13+ @click .option ('--create' , '-c' , help = 'The date the billing item was created.' )
14+ @click .option ('--ordered' , '-o' , help = 'Name that ordered the item' )
15+ @click .option ('--category' , '-C' , help = 'Category name' )
1316@environment .pass_env
14- def cli (env ):
17+ def cli (env , create , category , ordered ):
1518 """Lists billing items with some other useful information.
1619
1720 Similiar to https://cloud.ibm.com/billing/billing-items
1821 """
1922
2023 manager = AccountManager (env .client )
21- items = manager .get_account_billing_items ()
22- table = item_table (items )
24+ items = manager .get_account_billing_items (create , category )
25+ table = item_table (items , ordered )
2326
2427 env .fout (table )
2528
2629
27- def item_table (items ):
30+ def item_table (items , ordered = None ):
2831 """Formats a table for billing items"""
2932 table = formatting .Table ([
3033 "Id" ,
@@ -48,7 +51,9 @@ def item_table(items):
4851 if user :
4952 # ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
5053 ordered_by = user .get ('displayName' )
51-
54+ if ordered :
55+ if ordered != ordered_by :
56+ continue
5257 table .add_row ([
5358 item .get ('id' ),
5459 create_date ,
0 commit comments