Search code examples
objectstorageibm-cloud-infrastructureaccount

How to get cloud object storage information after it's ordered on softlayer?


I order a cloud object storage on softlayer through following method:

order={'prices': [{'id': 177725}], 'packageId': 206, 'quantity': 1}

result = client['SoftLayer_Product_Order'].placeOrder(order)

And I can see that the order is passed and cloud object storage is created. Then I want to get credentials info so I need to get account name first. But from the information output:

pp.pprint(result)

I have no idea to use which parameter to determine the cloud object storage created just now.

Q1: How can I get the account name or ID info for the cloud object storage created just now?

Q2: Is there any way to config account name when order cloud object storage?


Solution

  • Q1: You can get through orderId generated in the response from placeOrder method, here a part of code:

    objectFilter = {"networkStorage": {"billingItem": {"orderItem": {"order": {"id":{"operation": 123123}}}}}}
    
    result  = client['SoftLayer_Account'].getNetworkStorage(filter=objectFilter)
    

    Replace: 123123 with the orderId generated in placeOrder method response

    Q2: Unfortunately, its not possible to config the account name