Skip to content

Commit 74d8179

Browse files
committed
feat: add server status
1 parent 4da00de commit 74d8179

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

src/OpenLRW.php

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,30 @@ public static function isUp()
6868
}
6969

7070
/**
71-
* Creates a JSON Web Token
72-
*
73-
* @return mixed|\Psr\Http\Message\ResponseInterface
74-
* @throws GenericException
75-
* @throws \Exception
71+
* Get the indicator status of the server
72+
* @return bool
7673
*/
74+
public static function serverStatus()
75+
{
76+
try {
77+
$response = self::$http->get('/actuator/health');
78+
return $response->status === 'UP';
79+
} catch (\Exception $e) {
80+
return false;
81+
}
82+
}
83+
84+
public static function changeServerStatus(
85+
86+
87+
88+
/**
89+
* Creates a JSON Web Token
90+
*
91+
* @return mixed|\Psr\Http\Message\ResponseInterface
92+
* @throws GenericException
93+
* @throws \Exception
94+
*/
7795
public static function generateJwt()
7896
{
7997
$route = 'api/auth/login';

0 commit comments

Comments
 (0)