Volumes
Retrieves all storage volumes for a specific project.
Args: user_info: Authenticated user information. project: Identifier of the project to list volumes for. region: Optional region filter. include_deleted: When True, includes soft-deleted volumes in the response. Deleted volumes have a non-null deleted_at field. Defaults to False.
Returns: list[VolumeModel]: A list of volume models belonging to the project.
Raises: HTTPException: If project is missing or user is not authorized.
us-central1-afalseSuccessful Response
vol_abc123456us-central1-a2024-01-01T00:00:00Z2024-01-01T00:00:00Z2000proj_abc123456Validation Error
GET /v2/volumes?project=text HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"fid": "vol_abc123456",
"name": "text",
"region": "us-central1-a",
"created_at": "2024-01-01T00:00:00Z",
"deleted_at": "2024-01-01T00:00:00Z",
"capacity_gb": 2000,
"project": "proj_abc123456",
"interface": "Block",
"bids": [
"bid_abc123456"
],
"reservations": [
"res_abc123456"
],
"attachments": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}
]Creates a new storage volume.
Args: user_info: Authenticated user information. body: Request body containing volume creation details (size, region, etc).
Returns: VolumeModel: The created volume model.
Raises: HTTPException: If user unauthorized or creation fails.
Request model for creating a new storage volume.
^[a-z]([-a-z0-9]*[a-z0-9])?$proj_abc123456us-central1-aSuccessful Response
vol_abc123456us-central1-a2024-01-01T00:00:00Z2024-01-01T00:00:00Z2000proj_abc123456Validation Error
POST /v2/volumes HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 107
{
"name": "text",
"project": "proj_abc123456",
"disk_interface": "Block",
"region": "us-central1-a",
"size_gb": null
}{
"fid": "vol_abc123456",
"name": "text",
"region": "us-central1-a",
"created_at": "2024-01-01T00:00:00Z",
"deleted_at": "2024-01-01T00:00:00Z",
"capacity_gb": 2000,
"project": "proj_abc123456",
"interface": "Block",
"bids": [
"bid_abc123456"
],
"reservations": [
"res_abc123456"
],
"attachments": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}Deletes a storage volume.
Permanently removes a volume. The volume must not be currently in use/attached.
Args: user_info: Authenticated user information. volume_fid: Identifier of the volume to delete.
Raises: HTTPException: If volume not found, user unauthorized, or volume is in use.
vol_abc123456Successful Response
No content
Validation Error
DELETE /v2/volumes/{volume_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Updates a storage volume's mutable properties (e.g., name).
Args: user_info: Authenticated user information. volume_fid: Identifier of the volume to update. body: Request body containing updated fields.
Returns: VolumeModel: The updated volume model.
Raises: HTTPException: If volume not found or user unauthorized.
vol_abc123456Request model for updating an existing storage volume.
Attributes: name: New name for the volume. Must follow naming conventions.
^[a-z]([-a-z0-9]*[a-z0-9])?$Successful Response
vol_abc123456us-central1-a2024-01-01T00:00:00Z2024-01-01T00:00:00Z2000proj_abc123456Validation Error
PATCH /v2/volumes/{volume_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"name": "text"
}{
"fid": "vol_abc123456",
"name": "text",
"region": "us-central1-a",
"created_at": "2024-01-01T00:00:00Z",
"deleted_at": "2024-01-01T00:00:00Z",
"capacity_gb": 2000,
"project": "proj_abc123456",
"interface": "Block",
"bids": [
"bid_abc123456"
],
"reservations": [
"res_abc123456"
],
"attachments": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}Last updated