问题
We have been using the getInvoices to extract costs for a specific time period. Today we tried this command.
curl -k -n "https://api.softlayer.com/rest/v3/SoftLayer_Account/286900/getInvoices?objectMask=mask%5Bid,closedDate,createDate,typeCode,invoiceTotalAmount,invoiceTotalOneTimeAmount,invoiceTotalRecurringAmount,invoiceTopLevelItems%5Bid,description,hostName,domainName,totalRecurringAmount,totalOneTimeAmount,parentId,categoryCode,billingItemId,billingItem%5Bid,orderItem%5Bid,order%5Bid,userRecord%5Bid,username,firstName,lastName%5D%5D%5D%5D%5D%5D&objectFilter=%7B%22invoices%22:%7B%22createDate%22:%7B%22operation%22:%20%22betweenDate%22,%22options%22:%20%5B%7B%22name%22:%20%22startDate%22,%20%22value%22:%20%5B%227/29/2016%200:0:0%22%5D%7D,%7B%22name%22:%20%22endDate%22,%20%22value%22:%20%5B%228/5/2916%2023:59:59%22%5D%7D%5D%7D%7D%7D"
The return is "{"error":"Internal Error","code":"SoftLayer_Exception_Public"}"
I have no idea what this error means. The date span for the invoices is from 7/29/2016 to 8/5/2016.
Thanks for any help.
回答1:
I’m not able to reproduce the problem, but maybe the cause is related a lot information in the response. Please try again the request by adding Result limits
.
These articles can help you:
http://sldn.softlayer.com/blog/phil/How-Solve-Error-fetching-http-headers https://sldn.softlayer.com/article/REST
Update:
After executing some tests more, an error message displays when trying to execute SoftLayer_Account::getInvoices
{ "error": "Allowed memory size of 402653184 bytes exhausted (tried to allocate 4 bytes)", "code": "Client" }
I assume that is a huge number of data to break the execution and the problem may be the memory usage limit.
In that case result limits
can help us, this is a basic example:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getInvoices?resultLimit=0,10
Method: GET
来源:https://stackoverflow.com/questions/39498926/getinvoices-method-failing