version 1.5

This commit is contained in:
Johannes Holzwarth | SE-Inno GmbH
2024-01-11 14:04:25 +01:00
parent 0ee8291846
commit 4492763b78
756 changed files with 209957 additions and 2 deletions
@@ -0,0 +1,37 @@
<?php
namespace InfluxDB2;
use Exception;
use InfluxDB2\Model\HealthCheck;
class HealthApi extends DefaultApi
{
/**
* HealthApi constructor.
* @param array $options
*/
public function __construct(array $options)
{
parent::__construct($options);
}
/**
* Get the health of an instance.
*
* @return HealthCheck
*/
public function health(): HealthCheck
{
try {
$response = $this->get('', "/health", []);
return ObjectSerializer::deserialize($response->getBody()->getContents(), '\InfluxDB2\Model\HealthCheck');
} catch (Exception $e) {
return new HealthCheck([
"name" => "influxdb",
"message" => $e->getMessage(),
"status" => "fail",
]);
}
}
}