Volume API

​

read_volume_file

1
vessl.read_volume_file(
2
volume_id: int, path: str
3
)
Copied!
Read a file in the volume.
Args
  • volume_id (int) : Volume ID.
  • path (str) : Path within the volume.
Example
1
vessl.read_volume_file(
2
volume_id=123456,
3
path="train.csv",
4
)
Copied!
​

list_volume_files

1
vessl.list_volume_files(
2
volume_id: int, need_download_url: bool = False, path: str = '',
3
recursive: bool = False
4
)
Copied!
List files in the volume.
Args
  • volume_id (int) : Volume ID.
  • need_download_url (bool) : True if you need a download URL, False otherwise. Defaults to False.
  • path (str) : Path within the volume. Defaults to root.
  • recursive (bool) : True if list files recursively, False otherwise. Defaults to False.
Example
1
vessl.list_volume_files(
2
volume_id=123456,
3
)
Copied!
​

create_volume_file

1
vessl.create_volume_file(
2
volume_id: int, is_dir: bool, path: str
3
)
Copied!
Create file in the volume.
Args
  • volume_id (int) : Volume ID.
  • is_dir (bool) : True if a file is directory, False otherwise.
  • path (str) : Path within the volume.
Example
1
vessl.create_volume_file(
2
volume_id=123456,
3
is_dir=False,
4
path="models"
5
)
Copied!
​

delete_volume_file

1
vessl.delete_volume_file(
2
volume_id: int, path: str, recursive: bool = False
3
)
Copied!
Delete file in the volume.
Args
  • volume_id (int) : Volume ID.
  • path (str) : Path within the volume.
  • recursive (bool) : True if list files recursively, False otherwise. Defaults to False.
Example
1
vessl.delete_volume_file(
2
volume_id=123456,
3
path="model.pth",
4
)
Copied!
​

upload_volume_file

1
vessl.upload_volume_file(
2
volume_id: int, path: str
3
)
Copied!
Upload file in the volume.
Args
  • volume_id (int) : Volume ID.
  • path (str) : Local file path to upload
Example
1
vessl.upload_volume_file(
2
volume_id=123456,
3
path="model.pth",
4
)
Copied!
​

copy_volume_file

1
vessl.copy_volume_file(
2
source_volume_id: Optional[int], source_path: str,
3
dest_volume_id: Optional[int], dest_path: str, recursive: bool = False,
4
quiet: bool = False
5
)
Copied!
Copy file either from local to remote, remote to local, or remote to remote.
Args
  • source_volume_id (Optional[int]) : Source volume file id. If not specified, source is assumed to be local.
  • source_path (str) : If source_volume_id is empty, local source path. Otherwise, remote source path.
  • dest_volume_id (Optional[int]) : Destination volume file id. If not specified, destination is assumed to be local.
  • dest_path (str) : If dest_volume_id is empty, local destination path. Otherwise, remote destination path.
  • recursive (bool) : True if list files recursively, False otherwise. Only used for remote to remote copy. Defaults to False.
  • quiet (bool) : True if the muted output, False otherwise. Defaults to False.
Example
1
vessl.copy_volume_file(
2
source_volume_id=123456,
3
source_path="model.pth",
4
dest_volume_id=123457,
5
dest_path="model.pth",
6
)
Copied!