feat: manual health check

This commit is contained in:
Nicolas Meienberger
2025-09-27 11:09:19 +02:00
parent 082192f38a
commit 7154dcdbac
9 changed files with 142 additions and 7 deletions

View File

@@ -25,6 +25,9 @@ import type {
UnmountVolumeData,
UnmountVolumeResponses,
UnmountVolumeErrors,
HealthCheckVolumeData,
HealthCheckVolumeResponses,
HealthCheckVolumeErrors,
} from "./types.gen";
import { client as _heyApiClient } from "./client.gen";
@@ -162,3 +165,15 @@ export const unmountVolume = <ThrowOnError extends boolean = false>(
...options,
});
};
/**
* Perform a health check on a volume
*/
export const healthCheckVolume = <ThrowOnError extends boolean = false>(
options: Options<HealthCheckVolumeData, ThrowOnError>,
) => {
return (options.client ?? _heyApiClient).post<HealthCheckVolumeResponses, HealthCheckVolumeErrors, ThrowOnError>({
url: "/api/v1/volumes/{name}/health-check",
...options,
});
};