mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: display containers using the volume
This commit is contained in:
@@ -16,6 +16,9 @@ import type {
|
||||
UpdateVolumeData,
|
||||
UpdateVolumeResponses,
|
||||
UpdateVolumeErrors,
|
||||
GetContainersUsingVolumeData,
|
||||
GetContainersUsingVolumeResponses,
|
||||
GetContainersUsingVolumeErrors,
|
||||
MountVolumeData,
|
||||
MountVolumeResponses,
|
||||
MountVolumeErrors,
|
||||
@@ -122,6 +125,22 @@ export const updateVolume = <ThrowOnError extends boolean = false>(
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Get containers using a volume by name
|
||||
*/
|
||||
export const getContainersUsingVolume = <ThrowOnError extends boolean = false>(
|
||||
options: Options<GetContainersUsingVolumeData, ThrowOnError>,
|
||||
) => {
|
||||
return (options.client ?? _heyApiClient).get<
|
||||
GetContainersUsingVolumeResponses,
|
||||
GetContainersUsingVolumeErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/v1/volumes/{name}/containers",
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Mount a volume
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user