I am implementing a monitoring on dashboard using softlayer api. To check a current server status, I've used the API below and count them.
Baremetal server : hw.asService(client).getServerPowerState();
Virtual server : guest.getPowerState().getKeyName();
The result of status is "on" or "off". (running or halt for VM)
How can I know the number of recovering ?
Please try the following request:
https://[username]:[apikey]@api.softlayer.com/rest/v3.1/SoftLayer_Account/getObject?objectMask=mask[networkMonitorUpHardware,networkMonitorUpVirtualGuests, networkMonitorRecoveringHardware, networkMonitorRecoveringHardware(SoftLayer_Hardware_Server)[ activeTransactions[ transactionGroup ] ], networkMonitorDownHardware[ hardwareStatus, datacenter[ longName ] ], networkMonitorDownHardware(SoftLayer_Hardware_Server)[ activeTransactions[transactionGroup ] ], networkMonitorRecoveringVirtualGuests, networkMonitorDownVirtualGuests ]
Method: GET
Reference: SoftLayer_Account - datatypes
Properties involved in the mask:
- networkMonitorDownHardware
- networkMonitorDownVirtualGuests
- networkMonitorRecoveringHardware
- networkMonitorRecoveringVirtualGuests
- networkMonitorUpHardware
- networkMonitorUpVirtualGuests