0
votes

SoftLayer's API has different "services" for the different objects represented in the API. Virtual Guests, Bare Metal Servers, VLANs, IP addresses, etc are all different types of services. There are also links between these services, so I want to use a single API query to get information about multiple services. The Object Mask is one way of joining the different services. Can anyone please tell me how to achieve it using object mask.

1

1 Answers

0
votes

Here you can see information about object mask:

http://sldn.softlayer.com/article/object-Masks

Now all the services are attached to your account, so you need to take a look to the service: http://sldn.softlayer.com/reference/datatypes/SoftLayer_Account http://sldn.softlayer.com/reference/services/SoftLayer_Account

The service provides several methods to get differents services such as virtual guest: http://sldn.softlayer.com/reference/services/SoftLayer_Account/getVirtualGuests

or get all the bare metal servers in your account: http://sldn.softlayer.com/reference/services/SoftLayer_Account/getHardware

Using Object mask you just need to call the getObject method and add the properties that you want for example see this RESTFul to get the virtual guest, bare metal servers and VLans:

GET https://$USERNAME:[email protected]/rest/v3.1/SoftLayer_Account/getObject?objectMask=mask[virtualGuests,hardware,networkVlans]

So you can get all the information that you need in a single request however, when your response contains a big amount of data your request will throw an exception, in order to handle that you need to use result limits in your request you can see more information about how to add it to your request here: https://sldn.softlayer.com/article/REST

Regards