Softlayer API to get virtual guest owner

后端 未结 3 1050
小鲜肉
小鲜肉 2021-01-26 11:21

Is there any API to get owner(user who has provisioned a virtual guest) of a virtual guest? I can only see users having access to a virtual guest API.

Thanks

相关标签:
3条回答
  • 2021-01-26 12:00

    Please try the following request using filters:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectFilter={   "virtualGuests": {     "billingItem": {       "orderItem": {         "order": {           "userRecord": {             "username": {               "operation": "myUserName"             }           }         }       }     }   } }&objectMask=mask[id,fullyQualifiedDomainName,billingItem.orderItem.order.userRecord.username]
    
    Method: GET
    

    EDIT

    Additionally to get Bare Metal Servers related to “username”, execute:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectFilter={   "hardware": {     "billingItem": {       "orderItem": {         "order": {           "userRecord": {             "username": {               "operation": "myUsername"             }           }         }       }     }   } }&objectMask=mask[id,fullyQualifiedDomainName,billingItem.orderItem.order.userRecord.username]
    Method: GET
    

    If you know the server Id, use “object masks” to get more information than by default, example:

    Virtual Guest:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[virtual_guest_Id]/getObject?objectMask=mask[id,fullyQualifiedDomainName,billingItem[id,orderItem[id,order[userRecord[id,username]]]]]
    Method: GET
    

    Hardware:

    https://[usrename]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Hardware/[hardware_id]/getObject?objectMask=mask[id,fullyQualifiedDomainName,billingItem[id,orderItem[id,order[userRecord[id,username]]]]]
    Method: GET
    

    Some references:

    REST

    Object Filters

    Time for a REST, Everyone

    0 讨论(0)
  • 2021-01-26 12:12

    SoftLayer_User_Customer:getVirtualGuests gives all the virtual guests I have access to and not the ones which I actually provisioned.

    0 讨论(0)
  • 2021-01-26 12:17

    Try this method please:

    SoftLayer_Account::getVirtualGuests

    0 讨论(0)
提交回复
热议问题