backend-plugin-api: fix typings in health service

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2024-06-20 15:45:02 +02:00
parent 7df5c8875c
commit 878f2efc51
3 changed files with 8 additions and 6 deletions
@@ -17,12 +17,12 @@ import { RootHealthService, coreServices } from '@backstage/backend-plugin-api';
const backend = createBackend();
class MyRootHealthService implements RootHealthService {
async getLiveness(): Promise<{ status: number; payload?: any }> {
async getLiveness() {
// provide your own implementation
return { status: 200, payload: { status: 'ok' } };
}
async getReadiness(): Promise<{ status: number; payload?: any }> {
async getReadiness() {
// provide your own implementation
return { status: 200, payload: { status: 'ok' } };
}
+2 -2
View File
@@ -505,11 +505,11 @@ export interface RootConfigService extends Config {}
export interface RootHealthService {
getLiveness(): Promise<{
status: number;
payload?: any;
payload?: JsonValue;
}>;
getReadiness(): Promise<{
status: number;
payload?: any;
payload?: JsonValue;
}>;
}
@@ -14,6 +14,8 @@
* limitations under the License.
*/
import { JsonValue } from '@backstage/types';
/**
* @public
*/
@@ -21,9 +23,9 @@ export interface RootHealthService {
/**
* Get the liveness status of the backend.
*/
getLiveness(): Promise<{ status: number; payload?: any }>;
getLiveness(): Promise<{ status: number; payload?: JsonValue }>;
/**
* Get the readiness status of the backend.
*/
getReadiness(): Promise<{ status: number; payload?: any }>;
getReadiness(): Promise<{ status: number; payload?: JsonValue }>;
}