You are here

public function DESConnector::getClusterInfo in Elasticsearch Connector 8

Return cluster info.

Return value

array Info array.

Throws

\Exception Exception().

File

src/DESConnector/DESConnector.php, line 191
Provides Elasticsearch Client for Drupal's Elasticsearch Connector module.

Class

DESConnector
Drupal Elasticsearch Interface.

Namespace

Drupal\elasticsearch_connector\DESConnector

Code

public function getClusterInfo() {
  $result = FALSE;
  try {
    try {
      $result['state'] = $this
        ->getClusterState();
      $result['health'] = $this
        ->getClusterHealth();
      $result['stats'] = $this
        ->getClusterStats();
    } catch (\Exception $e) {

      // TODO: Do not set messages or log messages into the abstraction.
      drupal_set_message($e
        ->getMessage(), 'error');
    }
  } catch (\Exception $e) {
    throw $e;
  }
  return $result;
}