anatools.anaclient.volumes module¶
Volumes Functions
- add_volume_access(self, volumeId, organizationId, permission=None)¶
Grant access for current organization’s managed volume to another organization.
- Parameters:
volumeId (str) – VolumeId to add access for.
organizationId (str) – Organization ID to add access
permission (str) – Permission level to grant to organization. Choose from: read, write, or view.
- Returns:
Status True or False
- Return type:
str
- create_managed_volume(self, name, description=None, organizationId=None)¶
Creates a new volume with the specified name in the organization. By default the permission on the volume is set to write.
- Parameters:
name (str) – The name of the new volume. Note: this name needs to be unique per organization.
description (str) – Description of the volume
organizationId (str) – The ID of the organization that the managed volume will belong to.
- Returns:
volumeId
- Return type:
str
- delete_managed_volume(self, volumeId)¶
Removes the volume from the organization. Note that this will delete any remote data in the volume and channels that rely on this volume will need to be updated.
- Parameters:
volumeId (str) – The ID of a specific Volume to delete.
- Returns:
Status
- Return type:
str
- delete_volume_data(self, volumeId, files=[])¶
Delete data from a volume.
- Parameters:
volumeId (str) – VolumeId to delete files from.
files (str) – The specific files to delete from the volume. If left empty, no files are deleted.
- Returns:
Status
- Return type:
str
- download_volume_data(self, volumeId, files=[], localDir=None, sync=False)¶
Download data from a volume.
- Parameters:
volumeId (str) – VolumeId to download data of.
files (str) – The specific files or directories to retrieve from the volume, if you wish to retrieve all then leave the list empty.
localDir (str) – The location of the local directory to download the files to. If not specified, this will download the files to the current directory.
sync (bool) – Recursively downloads new and updated files from the source to the destination. Only creates folders in the destination if they contain one or more files.
- Returns:
Status
- Return type:
str
- edit_managed_volume(self, volumeId, name=None, description=None, permission=None)¶
Edits the volume in your current organization.
- Parameters:
volumeId (str) – The volumeId that will be updated.
name (str) – The new name of the new volume. Note: this name needs to be unique per organization.
description (str) – Description of the volume
permission (str) – Permission to set for the volume. Choose from: read, write, or view.
- Returns:
Status True or False
- Return type:
str
- get_managed_volumes(self, volumeId=None, organizationId=None)¶
Retrieves the managed volumes for an organization.
- Parameters:
volumeId (str) – The ID of a specific Volume.
organizationId (str) – The ID of the organization that the managed volume belongs to.
- Returns:
Volume Info
- Return type:
list[dict]
- get_volume_data(self, volumeId, files=[], dir='')¶
Retrieves information about data from a volume.
- Parameters:
volumeId (str) – VolumeId to remove access to.
files (str) – The specific files or directories to retrieve information about from the volume, if you wish to retrieve all then leave the list empty.
dir (str) – Specific volume directory to retrieve information about. Optional.
- Returns:
Status
- Return type:
str
- get_volumes(self, volumeId=None, organizationId=None)¶
Retrieves all volumes the user has access to.
- Parameters:
volumeId (str) – The ID of a specific Volume.
organizationId (str) – The ID of the organization that the volume belongs to.
- Returns:
Volume Info
- Return type:
list[dict]
- mount_volumes(self, volumes)¶
Retrieves credentials for mounting volumes.
- Parameters:
volumes ([str]) – Volumes to retrieve mount credentials for.
- Returns:
Credential information.
- Return type:
dict
- remove_volume_access(self, volumeId, organizationId)¶
Remove access to a volume for an organization.
- Parameters:
volumeId (str) – VolumeId to remove access to.
organizationId (str) – Organization ID to remove access.
- Returns:
Status
- Return type:
str
- upload_volume_data(self, volumeId, files=[], localDir=None, sync=False)¶
Upload data to a volume.
- Parameters:
volumeId (str) – VolumeId to upload data to.
files (list[str]) – The specific files or directories to push to the volume from the localDir. If you wish to push all data in the root directory, then leave the list empty.
localDir (str) – The location of the local directory to upload the files from. If not specified, this will try to upload the files from the current directory.
sync (bool) – Recursively uploads new and updated files from the source to the destination. Only creates folders in the destination if they contain one or more files.
- Returns:
Status
- Return type:
str