3

Hi i have ordered block storage device on softlayer, using place order method. I want to know name and id of ordered device. How can to know it . place order method doesnt return id or name in response. I need id to call some othrr methods on softlayer

Raghav
  • 89
  • 10

1 Answers1

1

After placing an order a SoftLayer_Container_Product_Order_Receipt object is created which doesn’t contain the Block Storage ID, instead it contains an orderId which can be used to check if the order has been approved. This can be used to verify the order status:

http://$username:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Billing_Order/$orderId/getObject.json

Method: GET

Once the status of the order is “APPROVED” then there’s an id available for the Block Storage.

You could use this objectFilter using the orderId to retrieve the Block Storage.

http://$username:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Account/getIscsiNetworkStorage.json?objectMask=mask[billingItem[orderItem[order]]]&objectFilter={"iscsiNetworkStorage":{"billingItem":{"orderItem":{"order":{"id":{"operation":$orderId}}}}}}

Method: GET

The next links provide further information: http://sldn.softlayer.com/reference/services/SoftLayer_Product_Order/placeOrder http://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Receipt

  • Hi David, below is sample output of getIscsiNetworkStorage without any filter and mask [{'username': "abc"', 'capacityGb': 20, 'hostId': '', 'serviceProviderId': 1, 'nasType': 'ISCSI', 'upgradableFlag': True, 'storageTypeId': '7', 'createDate': '2016-07-13T14:42:11+05:30', 'serviceResourceName': 'PerfStor Aggr aggr_staasdal0501_pc01', 'hardwareId': '', 'guestId': '', 'id': 1268645923, 'accountId': ****}] only these fields are present ,I cant apply filter and mask for fields you mentioned ...could you please check if something is missing – Raghav Jul 14 '16 at 04:42
  • If you use `?objectMask=mask[billingItem[orderItem[order]]]` after `getIscsiNetworkStorage`. your output will have those additional fields, you can try that without the objectFilter. Adding the `&objectFilter={"iscsiNetworkStorage":{"billingItem":{"orderItem":{"order":{"id":{"operation":$orderId}}}}}}` after the **mask** will filter your output. Maybe these links might help you: [link](https://sldn.softlayer.com/article/object-masks) [link](https://sldn.softlayer.com/article/object-filters) – Pedro David Fuentes Antezana Jul 14 '16 at 13:45