How to get order username and provisionDate for all SoftLayer machines using Ruby?

前端 未结 1 1852
-上瘾入骨i
-上瘾入骨i 2021-01-27 05:15

Using Ruby I\'m making a call like:

client = SoftLayer::Client.new(:username => user, :api_key => api_key, :timeout => 999999)
client[\'Account\'].objec         


        
相关标签:
1条回答
  • 2021-01-27 05:47

    Please see the following provisioning steps, below is a little flow to consider:

    1.  Order a Server
    
    Result: 
    * An orderId is assigned to the server
    * The createDate has a new value
    * activeTransaction value is =  Null
    * provisionDate value is = Null
    
    2.  The order is approved
    
    Result: 
    * activeTransaction value is <> Null
    * provisionDate value = Null
    
    3.  Server  is already provisioned
    
    Result:
    * activeTransaction value is = Null
    * provisionDate value has a New value
    * billingItem property has a new value
    

    To see if your machines have still ”activeTransaction”, please execute:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/[server_id]/getActiveTransaction
    Method: GET
    

    Now, after reviewing your example response, this server had some problems when completing the provisioning; for that reason this step was completed manually but the provisionDate was not set for any reason(please open a ticket if you want that the provisionDate can be set) . This is a special case. I can see that another server has a similar behavior. But the other servers that don’t have provisionDate, have still ”activeTransaction<>null” (it means that these server are not provisioned yet).

    EDIT:

    Other property can help you to know that your machine has been already provisioned although other kind of transaction is being executed, is “hardwareStatus”, it should have “ACTIVE” value.

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id, hostname, fullyQualifiedDomainName, provisionDate,hardwareStatus]
    Method: GET
    

    The response should be something like this:

    {
    "fullyQualifiedDomainName": "myhostname.softlayer.com"
    "hostname": " myhostname"
    "id": 1234567
    "provisionDate": "2015-06-29T00:21:39-05:00"
    "hardwareStatus": {
    "id": 5
    "status": "ACTIVE"
    }
    
    0 讨论(0)
提交回复
热议问题