Scalr\Service\OpenStack\Services\Network\V2\NetworkApi::listLbHealthMonitors PHP Method

listLbHealthMonitors() public method

List LBaaS Health Monitors action (GET /lb/health_monitors[/health-monitors-id])
public listLbHealthMonitors ( string $healthMonitorId = null, Scalr\Service\OpenStack\Services\Network\Type\ListLbHealthMonitorsFilter $filter = null ) : Scalr\Service\OpenStack\Type\DefaultPaginationList | object
$healthMonitorId string optional The ID of the health monitor to show detailed info
$filter Scalr\Service\OpenStack\Services\Network\Type\ListLbHealthMonitorsFilter optional The query filter.
return Scalr\Service\OpenStack\Type\DefaultPaginationList | object Returns the list of the Health Monitors or the requested pool
    public function listLbHealthMonitors($healthMonitorId = null, ListLbHealthMonitorsFilter $filter = null)
    {
        $result = null;
        $detailed = $healthMonitorId !== null ? sprintf("/%s", $this->escape($healthMonitorId)) : '';
        $response = $this->getClient()->call($this->service, '/lb/health_monitors' . $detailed . ($filter !== null ? '?' . $filter->getQueryString() : ''));
        if ($response->hasError() === false) {
            $result = json_decode($response->getContent());
            if (empty($detailed)) {
                $result = new DefaultPaginationList($this->service, 'health_monitors', $result->health_monitors, isset($result->health_monitors_links) ? $result->health_monitors_links : null);
            } else {
                $result = $result->health_monitor;
            }
        }
        return $result;
    }