liara_create_disk
Add storage capacity to applications by creating and mounting disks with specified size and path.
Instructions
Create a new disk for an app
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appName | Yes | The name of the app | |
| name | Yes | Disk name | |
| size | Yes | Disk size in GB | |
| mountPath | Yes | Mount path for the disk |
Implementation Reference
- src/services/disks.ts:53-71 (handler)The main handler function that implements the logic for creating a disk on Liara for a given app/project. It validates inputs and makes a POST request to the Liara API.export async function createDisk( client: LiaraClient, appName: string, request: CreateDiskRequest ): Promise<Disk> { validateAppName(appName); validateRequired(request.name, 'Disk name'); validateRequired(request.size, 'Disk size'); validateRequired(request.mountPath, 'Mount path'); if (request.size <= 0) { throw new Error('Disk size must be greater than 0'); } return await client.post<Disk>( `/v1/projects/${appName}/disks`, request ); }
- src/api/types.ts:251-255 (schema)TypeScript interface defining the input parameters for the createDisk tool: disk name, size in GB, and mount path.export interface CreateDiskRequest { name: string; size: number; mountPath: string; }
- src/api/types.ts:242-249 (schema)TypeScript interface defining the output/response structure for disk objects returned by the API.export interface Disk { _id: string; name: string; projectID: string; size: number; // in GB mountPath: string; createdAt: string; }