Search code examples
apicurlibm-cloud-infrastructure

SoftLayer Curl Command Does Not Match UI Output


I've been creating and deleting VMs, and trying to pull their status throughout the processing of the order. The output is always '{"id":[ID],"statusId":1001}' no matter where in the process the order is.

In the UI, it may say 'Attaching Primary Disk', but it will always output 'Active' and '1001' using the API.

The command used:

curl https://[username]:[apiKey]@api.softlayer.com/rest/v3/Softlayer_Hardware_Server/[serverID].json

Is there a reason why this doesn't work? Is there a solution to getting the status using the API?


Solution

  • About the status you see in UI "Attaching Primary Disk", I think you are talking about the transaction status, to retrieve that information you can use the following methods

    For Virtual Guests: https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getActiveTransaction https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getActiveTransactions https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getLastTransaction

    For Hardware Servers: https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getActiveTransaction https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getActiveTransactions https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getLastTransaction