File size: 2,914 Bytes
76d9c4f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
---
title: Volume
version: EN
---

### read_volume_file
```python
vessl.read_volume_file(
   volume_id: int, path: str
)
```
Read a file in the volume.

**Args**
* `volume_id` (int) : Volume ID.
* `path` (str) : Path within the volume.

**Example**
```python
vessl.read_volume_file(
    volume_id=123456,
    path="train.csv",
)
```

----

## list_volume_files
```python
vessl.list_volume_files(
   volume_id: int, need_download_url: bool = False, path: str = '',
   recursive: bool = False
)
```
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**
```python
vessl.list_volume_files(
    volume_id=123456,
)
```

----

## create_volume_file
```python
vessl.create_volume_file(
   volume_id: int, is_dir: bool, path: str
)
```
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**
```python
vessl.create_volume_file(
    volume_id=123456,
    is_dir=False,
    path="models"
)
```

----

## delete_volume_file
```python
vessl.delete_volume_file(
   volume_id: int, path: str
)
```
Delete file in the volume.

**Args**
* `volume_id` (int) : Volume ID.
* `path` (str) : Path within the volume.

**Example**
```python
vessl.delete_volume_file(
    volume_id=123456,
    path="model.pth",
)
```

----

## upload_volume_file
```python
vessl.upload_volume_file(
   volume_id: int, path: str
)
```
Upload file in the volume.

**Args**
* `volume_id` (int) : Volume ID.
* `path` (str) : Local file path to upload

**Example**
```python
vessl.upload_volume_file(
    volume_id=123456,
    path="model.pth",
)
```

----

## copy_volume_file
```python
vessl.copy_volume_file(
   source_volume_id: Optional[int], source_path: str,
   dest_volume_id: Optional[int], dest_path: str, quiet: bool = False
)
```
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.
* `quiet` (bool) : True if the muted output, False otherwise. Defaults to
    False.

**Example**
```python
vessl.copy_volume_file(
    source_volume_id=123456,
    source_path="model.pth",
    dest_volume_id=123457,
    dest_path="model.pth",
)
```