I am using SoftLayer_Account::getHardware API to get list of hardware objects. I understand this gives me a list of servers for sure. Is there anything else hardware object can include? for eg: storage or any other type of object? I can see Device Type: "Gateway Member" on portal but the billing item's category code is "server" What is this object type? Can I consider this device as a server object?
SoftLayer_Account::getHardware includes ”Bare Metal Servers”
and ”Gateway Member”
.
To get only Bare Metal items (same amount of items as portal), please execute:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[networkGatewayMemberFlag]&objectFilter={ "hardware": { "networkGatewayMemberFlag": { "operation": 0 } } }
Method: GET
Where:
networkGatewayMemberFlag
has to be 0 for Bare metals.
Other request can help you to get the same amount of items (Bare metals) is:
https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Search/advancedSearch
Method: POST
Json Payload:
{
"parameters": [
"hardwareFunctionDescription:\"Server\" networkGatewayMemberFlag:0 _objectType:SoftLayer_Hardware"
]
}