Softlayer Python API:multiple local properties of billing item are not returned
Question: Calling the billing_Item Python API, a billing_item is returned BUT a lot of
(interesting) local properties are not returned. The local properties of my
interest all have to do with uptime and fees (e.g. laborFee, oneTimeFee,
hoursUsed, recurringFee, ...), but they are not returned.

What I do:

    
    
    import SoftLayer
    
    conn = SoftLayer.create_client_from_env(username='',api_key='')
    
    allParents = conn.call('Account','getAllTopLevelBillingItems') #allParents is a list with billing_Items
    
    allParents[0] # returns the first billing_Item as a dict but without a lot of relevant parameters
    

Also, the children billing items of each parent billing item lack a lot of
local properties.


Answer: The below python script displays the local properties that you need. Also, if
your script doesn't return the properties that you need, please apply object
masks, like this example:

    
    
    import SoftLayer
    # For nice debug output:
    from pprint import pprint as pp
    
    apiUsername = 'set me'
    apiKey = 'set me'
    
    client = SoftLayer.Client(
        username=apiUsername,
        api_key=apiKey
    )
    
    objectMask = 'mask[id,laborFee,oneTimeFee,recurringFee]'
    
    try:
        result = client['SoftLayer_Account'].getAllTopLevelBillingItems(mask=objectMask)
        pp(result)
    except Exception as e:
        pp('Failed ............', e)
    

I hope it helps you.

