Filesystems API
Filesystem Methods
Filesystems are where files are uploaded and accessed by compute jobs.
- GET /filesystems
Lists all available filesystems.
- Request Headers:
Authorization – API key or Bearer token for user authentication.
- Status Codes:
200 OK – Success. Returns the initialization information if it’s an initialization request.
500 Internal Server Error – Unknown error.
Response Syntax:
[ { "filesystem_id": "string", "filesystem_name": "string" } ]
- Raises:
May raise exceptions related to database operations or service availability.
- POST /filesystems
Creates a new filesystem.
- Request Headers:
Authorization – API key or Bearer token for user authentication
- Status Codes:
200 OK – Success. Returns the initialization information if it’s an initialization request.
400 Bad Request – Bad request.
409 Conflict – Filesystem already exists and was not created.
500 Internal Server Error – Unknown error.
Request Syntax:
{ "filesystem_name": "string" }
Response Syntax:
{ "filesystem_id": "string", "filesystem_name": "string" }
- Raises:
May raise exceptions related to database operations or service availability.
- DELETE /filesystems/<filesystem_id>
Deletes a filesystem and all its contents.
Shares the Filesystem with the specified user.
- GET /filesystems/<filesystem_id>/list/<path:directory>
Lists all files and sub-directories within the specified directory.
- POST /filesystems/<filesystem_id>/mkdir/<path:directory>
Makes a new directory at the specified path.
- GET /filesystems/<filesystem_id>/files/<path:file_path>
Downloads a chunk of a file.
Download a chunk of a file.
- Request Headers:
Authorization – API key or Bearer token for user authentication
Content-Range – Byte range for this file, in the format <START>-<END>
- Status Codes:
200 OK – Success.
403 Forbidden – Requested file path forbidden.
400 Bad Request – Invalid Content-Range header.
500 Internal Server Error – Unknown error occurred during processing.
Pass the query string param ?init=true to obtain the file size and a download_id
- Raises:
May raise exceptions related to database operations or service availability.
- POST /filesystems/<filesystem_id>/files/<path:file_path>
Initialize or complete a multipart upload. Initializations include the size in the request body. Completions include the upload ID and a boolean true/false string in the body.
- Request Headers:
Authorization – API key or Bearer token for user authentication
- Status Codes:
200 OK – Success. Returns the initialization information if it’s an initialization request.
403 Forbidden – Requested file path forbidden.
400 Bad Request – Invalid request body.
500 Internal Server Error – Unknown error occurred during processing.
Request Syntax (Initialize):
{ "size": 123 }
Request Syntax (Complete):
{ "complete": true "uploadId": "string"
}
Response Syntax (Initialize):
{ "uploadId": "string" }
- Raises:
May raise exceptions related to database operations or service availability.
- PUT /filesystems/<filesystem_id>/files/<path:file_path>
Upload a chunk of a file.
- Request Headers:
Authorization – API key or Bearer token for user authentication
Content-Range – Upload ID and byte range for this file, in the format [<UPLOAD_ID>]:<START>-<END>
- Status Codes:
200 OK – Success.
403 Forbidden – Requested file path forbidden.
400 Bad Request – Invalid Content-Range header.
401 Unauthorized – Content-Range doesn’t match length of body.
500 Internal Server Error – Unknown error occurred during processing.
- Raises:
May raise exceptions related to database operations or service availability.
- DELETE /filesystems/<filesystem_id>/files/<path:file_path>
Deletes the specified file from the Filesystem.