You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/07/09 13:52:03 UTC

[airavata-django-portal] branch develop updated (a754a55 -> 33cf57d)

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git.


    from a754a55  AIRAVATA-3428 Reload app interface when it changes
     new b727565  AIRAVATA-3485 Support for experiment-id in user-storage REST API
     new 33cf57d  AIRAVATA-3485 Update SDK to 1.1.dev4

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 django_airavata/apps/api/views.py | 23 ++++++++++++++---------
 requirements.txt                  |  2 +-
 2 files changed, 15 insertions(+), 10 deletions(-)

[airavata-django-portal] 01/02: AIRAVATA-3485 Support for experiment-id in user-storage REST API

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit b727565ad15743866bc2e853b54248a9f66ea7a3
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Jul 9 09:33:04 2021 -0400

    AIRAVATA-3485 Support for experiment-id in user-storage REST API
---
 django_airavata/apps/api/views.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index 05fdbe1..22fc578 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -1520,8 +1520,9 @@ class UserStoragePathView(APIView):
 
     def post(self, request, path="/", format=None):
         path = request.POST.get('path', path)
-        if not user_storage.dir_exists(request, path):
-            _, resource_path = user_storage.create_user_dir(request, path)
+        experiment_id = request.POST.get('experiment-id')
+        if not user_storage.dir_exists(request, path, experiment_id=experiment_id):
+            _, resource_path = user_storage.create_user_dir(request, path, experiment_id=experiment_id)
             # create_user_dir may create the directory with a different name
             # than requested, for example, converting spaces to underscores, so
             # use as the path the path that is returned by create_user_dir
@@ -1532,7 +1533,8 @@ class UserStoragePathView(APIView):
         if 'file' in request.FILES:
             user_file = request.FILES['file']
             data_product = user_storage.save(
-                request, path, user_file, content_type=user_file.content_type)
+                request, path, user_file, content_type=user_file.content_type,
+                experiment_id=experiment_id)
         # Handle a tus upload
         elif 'uploadURL' in request.POST:
             uploadURL = request.POST['uploadURL']
@@ -1540,7 +1542,8 @@ class UserStoragePathView(APIView):
             def save_file(file_path, file_name, file_type):
                 with open(file_path, 'rb') as uploaded_file:
                     return user_storage.save(request, path, uploaded_file,
-                                             name=file_name, content_type=file_type)
+                                             name=file_name, content_type=file_type,
+                                             experiment_id=experiment_id)
             data_product = tus.save_tus_upload(uploadURL, save_file)
         return self._create_response(request, path, uploaded=data_product)
 
@@ -1565,16 +1568,18 @@ class UserStoragePathView(APIView):
 
     def delete(self, request, path="/", format=None):
         path = request.POST.get('path', path)
-        if user_storage.dir_exists(request, path):
-            user_storage.delete_dir(request, path)
+        experiment_id = request.POST.get('experiment-id')
+        if user_storage.dir_exists(request, path, experiment_id=experiment_id):
+            user_storage.delete_dir(request, path, experiment_id=experiment_id)
         else:
-            user_storage.delete_user_file(request, path)
+            user_storage.delete_user_file(request, path, experiment_id=experiment_id)
 
         return Response(status=204)
 
     def _create_response(self, request, path, uploaded=None):
-        if user_storage.dir_exists(request, path):
-            directories, files = user_storage.listdir(request, path)
+        experiment_id = request.POST.get('experiment-id')
+        if user_storage.dir_exists(request, path, experiment_id=experiment_id):
+            directories, files = user_storage.listdir(request, path, experiment_id=experiment_id)
             data = {
                 'isDir': True,
                 'directories': directories,

[airavata-django-portal] 02/02: AIRAVATA-3485 Update SDK to 1.1.dev4

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 33cf57d1698825a34956f3eedb692c8d24a11718
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Jul 9 09:50:55 2021 -0400

    AIRAVATA-3485 Update SDK to 1.1.dev4
---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index 2e84e21..339af43 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,6 +19,6 @@ google-api-python-client==1.12.8
 grpcio-tools==1.34.1
 grpcio==1.34.1
 
-airavata-django-portal-sdk==1.1.dev3
+airavata-django-portal-sdk==1.1.dev4
 -e git+https://github.com/apache/airavata.git@develop#egg=airavata-python-sdk&subdirectory=airavata-api/airavata-client-sdks/airavata-python-sdk
 -e "."