anatools.anaclient.anaclient module¶
The client module is used for connecting to Rendered.ai’s Platform API.
- class client(workspaceId=None, environment='prod', email=None, password=None, local=False, interactive=True, verbose=None)¶
Bases:
object
- add_channel_access(channelId, organizationId)¶
Add access to a channel for an organization.
- Parameters:
channelId (str) – Id of channel to add access for.
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns:
Access status.
- Return type:
str
- add_gan_organization(modelId, organizationId)¶
Add access to a map for an organization.
- Parameters:
modelId (str) – ModelId to add access for.
organizationId (str) – Organization ID to add access
- Returns:
Status
- Return type:
bool
- add_map_organization(mapId, organizationId)¶
Add access to a map for an organization.
- Parameters:
mapId (str) – MapId to add access for.
organizationId (str) – Organization ID to add access
- Returns:
Status
- Return type:
bool
- add_organization_member(email, role, organizationId=None)¶
Add a user to an existing organization.
- Parameters:
email (str) – Email of user to add.
role (str) – Role for user.
organizationId (str) – Organization ID to add members too. Uses current if not specified.
- Returns:
Response status if user got added to workspace succesfully.
- Return type:
str
- add_volume_access(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
- add_workspace_guest(email, workspaceId=None)¶
Add a guest to an existing workspace.
- Parameters:
email (str) – Email of guest to add.
workspaceId (str) – Workspace ID to add a guest to. Uses current if not specified.
- Returns:
Response status if guest got added to workspace succesfully.
- Return type:
str
- build_managed_channel(channelfile, enforce_size_limit=True)¶
Build the Docker image of a channel.
- Parameters:
channelfile (str) – The channel file for the channel to build.
enforce_size_limit (bool) – Flag that controls the size of the Docker Image and will block the build if larger than 7.5GB. Set this to False if the channel will be larger than 7.5GB.
- Returns:
A boolean that indicates if the channel Docker image was successfully built.
- Return type:
bool
- cancel_dataset(datasetId, workspaceId=None)¶
Stop a running job.
- Parameters:
datasetId (str) – Dataset ID of the running job to stop.
workspaceId (str) – Workspace ID of the running job. If none is provided, the default workspace will get used.
- Returns:
Success or error message about stopping the job execution.
- Return type:
str
- check_logout()¶
- create_analytics(datasetId, type, range=[], images=True, workspaceId=None)¶
Generate analytics for a dataset.
- Parameters:
datasetId (str) – Dataset ID to download image annotation for.
type (str) – The type of analytics to generate. Choose one from the list that get_analytics_types method returns.
range (list[int]) – The range of runs to generate analytics for.
images (bool) – If true, images specific to the analytics type will be created along with metrics data.
workspaceId (str) – Workspace ID of the dataset to generate the analytics for. If none is provided, the current workspace will get used.
- Returns:
The analyticsId for the analytics job.
- Return type:
str
- create_annotation(datasetId, format, map, workspaceId=None)¶
Generates annotations for an existing dataset.
- Parameters:
datasetId (str) – Dataset ID to generate annotation for.
format (str) – Annotation format. Call get_annotation_formats() to find supported formats.
map (str) – The map file used for annotations. Call get_annotation_maps() to find supported maps.
workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.
- Returns:
The annotationsId for the annotation job.
- Return type:
str
- create_dataset(name, graphId, description='', runs=1, priority=1, seed=1, workspaceId=None)¶
Create a new dataset based off an existing staged graph. This will start a new job.
- Parameters:
name (str) – Name for dataset.
graphId (str) – ID of the staged graph to create dataset from.
description (str) – Description for new dataset.
runs (int) – Number of times a channel will run within a single job. This is also how many different images will get created within the dataset.
priority (int) – Job priority.
seed (int) – Seed number.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.
- Returns:
Success or failure message about dataset creation.
- Return type:
str
- create_gan_dataset(modelId, datasetId, workspaceId=None)¶
Create a new GAN dataset based off an existing dataset. This will start a new job.
- Parameters:
modelId (str) – Model ID to use for the GAN.
datasetId (str) – Dataset ID to input into the GAN.
workspaceId (str) – Workspace ID where the dataset exists.
- Returns:
The datsetId for the GAN Dataset job.
- Return type:
str
- create_managed_channel(name, description=None, organizationId=None, volumes=[], instance='p2.xlarge', timeout=120, interfaceVersion=1)¶
Create a managed channel for your organization.
- Parameters:
name (str) – Channel name.
description (str) – Description of the channel
organizationId (str) – Organization ID. Defaults to current if not specified.
volumes (list[str]) – List of the data volume names to associate with this channel.
instance (str) – AWS Instance type.
timeout (int) – Maximum runtime of a channel run.
interface (int) – The ana interface version number.
- Returns:
channel data
- Return type:
list[dict]
- create_managed_gan(name, description, modelfile, flags=None, organizationId=None)¶
Uploades a GAN model to the microservice. The model will be owned by the specified organization. If organizationId is not given the model will be owned by that of the analcient.
- Parameters:
name (str) – A name for model.
description (str) – Details about the model.
modelfile (str) – The file of the model - relative to the local directry.
flags (str) – Parameters for use when running the model.
organizationId (str) – Id of organization that owns the model, that of the anaclient if not given.
- Returns:
modleId – The unique identifier for this model.
- Return type:
str
- create_managed_map(name, description, mapfile, organizationId=None)¶
Uploades an annotation map to the microservice. The map will be owned by the specified organization. If not organizationId is given the model will be owned by that of the analcient.
- Parameters:
name (str) – A name for map.
description (str) – Details about the map.
mapfile (str) – The map file - relative to the local directry.
organizationId (str) – Id of organization that owns the map, that of the anaclient if not given.
- Returns:
mapId – The unique identifier for this map.
- Return type:
str
- create_managed_volume(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
- create_staged_graph(name, channelId, graph, description=None, workspaceId=None)¶
Generates a new staged graph based off provided parameters. Must provide valid json string to create a new staged graph.
- Parameters:
name (str) – Name for the that will get generated.
channelId (str) – Id of channel to generate the staged graph with.
graph (str) – The graph as a dictionary or JSON string. While YAML files are used in channel development, the Platform SDK and API only support JSON. Ensure that the YAML file is valid in order for the yaml.safe_load to convert YAML to a dictionary for you. Otherwise, provide a graph in JSON format.
description (str) – Description of staged graph. Optional.
workspaceId (str) – Workspace ID create the staged graph in. If none is provided, the default workspace will get used.
- Returns:
The staged graph id if it was created sucessfully or an error message.
- Return type:
str
- create_umap(datasetIds, samples, workspaceId=None)¶
Creates a UMAP dataset comparison job on the platform.
- Parameters:
datasetIds ([str]) – Dataset ID to retrieve information for.
samples ([int]) – Samples to take from each dataset.
workspaceId (str) – Workspace ID where the datasets exists.
- Returns:
The UMAP Job ID.
- Return type:
str
- create_workspace(name, channelIds=[], volumeIds=[], code=None)¶
Create a new workspace with specific channels.
- Parameters:
name (str) – New workspace name.
channelIds (list[str]) – List of channel ids to add to workspace.
volumeIds (list[str]) – List of volume ids that the workspace will have access to.
code (str) – Content code that used for creating a workspace
- Returns:
Workspace ID if creation was successful. Otherwise returns message.
- Return type:
str
- delete_analytics(analyticsId, workspaceId=None)¶
Deletes a dataset’s analytics.
- Parameters:
analyticsId (str) – Analytics ID for the analytics to delete.
workspaceId (str) – Workspace ID where the analytics exist. If none is provided, the current workspace will get used.
- Returns:
If true, successfully deleted the analytics.
- Return type:
bool
- delete_annotation(annotationId, workspaceId=None)¶
Delete a dataset annotation.
- Parameters:
annotationId (str) – AnnoationId of the annotation job.
workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.
- Returns:
If true, successfully deleted the annotation.
- Return type:
bool
- delete_dataset(datasetId, workspaceId=None)¶
Delete an existing dataset.
- Parameters:
datasetId (str) – Dataset ID of dataset to delete.
workspaceId (str) – Workspace ID that the dataset is in. If none is provided, the current workspace will get used.
- Returns:
Success or failure message about dataset deletion.
- Return type:
str
- delete_gan_dataset(datasetId, workspaceId=None)¶
Deletes a GAN dataset job.
- Parameters:
datasetId (str) – Dataset ID for the GAN dataset.
workspaceId (str) – Workspace ID where the dataset exists.
- Returns:
Returns true if the GAN dataset was successfully deleted.
- Return type:
bool
- delete_gan_model(modelId)¶
Delete the GAN model and remove access to it from all shared organizations. This can only be done by a user in the organization that owns the model.
- Parameters:
modelId (str) – The ID of a specific GAN model.
- Returns:
Status
- Return type:
str
- delete_managed_channel(channelId)¶
Delete a managed channel of your organization.
- Parameters:
channelId (str) – Id of channel to delete.
- Returns:
Status
- Return type:
str
- delete_managed_gan(modelId)¶
Removes the managed map
- Parameters:
modelId (str) – The ID of a specific Model to delete.
- Returns:
Status
- Return type:
bool
- delete_managed_map(mapId)¶
Removes the managed map
- Parameters:
mapId (str) – The ID of a specific Map to delete.
- Returns:
Status
- Return type:
bool
- delete_managed_volume(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_staged_graph(graphId, workspaceId=None)¶
Delete a staged graph in a workspace.
- Parameters:
graphId (str) – Staged Graph id to delete.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.
- Returns:
A success or error message based on staged graph’s delete.
- Return type:
str
- delete_umap(umapId, workspaceId=None)¶
Deletes/cancels a UMAP dataset comparison on the platform.
- Parameters:
umapId (str) – UMAP Job ID.
workspaceId (str) – Workspace ID where the datasets exists.
- Returns:
Status.
- Return type:
bool
- delete_volume_data(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
- delete_workspace(workspaceId=None, prompt=True)¶
Delete an existing workspace.
- Parameters:
workspaceId (str) – Workspace ID for workspace to get deleted. Deletes current workspace if not specified.
prompt (bool) – Set to True if avoiding prompts for deleting workspace.
- Returns:
Success or failure message if workspace was sucessfully removed.
- Return type:
str
- deploy_managed_channel(channelId=None, channelfile=None, image=None, enforce_size_limit=True)¶
Deploy the Docker image of a channel.
- Parameters:
channelId (str) – Channel ID that you are pushing the image to. If the channelId isn’t specified, it will use the image name to lookup the channelId.
channelfile (str) – Name of the channel file to look for.
image (str) – The Docker image name. This should match the channel name when running ana. If image is not specified, it will use the channel name for the channelId.
enforce_size_limit (bool) – Flag that controls the size of the Docker Image and will block the build if larger than 7.5GB. Set this to False if the channel will be larger than 7.5GB.
- Returns:
deploymentId for current round of deployment or an error message if something went wrong
- Return type:
str
- download_annotation(datasetId, annotationId, workspaceId=None)¶
Downloads annotations archive.
- Parameters:
datasetId (str) – Dataset ID to download image annotation for.
annotationId (str) – Id of previously generated image annotation.
workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.
- Returns:
The name of the archive file that got downloaded.
- Return type:
str
- download_dataset(datasetId, workspaceId=None, localDir=None)¶
Download a dataset.
- Parameters:
datasetId (str) – Dataset ID of dataset to download.
workspaceId (str) – Workspace ID that the dataset is in. If none is provided, the default workspace will get used.
localDir (str) – Path for where to download the dataset. If none is provided, current working directory will be used.
- Returns:
Success or failure message about dataset download.
- Return type:
str
- download_managed_gan(modelId, localDir=None)¶
Download the managed gan model file from your organization.
- Parameters:
modelId (str) – ModelId to download.
localDir (str) – Path for where to download the gan model. If none is provided, current working directory will be used.
- Returns:
The name of the managed gan model that got downloaded.
- Return type:
str
- download_managed_map(mapId, localDir=None)¶
Download the managed annotation map file from your organization.
- Parameters:
mapId (str) – MapId to download.
localDir (str) – Path for where to download the managed annotation map. If none is provided, current working directory will be used.
- Returns:
The name of the managed map file that got downloaded.
- Return type:
str
- download_staged_graph(graphId, workspaceId=None)¶
Download a staged graph.
- Parameters:
graphId (str) – Graph ID of the staged graph to download.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the default workspace will get used.
- Returns:
A download URL that can be used in the browser or a failure message.
- Return type:
str
- download_volume_data(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_dataset(datasetId, description=None, name=None, workspaceId=None)¶
Update dataset description.
- Parameters:
datasetId (str) – Dataset ID to update description for.
description (str) – New description.
name (str) – New name for dataset.
workspaceId (str) – Workspace ID of the dataset to get updated. If none is provided, the current workspace will get used.
- Returns:
Success or failure message about dataset update.
- Return type:
str
- edit_managed_channel(channelId, name=None, description=None, volumes=None, instance=None, timeout=None, status=None, interfaceVersion=None)¶
Edit a managed channel for your organization.
- Parameters:
channelId (str) – ChannelId ID of the channel to edit.
name (name) – The new name to give the channel.
description (str) – Description of the channel
volumes (list[str]) – Data volumes for the channel.
instance (str) – Instance type to run the channel on.
timeout (int) – Maximum runtime for the channel run.
status (str) – The status of the channel.
interface (int) – The ana interface version number.
- Returns:
If true, the channel was successfully edited.
- Return type:
bool
- edit_managed_gan(modelId, name=None, description=None, flags=None)¶
Edits the name, description, and flags of a managed gan.
- Parameters:
modelId (str) – The modelId that will be updated.
name (str) – The new name of the managed gan. Note: this name needs to be unique per organization.
description (str) – Description of the managed gan
flags (str) – Flags for the model
- Returns:
Status
- Return type:
bool
- edit_managed_map(mapId, name=None, description=None)¶
Edits the name of a managed map.
- Parameters:
mapId (str) – The mapId that will be updated.
name (str) – The new name of the managed map. Note: this name needs to be unique per organization.
description (str) – Description of the managed map
- Returns:
Status
- Return type:
bool
- edit_managed_volume(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
- edit_organization(name, organizationId=None)¶
Update the organization name. Uses current organization if no organizationId provided.
- Parameters:
name (str) – Name to update organization to.
organizationId (str) – Organization Id to update.
- Returns:
True if organization was edited successfully, False otherwise.
- Return type:
bool
- edit_organization_member(email, role, organizationId=None)¶
Edit a member’s role.
- Parameters:
email (str) – Member email to edit.
role (str) – Role to assign.
organizationId (str) – Organization ID to remove member from. Edits member in current organization if not specified.
- Returns:
Response if member got edited succesfully.
- Return type:
str
- edit_staged_graph(graphId, description=None, name=None, workspaceId=None)¶
Update staged graph description and name.
- Parameters:
graphId (str) – Staged Graph id to update.
description (str) – New description to update.
name (str) – New name to update.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.
- Returns:
A success or error message based on staged graph’s update.
- Return type:
str
- edit_workspace(name=None, channelIds=None, volumeIds=None, ganIds=None, mapIds=None, workspaceId=None)¶
Edit workspace information.
- Parameters:
name (str) – New name to replace old one.
channelIds (list[str]) – Names of channels that the workspace will have access to.
volumeIds (list[str]) – List of volume ids that the workspace will have access to.
ganIds (list[str]) – List of GAN ids that the workspace will have access to.
mapIds (list[str]) – List of map ids that the workspace will have access to.
workspaceId (str) – Workspace ID for workspace to update.
- Returns:
Success or failure message if workspace was sucessfully updated.
- Return type:
bool
- get_analytics(analyticsId, workspaceId=None)¶
Retrieve information about a specific analytics job. If an analytics job is of type objectMetrics or meanBrightness, then images will get downloaded to current working directory.
- Parameters:
analyticsId (str) – Analytics Job ID.
workspaceId (str) – Workspace ID where the analytics exist. If none is provided, the current workspace will get used.
- Returns:
Analytics job information.
- Return type:
list[dict]
- get_analytics_types()¶
Retrieve the analytics types available on the Platform.
- Returns:
The analytics types available on the Platform.
- Return type:
list[str]
- get_annotation_formats()¶
Retrieves the annotation formats supported by the Platform.
- Returns:
The annotation formats supported by the Platform.
- Return type:
str
- get_annotation_maps(organizationId=None, workspaceId=None, mapId=None)¶
Retrieves annotation maps.
- Parameters:
organizationId (str) – Organization ID to retrieve maps for. If not specified then the current organization is used.
workspaceId (str) – Workspace ID to retrieve maps for. If not specified then the current workspace is used.
mapId (str) – Annotation map ID to retrieve
- Returns:
The requested annotation maps.
- Return type:
str
- get_annotations(datasetId=None, annotationId=None, workspaceId=None)¶
Retrieve information about existing annotations generated for a dataset. Querying requires both datasetId and annotationId.
- Parameters:
datasetId (str) – Dataset ID to generate annotations for.
annotationId (str) – Annotation ID for a specific annotations job.
workspaceId (str) – Workspace ID where the annotations exist. If none is provided, the current workspace will get used.
- Returns:
Annotation information.
- Return type:
list[dict]
- get_channel_documentation(channelId, localDir=None)¶
Downloads a markdown file for channel documentation.
- Parameters:
channelID (str) – The channelId of the channel
localDir (str) – The location to download the file to.
- Returns:
The list of filenames downloaded.
- Return type:
list[str]
- get_channels(organizationId=None, workspaceId=None, channelId=None)¶
Shows all channels available to the user. Can filter by organizationId, workspaceId, or channelId.
- Parameters:
organizationId (str) – Filter channel list on what’s available to the organization.
workspaceId (str) – Filter channel list on what’s available to the workspace.
channelId (str) – Filter channel list on the specific channelId.
- Returns:
List of channels associated with user, workspace, organization or channelId.
- Return type:
list[dict]
- get_dataset_log(datasetId, runId, saveLogFile=False, workspaceId=None)¶
Shows dataset log information to the user.
- Parameters:
datasetId (str) – The dataset the run belongs to.
runId (str) – The run to retrieve the log for.
saveLogFile (bool) – If True, saves log file to current working directory.
workspaceId (str) – The workspace the run belongs to.
- Returns:
Get log information by runId
- Return type:
list[dict]
- get_dataset_runs(datasetId, state=None, workspaceId=None)¶
Shows all dataset run information to the user. Can filter by state.
- Parameters:
datasetId (str) – The dataset to retrieve logs for.
state (str) – Filter run list by status.
workspaceId (str) – The workspace the dataset is in.
- Returns:
List of run associated with datasetId.
- Return type:
list[dict]
- get_datasets(datasetId=None, name=None, email=None, workspaceId=None)¶
Queries the workspace datasets based off provided parameters. Checks on datasetId, name, owner in this respective order within the specified workspace. If only workspace ID is provided, this will return all the datasets in a workspace.
- Parameters:
datasetId (str) – Dataset ID to filter.
name (str) – Dataset name.
email (str) – Owner of the dataset.
workspaceId (str) – Workspace ID of the dataset’s workspace. If none is provided, the current workspace will get used.
- Returns:
Information about the dataset based off the query parameters provided or a failure message.
- Return type:
str
- get_default_graph(channelId)¶
Gets the default graph for a channel.
- Parameters:
channelId – Id of channel to get the default graph for.
- Returns:
json data representing the graph.
- Return type:
json
- get_deployment_status(deploymentId, stream=False)¶
Retrieves status for a channel’s deployment.
- Parameters:
deploymentId (str) – The deploymentId to retrieve status for
stream (bool) – Flag to print information to the terminal so the user can avoid constant polling to retrieve status.
- Returns:
Deployment status.
- Return type:
list[dict]
- get_gan_dataset(datasetId, workspaceId=None)¶
Retrieve information about GAN dataset jobs.
- Parameters:
datasetId (str) – Dataset ID to retrieve information for.
workspaceId (str) – Workspace ID where the dataset exists.
- Returns:
Information about the GAN Dataset.
- Return type:
list[dict]
- get_gan_models(organizationId=None, workspaceId=None, modelId=None)¶
Retrieve information about GAN models
- Parameters:
organizationId (str) – Organization ID that owns the models
workspaceId (str) – Workspace ID that contains the models
modelId (str) – Model ID to retrieve information for.
- Returns:
GAN Model information.
- Return type:
list[dict]
- get_managed_channels(channelId=None, organizationId=None)¶
Get information for all managed channels that you own within your organization.
- Parameters:
channelId (str) – Channel Id to filter.
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns:
channel data
- Return type:
list[dict]
- get_managed_gans(organizationId=None, modelId=None)¶
Retrieves the managed GANs for an organization.
- Parameters:
organizationId (str) – The ID of the organization that the managed GAN belongs to.
modelId (str) – The ID of a specific model.
- Returns:
Model Info
- Return type:
list[dict]
- get_managed_maps(organizationId=None, mapId=None)¶
Retrieves the map(s) managed by the organization
- Parameters:
organizationId (str) – Organization ID to retrieve maps for. If not specified then the current organization is used.
mapId (str) – Annotation map ID to retrieve
- Returns:
The requested annotation maps.
- Return type:
str
- get_managed_volumes(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_organization()¶
Get organization id of current organization.
- Returns:
Organization ID of current workspace.
- Return type:
str
- get_organization_invites(organizationId=None)¶
Get invitations of an organization optionally filtered on workspace.
- Parameters:
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns:
Information about invitations of an organization.
- Return type:
list[dict]
- get_organization_limits(organizationId=None, setting=None)¶
Get information about Organization limits and setting.
- Parameters:
organizationId (str) – Organization ID. Defaults to current if not specified.
setting (str) – Setting name.
- Returns:
Organization limit information.
- Return type:
list[dict]
- get_organization_members(organizationId=None)¶
Get users of an organization optionally filtered on workspace.
- Parameters:
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns:
Information about users of an organization.
- Return type:
list[dict]
- get_organization_usage(organizationId=None, year=None, month=None, workspaceId=None, member=None)¶
Get organization usage optionally filtered on workspace or a user.
- Parameters:
organizationId (str) – Organization ID. Defaults to current if not specified.
year (str) – Usage year to filter on.
month (str) – Usage month to filter on.
workspaceId (str) – Workspace Id. Optional.
member (str) – User email. Optional.
- Returns:
Organization usage by channels, instanceType, and time as integer.
- Return type:
list[dict]
- get_organizations(organizationId=None)¶
Shows the organizations the user belongs to and the user’s role in that organization.
- Returns:
Information about the organizations you belong to.
- Return type:
list[dict]
- get_staged_graphs(graphId=None, name=None, email=None, workspaceId=None)¶
Queries the workspace staged graphs based off provided parameters. Checks on graphId, name, or owner in this respective order within the specified workspace. If only workspace ID is provided, this will return all the staged graphs in a workspace.
- Parameters:
graphid (str) – Staged GraphID to filter on. Optional.
name (str) – Name of the staged graph to filter on. Optional.
email (str) – Owner of staged graphs to filter on. Optional.
workspaceId (str) – Workspace ID to filter on. If none is provided, the default workspace will get used.
- Returns:
A list of staged graphs based off provided query parameters if any parameters match.
- Return type:
list[dict]
- get_system_status(serviceId=None, display=True)¶
Fetches the system status, if no serviceId is provided it will fetch all services.
- Parameters:
serviceId (str) – The identifier of the service to fetch the status of.
display (bool) – Boolean for either displaying the status or returning as a dict.
- get_umap(umapId, workspaceId=None)¶
Retrieves information about UMAP dataset comparison from the platform.
- Parameters:
umapId (str) – UMAP Job ID.
workspaceId (str) – Workspace ID where the datasets exists.
- Returns:
UMAP information.
- Return type:
dict
- get_volume_data(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(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]
- get_workspace()¶
Get Workspace ID of current workspace.
- Returns:
Workspace ID of current workspace.
- Return type:
str
- get_workspace_guests(workspaceId=None)¶
Get guests of a workspace. Uses default workspace if not specified.
- Parameters:
workspaceId (str) – Workspace Id. Optional.
- Returns:
Information about guests of an workspace.
- Return type:
list[dict]
- get_workspace_invites(workspaceId=None)¶
Get invitations of a workspace. Uses default workspace if not specified.
- Parameters:
workspaceId (str) – Workspace Id. Optional.
- Returns:
Information about invitations of an workspace.
- Return type:
list[dict]
- get_workspace_limits(setting=None, workspaceId=None)¶
Get information about Workspace limits and settings.
- Parameters:
setting (str) – Setting name.
workspaceId (str) – Workspace ID. Defaults to current if not specified.
- Returns:
Workspace limit information.
- Return type:
list[dict]
- get_workspaces(organizationId=None, workspaceId=None)¶
Shows list of workspaces with id, name, and owner data.
- Parameters:
organizationId (str) – Organization ID to filter on. Optional
workspaceId (str) – Workspace ID to filter on. Optional
- Returns:
Workspace data for all workspaces for a user.
- Return type:
list[dict]
- login(workspaceId=None, environment='prod', email=None, password=None, local=False, interactive=True, verbose=None)¶
Log in to the SDK.
- Parameters:
workspaceId (str) – ID of the workspace to log in to. Uses default if not specified.
environment (str) – Environment to log into. Defaults to production.
email (str) – Email for the login. Will prompt if not provided.
password (str) – Password to login. Will prompt if not provided.
local (bool) – Used for development to indicate pointing to local API.
verbose (str) – Flag to turn on verbose logging. Use ‘debug’ to view log output.
- logout()¶
Logs out of the ana sdk and removes credentials from ana.
- mount_volumes(volumes)¶
Retrieves credentials for mounting volumes.
- Parameters:
volumes ([str]) – Volumes to retrieve mount credentials for.
- Returns:
Credential information.
- Return type:
dict
- refresh_token()¶
- remove_channel_access(channelId, organizationId)¶
Remove access to a channel for an organization.
- Parameters:
channelId (str) – Id of channel to remove access to.
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns:
Access status.
- Return type:
str
- remove_gan_organization(modelId, organizationId)¶
Remove access to a map for an organization.
- Parameters:
modelId (str) – ModelId to remove access to.
organizationId (str) – Organization ID to remove access.
- Returns:
Status
- Return type:
bool
- remove_map_organization(mapId, organizationId)¶
Remove access to a map for an organization.
- Parameters:
mapId (str) – MapId to remove access to.
organizationId (str) – Organization ID to remove access.
- Returns:
Status
- Return type:
bool
- remove_organization_invitation(email, organizationId=None, invitationId=None)¶
Remove a invitation from an existing organization.
- Parameters:
email (str) – Invitation email to remove.
organizationId (str) – Organization ID to remove member from. Removes from current organization if not specified.
invitationId (str) – Invitation ID to remove invitation from. Removes from current organization if not specified.
- Returns:
Response status if member got removed from organization succesfully.
- Return type:
str
- remove_organization_member(email, organizationId=None)¶
Remove a member from an existing organization.
- Parameters:
email (str) – Member email to remove.
organizationId (str) – Organization ID to remove member from. Removes from current organization if not specified.
- Returns:
Response status if member got removed from organization succesfully.
- Return type:
str
- remove_volume_access(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
- remove_workspace_guest(email, workspaceId=None)¶
Remove a guest from an existing workspace.
- Parameters:
email (str) – Guest email to remove.
workspaceId (str) – Workspace ID to remove guest from. Removes from current workspace if not specified.
- Returns:
Response status if guest got removed from workspace succesfully.
- Return type:
str
- remove_workspace_invitation(email, workspaceId=None, invitationId=None)¶
Remove a invitation from an existing organization.
- Parameters:
email (str) – Invitation email to remove.
workspaceId (str) – Workspace ID to remove member from. Removes from current organization if not specified.
inviteId (str) – Invitation ID to remove invitation from. Removes from current organization if not specified.
- Returns:
Response status if member got removed from organization succesfully.
- Return type:
str
- set_default_graph(channelId, workspaceId, graphId=None, stagedGraphId=None)¶
Sets the default graph for a channel. User must be in the organization that manages the channel.
- Parameters:
channel (str) – The name of the channel to update the default graph.
workspaceId (str) – The ID of the Workspace that the graph is in.
graphId (str) – The ID of the graph that you want to be the default for the channel. Optional.
stagedGraphId (str) – The ID of the staged graph that you want to be the default for the channel. Optional.
- Returns:
Status
- Return type:
str
- set_organization(organizationId, workspaceId=None)¶
Set the organization (and optionally a workspace) to the one you wish to work in.
- Parameters:
organizationId (str) – Organization ID for the organization you wish to work in.
workspaceId (str) – Workspace ID for the workspace you wish to work in. Uses default workspace if this is not set.
- set_organization_limit(setting, limit, organizationId=None)¶
Set Organization limit for a setting.
- Parameters:
setting (str) – Setting name.
limit (int) – Limit for the setting.
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns:
Organization limit information.
- Return type:
list[dict]
- set_workspace(workspaceId)¶
Set the workspace to the one you wish to work in.
- Parameters:
workspaceId (str) – Workspace ID for the workspace you wish to work in.
- set_workspace_limit(setting, limit, workspaceId=None)¶
Set a limit for a workspace.
- Parameters:
setting (str) – Setting name.
limit (int) – Limit to set at.
workspaceId (str) – Workspace ID. Defaults to current if not specified.
- Returns:
Workspace limit information.
- Return type:
list[dict]
- upload_channel_documentation(channelId, mdfile)¶
Uploads a markdown file for channel documentation.
- Parameters:
channelID (str) – The channelId of the channel
mdfile (str) – The filepath of the markdown file used for channel documentation.
- Returns:
Success/Failure of channel documenation upload.
- Return type:
bool
- upload_dataset(filename, description=None, workspaceId=None)¶
Uploads user dataset.
- Parameters:
filename (str) – Path to the dataset folder or file for uploading. Must be zip or tar file types.
workspaceId (str) – WorkspaceId to upload dataset to. Defaults to current.
description (str) – Description for new dataset.
- Returns:
success
- Return type:
str
- upload_volume_data(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