Resource: cloud.archive_buckets (ArchiveBucketsResource)¶
list(max_results=None, offset=0, sort=None, direction=None, phrase=None, name=None, **filters) -> list[ArchiveBucket]¶
- Endpoint:
GET /api/archives/buckets - Parameters:
- Shared list args
name: archive bucket name filter
- Returns:
list[ArchiveBucket] - Raises: common API exceptions
get(archive_bucket_id: int) -> ArchiveBucket¶
- Endpoint:
GET /api/archives/buckets/{archive_bucket_id} - Returns:
ArchiveBucket - Raises: common API exceptions
get_by_name(name: str) -> ArchiveBucket¶
- Endpoint sequence:
GET /api/archives/buckets?name=<name>&max=1
- Returns:
ArchiveBucket - Raises:
- common API exceptions
NotFoundErrorwhen no match
create(name: str, *, storage_provider_id: int, description=None, visibility="private", is_public=False, account_id=None) -> ArchiveBucket¶
- Endpoint:
POST /api/archives/buckets - Parameters:
name: globally unique archive bucket namestorage_provider_id: linked storage bucket/provider IDdescription: optional descriptionvisibility:privateorpublicis_public: enable anonymous public URL supportaccount_id: optional tenant account override
- Returns:
ArchiveBucket - Raises: common API exceptions
update(archive_bucket_id: int, *, name=None, description=None, visibility=None, is_public=None, account_id=None) -> ArchiveBucket¶
- Endpoint:
PUT /api/archives/buckets/{archive_bucket_id} - Returns:
ArchiveBucket - Raises: common API exceptions
delete(archive_bucket_id: int) -> bool¶
- Endpoint:
DELETE /api/archives/buckets/{archive_bucket_id} - Returns:
True - Raises: common API exceptions
list_files(*, bucket_name: str, remote_path: str | None = None, name: str | None = None, phrase: str | None = None, full_tree: bool | None = None) -> list[ArchiveFile]¶
- Endpoint:
GET /api/archives/buckets/{bucket_name}/files/{remote_path} - Parameters:
bucket_name: archive bucket name (not storage provider name)remote_path: archive path to list (defaults to/)name: exact file name filterphrase: wildcard phrase filterfull_tree: include nested paths
- Returns:
list[ArchiveFile] - Raises: common API exceptions
upload_file(*, bucket_name: str, remote_path: str, local_path: str | Path, filename: str | None = None) -> ArchiveFile¶
- Endpoint:
POST /api/archives/buckets/{bucket_name}/files/{remote_path}(multipart) - Parameters:
bucket_name: destination archive bucket nameremote_path: destination directory pathlocal_path: local file path to uploadfilename: optional destination filename override
- Returns:
ArchiveFile - Raises:
- common API exceptions
FileNotFoundErroriflocal_pathdoes not existValueErrorfor invalid filename (empty, hidden name, spaces, unsupported chars)NotFoundErrorwith enriched message when destination bucket/path does not exist
upload_directory(*, bucket_name: str, remote_path: str, local_directory: str | Path, recursive: bool = True, dry_run: bool = False, strict: bool = False) -> ArchiveDirectoryUploadResult¶
Bulk upload helper with preflight classification.
- Endpoint behavior:
- Local preflight scan/validation
- Multiple
POST /api/archives/buckets/{bucket_name}/files/{destination_remote_path}calls for eligible files
- Parameters:
bucket_name: destination archive bucketremote_path: base destination directorylocal_directory: source directoryrecursive: include nested filesdry_run: only preflight, no uploadsstrict: abort upload phase if preflight has skipped files
- Returns:
ArchiveDirectoryUploadResultwithscanned,eligible,skipped,uploaded,failed, plus per-file details - Raises:
FileNotFoundErroriflocal_directorydoes not existNotADirectoryErroriflocal_directoryis not a directory- Other exceptions are generally captured into
failed_files/skipped_filesentries instead of being raised
download_file(*, bucket_name: str, remote_path: str, local_path: str | Path | None = None) -> bytes | Path¶
- Endpoint:
GET /api/archives/download/{bucket_name}/{remote_path} - Parameters:
local_path: optional save target; when omitted returns bytes in memory
- Returns:
byteswhenlocal_pathisNonePathwhen written to disk
- Raises:
- common API exceptions
- filesystem exceptions if writing to
local_pathfails
copy_file(*, source_bucket_name: str, source_path: str, destination_bucket_name: str, destination_path: str | None = None, destination_filename: str | None = None) -> ArchiveFile¶
Copy helper implemented as download + upload.
- Endpoint sequence:
GET /api/archives/download/{source_bucket_name}/{source_path}POST /api/archives/buckets/{destination_bucket_name}/files/{destination_path or "/"}
- Returns: copied
ArchiveFile - Raises:
- common API exceptions
- any local/file validation exceptions from
download_file(...)orupload_file(...)
get_file(archive_file_id: int) -> ArchiveFile¶
- Endpoint:
GET /api/archives/files/{archive_file_id} - Returns:
ArchiveFile - Raises: common API exceptions
delete_file(archive_file_id: int) -> bool¶
- Endpoint:
DELETE /api/archives/files/{archive_file_id} - Returns:
True - Raises: common API exceptions