C. Fonseca
C. Fonseca

Reputation: 3

SoftLayer API SoftLayer_Billing_Item returns resourceTableId property which is not defined in the documentation

When I retrieve a SoftLayer_Billing_Item through the SoftLayer API as in the following REST API GET call:

https://api.softlayer.com/rest/v3/SoftLayer_Billing_Item/151376733

The result contains all the local properties defined in the SoftLayer Reference Documentation. http://sldn.softlayer.com/reference/datatypes/SoftLayer_Billing_Item

The result also returns a property called resourceTableId which is not listed in the documentation. The resourceTableId value for the billing item above is 28467033.

If I use that resourceTableId value in a virtual guest API REST call, e.g.,

https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/28467033

I get the details of the resource that generated the billing item. I have tried other examples including hardware examples and all have worked fine. It's a good way to tie the billing item back to what generated it.

However, I am getting an error when I include the resourceTableId property in a objectMask request. The response says resourceTableId is not a property.

Here's an example querying SoftLayer_Billing_Item with a mask.

https://api.softlayer.com/rest/v3/SoftLayer_Billing_Item/151376733?objectMask=mask[id,hostName,domainName,resourceTableId]

comes back with

{
"error": "Property 'resourceTableId' not valid for 'SoftLayer_Billing_Item'.",
"code": "SoftLayer_Exception_WebService_ObjectMask"
}

Is there a way to include the resourceTableId in a objectMask request?

Upvotes: 0

Views: 116

Answers (1)

nope there is no way, in fact that is an issue that property should not be displayed for the customers (even in documentation that property is not displayed), you can use the property meanwhile however keep in mind that property could be not displayed anymore in the future when they decide to fix that issue.

The way to tie a billing item with a softlyaer resource is by the billing item id, i mean you should get the billing item of the resource calling the method getBillingItem or using the object maks "mask[billingItem]" and verify if that value match with the billing item that you are using, this approach is not so easy as the approach that you want to use, but this approach will not be modified in the future.

Regards

Upvotes: 0

Related Questions