adalib.volumes
¶
Adalab Volumes Module
Functions¶
create_volume ¶
create_volume(name, description, size, view_acl_type='public', view_acl_list=[], mount_acl_type='public', mount_acl_list=[], edit_acl_type='public', edit_acl_list=[])
Create a new AdaLab Shared Volume.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the volume. |
required |
description |
str
|
The description of the volume. |
required |
size |
int
|
The size of the volume in GB. |
required |
view_acl_type |
str
|
The ACL type for viewing the volume. Default is "public". |
'public'
|
view_acl_list |
list[str]
|
The list of users or groups that can view the volume. |
[]
|
mount_acl_type |
str
|
The ACL type for mounting the volume. Default is "public". |
'public'
|
mount_acl_list |
list[str]
|
The list of users or groups that can mount the volume. |
[]
|
edit_acl_type |
str
|
The ACL type for editing the volume. Default is "public". |
'public'
|
edit_acl_list |
list[str]
|
The list of users or groups that can edit the volume. |
[]
|
Returns:
Type | Description |
---|---|
int
|
The ID of the created volume. |
Source code in adalib/volumes/volumes.py
delete_volume ¶
Delete an AdaLab Shared Volume.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
volume_id |
int
|
The ID of the volume to delete. |
required |
Returns:
Type | Description |
---|---|
Response
|
The response from the request. |
Source code in adalib/volumes/volumes.py
get_all_volume_mounts_for_app ¶
Get all AdaLab Shared Volumes mounted to a specific AdaLab App.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app_id |
str
|
The ID of the AdaLab App. |
required |
Returns:
Type | Description |
---|---|
list[dict[str,]]
|
List of AdaLab Shared Volume mounts to the AdaLab App. |
Source code in adalib/volumes/volumes.py
get_all_volume_mounts_for_user ¶
Get all AdaLab Shared Volumes mounted to a specific AdaLab User's Lab.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_id |
Optional[str]
|
The ID of the AdaLab User. |
None
|
Returns:
Type | Description |
---|---|
list[dict[str,]]
|
List of AdaLab Shared Volume mounts to the AdaLab User's Lab. |
Source code in adalib/volumes/volumes.py
get_all_volumes ¶
Get all AdaLab Shared Volumes currently available.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_all |
bool
|
If True, return all volumes. If False, return only volumes that the user is allowed to view. |
False
|
allowed_to_mount |
bool
|
If True, return only volumes that the user is allowed to mount. If False, return all volumes. |
True
|
Returns:
Type | Description |
---|---|
list[dict[str,]]
|
List of AdaLab Shared Volumes. |
Source code in adalib/volumes/volumes.py
get_volume ¶
Get a specific AdaLab Shared Volume.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
volume_id |
int
|
The ID of the volume to get. |
required |
Returns:
Type | Description |
---|---|
dict[str,]
|
The AdaLab Shared Volume. |
Source code in adalib/volumes/volumes.py
mount_volume_to_user_lab ¶
Create a new AdaLab Shared Volume mount to a specific AdaLab User's Lab.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
volume_id |
int
|
The ID of the volume to mount. |
required |
mount_path |
str
|
The path to mount the volume to. |
required |
user_id |
Optional[str]
|
The ID of the AdaLab User. If None, the current user is used. |
None
|
read_only |
bool
|
If True, mount the volume as read-only. Default is False. |
False
|
from_root |
bool
|
If True, mount the volume from the root. Default is False. |
False
|
Returns:
Type | Description |
---|---|
Response
|
The response from the request. |
Source code in adalib/volumes/volumes.py
unmount_volume_from_user_lab ¶
Unmount an AdaLab Shared Volume from a specific AdaLab User's Lab.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
volume_id |
int
|
The ID of the volume to unmount. |
required |
user_id |
Optional[str]
|
The ID of the AdaLab User. If None, the current user is used. |
None
|
Returns:
Type | Description |
---|---|
Response
|
The response from the request. |
Source code in adalib/volumes/volumes.py
update_mounted_volume_to_user_lab ¶
update_mounted_volume_to_user_lab(volume_id, user_id=None, mount_path=None, read_only=False, from_root=False)
Update an AdaLab Shared Volume mount to a specific AdaLab User's Lab.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
volume_id |
int
|
The ID of the volume to update. |
required |
user_id |
Optional[str]
|
The ID of the AdaLab User. If None, the current user is used. |
None
|
mount_path |
Optional[str]
|
The new path to mount the volume to. |
None
|
read_only |
bool
|
If True, mount the volume as read-only. Default is False. |
False
|
from_root |
bool
|
If True, mount the volume from the root. Default is False. |
False
|
Returns:
Type | Description |
---|---|
Response
|
The response from the request. |
Source code in adalib/volumes/volumes.py
update_volume ¶
update_volume(volume_id, name=None, description=None, size=None, view_acl_type=None, view_acl_list=[], mount_acl_type=None, mount_acl_list=[], edit_acl_type=None, edit_acl_list=[])
Update an AdaLab Shared Volume.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
volume_id |
int
|
The ID of the volume to update. |
required |
name |
Optional[str]
|
The new name of the volume. |
None
|
description |
Optional[str]
|
The new description of the volume. |
None
|
size |
Optional[int]
|
The new size of the volume in GB. |
None
|
view_acl_type |
Optional[str]
|
The new ACL type for viewing the volume. |
None
|
view_acl_list |
list[str]
|
The new list of users or groups that can view the volume. |
[]
|
mount_acl_type |
Optional[str]
|
The new ACL type for mounting the volume. |
None
|
mount_acl_list |
list[str]
|
The new list of users or groups that can mount the volume. |
[]
|
edit_acl_type |
Optional[str]
|
The new ACL type for editing the volume. |
None
|
edit_acl_list |
list[str]
|
The new list of users or groups that can edit the volume. |
[]
|
Returns:
Type | Description |
---|---|
Response
|
The response from the request. |
Source code in adalib/volumes/volumes.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
|