0
votes

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

3 Answers

1
votes

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
votes

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