Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Volumes

Get Volumes

get

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
projectstringRequired
regionstring · nullableOptionalExample: us-central1-a
include_deletedbooleanOptionalDefault: false
Responses
200

Successful Response

application/json
fidstringRequiredExample: vol_abc123456
namestringRequired
regionstringRequiredExample: us-central1-a
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deleted_atstring · datetime · nullableRequiredExample: 2024-01-01T00:00:00Z
capacity_gbintegerRequiredExample: 2000
projectstringRequiredExample: proj_abc123456
interfacestring · enumRequiredPossible values:
bidsstring[]Required
reservationsstring[]Required
get/v2/volumes
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"
    }
  }
]

Create Volume

post

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

Request model for creating a new storage volume.

namestring · max: 64RequiredPattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
projectstringRequiredExample: proj_abc123456
disk_interfacestring · enumRequiredPossible values:
regionstringRequiredExample: us-central1-a
size_gbanyRequired
Responses
201

Successful Response

application/json
fidstringRequiredExample: vol_abc123456
namestringRequired
regionstringRequiredExample: us-central1-a
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deleted_atstring · datetime · nullableRequiredExample: 2024-01-01T00:00:00Z
capacity_gbintegerRequiredExample: 2000
projectstringRequiredExample: proj_abc123456
interfacestring · enumRequiredPossible values:
bidsstring[]Required
reservationsstring[]Required
post/v2/volumes
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"
  }
}

Delete Volume

delete

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
volume_fidstringRequiredExample: vol_abc123456
Responses
204

Successful Response

No content

delete/v2/volumes/{volume_fid}
DELETE /v2/volumes/{volume_fid} HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update Volume

patch

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.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
volume_fidstringRequiredExample: vol_abc123456
Body

Request model for updating an existing storage volume.

Attributes: name: New name for the volume. Must follow naming conventions.

namestring · max: 64RequiredPattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
Responses
200

Successful Response

application/json
fidstringRequiredExample: vol_abc123456
namestringRequired
regionstringRequiredExample: us-central1-a
created_atstring · datetimeRequiredExample: 2024-01-01T00:00:00Z
deleted_atstring · datetime · nullableRequiredExample: 2024-01-01T00:00:00Z
capacity_gbintegerRequiredExample: 2000
projectstringRequiredExample: proj_abc123456
interfacestring · enumRequiredPossible values:
bidsstring[]Required
reservationsstring[]Required
patch/v2/volumes/{volume_fid}
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