codec
codec

Reputation: 8806

Softlayer API to get virtual guest owner

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

Upvotes: 0

Views: 386

Answers (3)

mcruz
mcruz

Reputation: 1532

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

Upvotes: 1

Ruber Cuellar Valenzuela
Ruber Cuellar Valenzuela

Reputation: 2757

Try this method please:

SoftLayer_Account::getVirtualGuests

Upvotes: 0

codec
codec

Reputation: 8806

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

Upvotes: 1

Related Questions