Airavata Django Portal SDK

The Airavata Django Portal SDK provides libraries that assist in developing custom Django app extensions to the Airavata Django Portal.

API Documentation

module user_storage

airavata_django_portal_sdk.user_storage.save(request, path, file, name=None, content_type=None, storage_resource_id=None, experiment_id=None)

Save file in path in the user's storage and return DataProduct. If experiment_id provided then the path will be relative to the experiment data directory.

airavata_django_portal_sdk.user_storage.save_input_file(request, file, name=None, content_type=None, storage_resource_id=None)

Save input file in staging area for input files.

airavata_django_portal_sdk.user_storage.open_file(request, data_product=None, data_product_uri=None)

Return file object for replica if it exists in user storage. One of data_product or data_product_uri is required.

airavata_django_portal_sdk.user_storage.get_download_url(request, data_product=None, data_product_uri=None, force_download=False, mime_type=None)

Return URL for downloading data product. One of data_product or data_product_uri is required.

airavata_django_portal_sdk.user_storage.exists(request, data_product=None, data_product_uri=None)

Return True if replica for data_product exists in user storage. One of data_product or data_product_uri is required.

airavata_django_portal_sdk.user_storage.dir_exists(request, path, storage_resource_id=None, experiment_id=None)

Return True if path exists in user's data store. If experiment_id provided then the path will be relative to the experiment data directory.

airavata_django_portal_sdk.user_storage.user_file_exists(request, path, storage_resource_id=None, experiment_id=None)

If file exists, return data product URI, else None. If experiment_id provided then the path will be relative to the experiment data directory.

airavata_django_portal_sdk.user_storage.delete(request, data_product=None, data_product_uri=None)

Delete replica for data product in this data store. One of data_product or data_product_uri is required.

airavata_django_portal_sdk.user_storage.delete_dir(request, path, storage_resource_id=None, experiment_id=None)

Delete path in user's data store, if it exists. If experiment_id provided then the path will be relative to the experiment data directory.

airavata_django_portal_sdk.user_storage.listdir(request, path, storage_resource_id=None, experiment_id=None)

Return a tuple of two lists, one for directories, the second for files. If experiment_id provided then the path will be relative to the experiment data directory.

airavata_django_portal_sdk.user_storage.list_experiment_dir(request, experiment_id, path='', storage_resource_id=None)

List files, directories in experiment data directory. Returns a tuple, see listdir.

airavata_django_portal_sdk.user_storage.experiment_dir_exists(request, experiment_id, path='', storage_resource_id=None)

Returns True if the path exists in the given experiment's data directory.

airavata_django_portal_sdk.user_storage.create_user_dir(request, path='', dir_names=(), create_unique=False, storage_resource_id=None, experiment_id=None)

Creates a directory, and intermediate directories if given, at the given path in the user's storage. dir_names should be either a list or tuple of directories names to create at the given path. If create_unique is True and the given dir_names results in an already existing directory, the dir_names will be modified (for example, random suffix added) until it results in a name for a directory that doesn't exist and that directory will get created. If create_unique is False (the default) and the directory already exists, no directory will be created, but the directory resource information will be returned. dir_names may also be modified to sanitize them for file paths, for example, converting spaces to underscores. Returns a tuple of the storage_resource_id and resource_path of the directory resource.

If experiment_id provided then the path will be relative to the experiment data directory.

module experiment_util

airavata_django_portal_sdk.experiment_util.launch(request, experiment_id)
airavata_django_portal_sdk.experiment_util.clone(request, experiment_id)

Clone experiment and return the experiment id of the clone.

module intermediate_output

airavata_django_portal_sdk.experiment_util.intermediate_output.get_intermediate_output_process_status(request, experiment, *output_name)

Return ProcessStatus of intermediate output fetch process, or None if not available.

airavata_django_portal_sdk.experiment_util.intermediate_output.can_fetch_intermediate_output(request, experiment, output_name)

Return True if intermediate output can be fetched for the given named output.

airavata_django_portal_sdk.experiment_util.intermediate_output.fetch_intermediate_output(request, experiment_id, *output_name)

Start a fetch of the output file for a currently running experiment.

airavata_django_portal_sdk.experiment_util.intermediate_output.get_intermediate_output_data_products(request, experiment, output_name)

Return the DataProduct instance(s) for a experiment output.