0
votes

When SoftLayer hardware servers are ordered with the placeOrder() API call, the hostnames are provided as part of the Product_Order value, and an orderId is returned. Is there a way to retrieve the hostnames from the order using the orderId?

I was able to find the order by looking through the list returned by client['Account'].getOrders(). However, that does not give me any order details (see below). I looked through the list of SoftLayer Services and methods, but could not seem to find the answer.

order retrieved from SoftLayer (note there are no hostnames or other details) {'accountId': 999999, 'createDate': '2017-03-20T12:00:00-07:00', 'id': 21212121, 'impersonatingUserRecordId': '', 'modifyDate': '2017-03-20T12:00:00-07:00', 'orderQuoteId': '', 'orderTypeId': 4, 'presaleEventId': '', 'privateCloudOrderFlag': False, 'status': 'APPROVED', 'userRecordId': 757575}

1

1 Answers

0
votes

After continuing to dig through the SoftLayer documentation, I was able to find a solution. It involves retrieving the items from the Billing_Order to get at the hostnames on the order.

Sample code that works

for item in client['Billing_Order'].getItems(id=orderid):
    if 'hostName' in item:
        print item['hostName']