0

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

codec
  • 7,978
  • 26
  • 71
  • 127

3 Answers3

1

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

mcruz
  • 1,534
  • 2
  • 11
  • 14
  • Thanks a lot. This is perfect :) – codec Mar 01 '16 at 06:34
  • Similarly is there any way to get details for a baremetal servers I own? – codec Mar 01 '16 at 06:38
  • Also this API works if I know the user name of device owner. What if I have device ID and I want to know the owner of the device based on the device ID? – codec Mar 01 '16 at 08:38
  • @lovesoftlayeraj, I added more requests in the answer (section: EDIT) that can help you. Regards. – mcruz Mar 01 '16 at 14:25
0

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

codec
  • 7,978
  • 26
  • 71
  • 127
0

Try this method please:

SoftLayer_Account::getVirtualGuests