SoftLayer - 如何从最近订购的服务中解析 ResourceTableIds

SoftLayer - How to resolve ResourceTableIds from recently ordered services

从帐户服务开始并调用 getNextInvoiceTopLevelBillingItems,您可以获取所有活动的账单项目,包括当前账单周期中最近订购的项目。

跟踪包含 invoiceItems[createDate,hostName,domainName,resourceTableId,notes] 的对象掩码将允许您获取关联的发票项目,包括周期内最近订购的商品的发票行。这将使您获得一个对象 ID,您可以使用该对象 ID 提取虚拟来宾或裸机详细信息(除其他外)。

但是,对于新创建的服务,resourceTableId 为空白(空)。其他字段填写正确,但只缺少系统或服务的 ID。在计费周期之外创建的所有其他内容都将返回 resourceTableId。

是否有其他方法可以解决 getNextInvoiceTopLevelBillingItems 返回的结算项目中的 resourceTableId

执行以下请求时:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNextInvoiceTopLevelBillingItems?objectMask=mask[invoiceItems[createDate,hostName,domainName,resourceTableId,notes,invoice.typeCode]]

Method: GET

我们可以看到,当invoice.typeCode“NEW”时,"resourceTableId"将为null。但是当 invoice.typeCode“RECURRING” 时,"resourceTableId" 字段应该与 null 不同。

在以下参考资料中,您可以找到有关 SoftLayer_Billing_Invoice 个州的一些附加信息:SoftLayer_Billing_Invoice

遗憾的是,不存在解决该问题的替代方法"resourceTableId",因为为新订单生成了具有空值的此项目发票,此时资源尚未确定或分配(hardwareId) 到项目发票。

Updated

1:  {
"allowCancellationFlag": 1
"cancellationDate": null
"categoryCode": "server"
"createDate": "2016-04-05T12:48:12-03:00"
"cycleStartDate": "2016-04-05T12:48:12-03:00"
"description": "Single Intel Xeon E3-1250 v2 (4 Cores, 3.60 GHz)"
"domainName": "example.com"
"hostName": "test"
"id": 90120222
"laborFee": "0"
"laborFeeTaxRate": "0"
"lastBillDate": "2016-04-05T12:48:12-03:00"
"modifyDate": "2016-04-05T15:21:30-03:00"
"nextBillDate": "2016-05-04T02:00:00-03:00"
"oneTimeFee": "0"
"oneTimeFeeTaxRate": "0"
"orderItemId": 114652123
"parentId": null
"recurringFee": "0"
"recurringFeeTaxRate": "0"
"recurringMonths": 1
"serviceProviderId": 1
"setupFee": "0"
"setupFeeTaxRate": "0"
"invoiceItems": [1]
0:  {
"createDate": "2016-04-05T12:48:12-03:00"
"domainName": "example.com"
"hostName": "test"
"resourceTableId": null
"invoice": {
"typeCode": "NEW"
}-
}-
-
"resourceTableId": 123123
}

I got this: "resourceTableId": 123123