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 2019/12/05 19:56:56 UTC
[airavata-django-portal] 01/03: AIRAVATA-3268 Add overrideFilename
for URI type inputs
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 53bd78197c18f4f218146c2934dc162ab3ac670d
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Dec 5 14:42:46 2019 -0500
AIRAVATA-3268 Add overrideFilename for URI type inputs
---
airavata/model/application/io/ttypes.py | 16 +++++++++++++++-
airavata/model/sharing/ttypes.py | 15 ++++++++++++++-
airavata/service/profile/user/cpi/UserProfileService.py | 8 ++++++++
.../applications/ApplicationInputFieldEditor.vue | 15 ++++++++++++---
.../django_airavata_api/js/models/InputDataObjectType.js | 3 ++-
5 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/airavata/model/application/io/ttypes.py b/airavata/model/application/io/ttypes.py
index 8c9017a..17f1760 100644
--- a/airavata/model/application/io/ttypes.py
+++ b/airavata/model/application/io/ttypes.py
@@ -74,6 +74,8 @@ class InputDataObjectType(object):
metaData:
Any metadat. This is typically ignore by Airavata and is used by gateways for application configuration.
+ overrideFilename:
+ Rename input file to given value when staging to compute resource.
Attributes:
- name
@@ -89,6 +91,7 @@ class InputDataObjectType(object):
- dataStaged
- storageResourceId
- isReadOnly
+ - overrideFilename
"""
thrift_spec = (
@@ -106,9 +109,10 @@ class InputDataObjectType(object):
(11, TType.BOOL, 'dataStaged', None, None, ), # 11
(12, TType.STRING, 'storageResourceId', 'UTF8', None, ), # 12
(13, TType.BOOL, 'isReadOnly', None, None, ), # 13
+ (14, TType.STRING, 'overrideFilename', 'UTF8', None, ), # 14
)
- def __init__(self, name=None, value=None, type=None, applicationArgument=None, standardInput=None, userFriendlyDescription=None, metaData=None, inputOrder=None, isRequired=None, requiredToAddedToCommandLine=None, dataStaged=None, storageResourceId=None, isReadOnly=None,):
+ def __init__(self, name=None, value=None, type=None, applicationArgument=None, standardInput=None, userFriendlyDescription=None, metaData=None, inputOrder=None, isRequired=None, requiredToAddedToCommandLine=None, dataStaged=None, storageResourceId=None, isReadOnly=None, overrideFilename=None,):
self.name = name
self.value = value
self.type = type
@@ -122,6 +126,7 @@ class InputDataObjectType(object):
self.dataStaged = dataStaged
self.storageResourceId = storageResourceId
self.isReadOnly = isReadOnly
+ self.overrideFilename = overrideFilename
def read(self, iprot):
if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
@@ -197,6 +202,11 @@ class InputDataObjectType(object):
self.isReadOnly = iprot.readBool()
else:
iprot.skip(ftype)
+ elif fid == 14:
+ if ftype == TType.STRING:
+ self.overrideFilename = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -259,6 +269,10 @@ class InputDataObjectType(object):
oprot.writeFieldBegin('isReadOnly', TType.BOOL, 13)
oprot.writeBool(self.isReadOnly)
oprot.writeFieldEnd()
+ if self.overrideFilename is not None:
+ oprot.writeFieldBegin('overrideFilename', TType.STRING, 14)
+ oprot.writeString(self.overrideFilename.encode('utf-8') if sys.version_info[0] == 2 else self.overrideFilename)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
diff --git a/airavata/model/sharing/ttypes.py b/airavata/model/sharing/ttypes.py
index 1f2f0e9..661367f 100644
--- a/airavata/model/sharing/ttypes.py
+++ b/airavata/model/sharing/ttypes.py
@@ -190,6 +190,7 @@ class Domain(object):
<li>description : A short description for the domain</li>
<li>createdTime : Will be set by the system</li>
<li>updatedTime : Will be set by the system</li>
+ <li>initialUserGroupId : New users will automatically be added to this group</li>
Attributes:
@@ -198,6 +199,7 @@ class Domain(object):
- description
- createdTime
- updatedTime
+ - initialUserGroupId
"""
thrift_spec = (
@@ -207,14 +209,16 @@ class Domain(object):
(3, TType.STRING, 'description', 'UTF8', None, ), # 3
(4, TType.I64, 'createdTime', None, None, ), # 4
(5, TType.I64, 'updatedTime', None, None, ), # 5
+ (6, TType.STRING, 'initialUserGroupId', 'UTF8', None, ), # 6
)
- def __init__(self, domainId=thrift_spec[1][4], name=None, description=None, createdTime=None, updatedTime=None,):
+ def __init__(self, domainId=thrift_spec[1][4], name=None, description=None, createdTime=None, updatedTime=None, initialUserGroupId=None,):
self.domainId = domainId
self.name = name
self.description = description
self.createdTime = createdTime
self.updatedTime = updatedTime
+ self.initialUserGroupId = initialUserGroupId
def read(self, iprot):
if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
@@ -250,6 +254,11 @@ class Domain(object):
self.updatedTime = iprot.readI64()
else:
iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.STRING:
+ self.initialUserGroupId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -280,6 +289,10 @@ class Domain(object):
oprot.writeFieldBegin('updatedTime', TType.I64, 5)
oprot.writeI64(self.updatedTime)
oprot.writeFieldEnd()
+ if self.initialUserGroupId is not None:
+ oprot.writeFieldBegin('initialUserGroupId', TType.STRING, 6)
+ oprot.writeString(self.initialUserGroupId.encode('utf-8') if sys.version_info[0] == 2 else self.initialUserGroupId)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
diff --git a/airavata/service/profile/user/cpi/UserProfileService.py b/airavata/service/profile/user/cpi/UserProfileService.py
index ca8b8b0..98f33fb 100644
--- a/airavata/service/profile/user/cpi/UserProfileService.py
+++ b/airavata/service/profile/user/cpi/UserProfileService.py
@@ -31,6 +31,10 @@ class Iface(airavata.base.api.BaseAPI.Iface):
def addUserProfile(self, authzToken, userProfile):
"""
+ This method is deprecated and will be removed in future versions of Airavata. Please use
+ the initializeUserProfile method which fetches the information about the user profile from
+ IAM service - @Deprecated
+
Parameters:
- authzToken
- userProfile
@@ -154,6 +158,10 @@ class Client(airavata.base.api.BaseAPI.Client, Iface):
def addUserProfile(self, authzToken, userProfile):
"""
+ This method is deprecated and will be removed in future versions of Airavata. Please use
+ the initializeUserProfile method which fetches the information about the user profile from
+ IAM service - @Deprecated
+
Parameters:
- authzToken
- userProfile
diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationInputFieldEditor.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationInputFieldEditor.vue
index 2f6f472..0213f4b 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationInputFieldEditor.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationInputFieldEditor.vue
@@ -15,12 +15,15 @@
<b-form-group label="Name" :label-for="id+'-name'">
<b-form-input :id="id+'-name'" type="text" v-model="data.name" ref="nameInput" required :disabled="readonly"></b-form-input>
</b-form-group>
- <b-form-group label="Initial Value" :label-for="id+'-value'">
- <b-form-input :id="id+'-value'" type="text" v-model="data.value" :disabled="readonly"></b-form-input>
- </b-form-group>
<b-form-group label="Type" :label-for="id+'-type'">
<b-form-select :id="id+'-type'" v-model="data.type" :options="inputTypeOptions" :disabled="readonly" />
</b-form-group>
+ <b-form-group label="Initial Value" :label-for="id+'-value'" v-if="showValueField">
+ <b-form-input :id="id+'-value'" type="text" v-model="data.value" :disabled="readonly"></b-form-input>
+ </b-form-group>
+ <b-form-group label="Override Filename" :label-for="id+'-value'" v-if="showOverrideFilenameField">
+ <b-form-input :id="id+'-override-filename'" type="text" v-model="data.overrideFilename" :disabled="readonly"></b-form-input>
+ </b-form-group>
<b-form-group label="Application Argument" :label-for="id+'-argument'">
<b-form-input :id="id+'-argument'" type="text" v-model="data.applicationArgument" :disabled="readonly"></b-form-input>
</b-form-group>
@@ -102,6 +105,12 @@ export default {
},
id() {
return "id-" + this.data.key;
+ },
+ showValueField() {
+ return this.data.type.isSimpleValueType
+ },
+ showOverrideFilenameField() {
+ return this.data.type === models.DataType.URI;
}
},
methods: {
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js b/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js
index f3a25fb..9149d2e 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/InputDataObjectType.js
@@ -41,7 +41,8 @@ const FIELDS = [
name: "isReadOnly",
type: "boolean",
default: false
- }
+ },
+ "overrideFilename"
];
const IS_REQUIRED_DEFAULT = "This field is required.";