diff --git a/src/models/health.ts b/src/models/health.ts new file mode 100644 index 0000000..6010bca --- /dev/null +++ b/src/models/health.ts @@ -0,0 +1,10 @@ +/** + * Model for a server health status response + */ +export interface HealthStatus { + /** + * The server status + */ + status: 'UP' | 'DOWN'; + +} diff --git a/src/protocol/tsp-client.ts b/src/protocol/tsp-client.ts index d2cb6ef..e3d10ac 100644 --- a/src/protocol/tsp-client.ts +++ b/src/protocol/tsp-client.ts @@ -11,6 +11,7 @@ import { OutputDescriptor } from '../models/output-descriptor'; import { EntryModel, Entry, EntryHeader } from '../models/entry'; import { TspClientResponse } from './tsp-client-response'; import { OutputStyleModel } from '../models/styles'; +import { HealthStatus } from '../models/health'; /** * Trace Server Protocol client @@ -301,4 +302,13 @@ export class TspClient { const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/' + outputID + '/style'; return await RestClient.post>(url, parameters); } + + /** + * Check the health status of the server + * @returns The Health Status + */ + public async checkHealth(): Promise> { + const url = this.baseUrl + '/health'; + return RestClient.get(url); + } }