Search code examples
ibm-cloud-infrastructure

Query to get list of servers


I'm trying to get a list of servers that are in a specific datacenter and a specific domain.

I've tried this objectFilter query as well:

{"hardware":{"datacenter":{"name":{"operation":"fra02"}}},"domain": 
{"operation":"imzcloud.ibmammsap.local"}}


 https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getHardware?objectFilter={%22hardware%22:{%22datacenter%22:{%22name%22:{%22operation%22:%22fra02%22}}},%22domain%22:{%22operation%22:%22=imzcloud.ibmammsap.local%22}}

The query should return only the baremetal servers in fra02 and with the domain but it returns all the servers at the site . The domain filter does not seem to work


Solution

  • Try to use the following example:

    https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getHardware?objectMask=mask[datacenter]&objectFilter={"hardware": {"datacenter":{"name": {"operation": "fra02"}},"domain": {"operation": "imzcloud.ibmammsap.local" }}}
    

    You could change the domain and the data center name to get hardware from other datacenters