はい、可能です。あなたが読んだ記事は、totalRecurringAmountおよびユーザ,SoftLayer_Billing_Itemの次の請求書への一致を知ることができます。請求書の明細が異なるユーザーによって発注された可能性があることを考慮してください。
アカウント内のすべての請求書について同じ情報を取得する場合は、getInvoicesメソッドを使用して同じアイデアを使用する必要がありますが、最初にどのように構造化されているかを理解する必要があります。 Softlayer_Billing_InvoiceオブジェクトはSoftLayer_Billing_Invoice_Itemのアイテムのリストを持ち、それぞれがSoftLayer_Billing_itemオブジェクトに関連付けられています。ご覧のとおり、これは要求された関係です。以下は
オブジェクトは、あなたが、各請求書のユーザーに関連付けられている課金アイテムを取得するために使用することができ、これはgetInvoices方法で使用したマスクです:
object_mask="mask[id,items[id,description,billingItem[id,orderItem[id,order[id,status,userRecord[id,firstName,lastName]]],invoiceItem[id,totalRecurringAmount]]]]"
をしかし請求書が数百または数千を持つことができることを考慮に入れますタイムアウトまたはサーバーの内部エラーが発生する可能性があります。それらを避けるために、result limitsを使用することをお勧めします。
以下はpythonの完全な例です。
import SoftLayer
from pprint import pprint as pp
user_name = 'set-me'
user_key = 'set-me'
client = SoftLayer.create_client_from_env(username=user_name, api_key=user_key)
object_mask = "mask[id,items[id,description,billingItem[id,orderItem[id," \
"order[id,status,userRecord[id,firstName,lastName]]]," \
"invoiceItem[id,totalRecurringAmount]]]]";
user_bill = client['Account'].getInvoices(mask=object_mask, limit=10, offset=0)
pp(user_bill)