airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] branch group-based-auth updated: AIRAVATA-2727 Default id of GroupResourceProfile and set in repository
Date Fri, 04 May 2018 20:06:12 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch group-based-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/group-based-auth by this push:
     new f0a6e84  AIRAVATA-2727 Default id of GroupResourceProfile and set in repository
f0a6e84 is described below

commit f0a6e8422add33825976601d49c6ceffcc71ad27
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Fri May 4 16:03:45 2018 -0400

    AIRAVATA-2727 Default id of GroupResourceProfile and set in repository
---
 .../appcatalog/groupresourceprofile/ttypes.py      | 14 +++++-----
 .../BatchQueueResourcePolicy.java                  |  5 +++-
 .../ComputeResourcePolicy.java                     |  5 +++-
 .../groupresourceprofile/GroupResourceProfile.java |  6 ++--
 .../appcatalog/AppCatAbstractRepository.java       |  3 ++
 .../appcatalog/GroupResourceProfileRepository.java | 32 ++++++++++++++++++----
 .../appcatalog/ComputeResourceRepositoryTest.java  | 17 ++++++++++--
 .../GroupResourceProfileRepositoryTest.java        | 25 +++++++++++------
 .../group_resource_profile_model.thrift            |  8 +++---
 9 files changed, 84 insertions(+), 31 deletions(-)

diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py
b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py
index b8689fd..d2a9d71 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py
@@ -408,13 +408,13 @@ class ComputeResourcePolicy(object):
 
     thrift_spec = (
         None,  # 0
-        (1, TType.STRING, 'resourcePolicyId', 'UTF8', None, ),  # 1
+        (1, TType.STRING, 'resourcePolicyId', 'UTF8', "DO_NOT_SET_AT_CLIENTS", ),  # 1
         (2, TType.STRING, 'computeResourceId', 'UTF8', None, ),  # 2
         (3, TType.STRING, 'groupResourceProfileId', 'UTF8', None, ),  # 3
         (4, TType.LIST, 'allowedBatchQueues', (TType.STRING, 'UTF8', False), None, ),  #
4
     )
 
-    def __init__(self, resourcePolicyId=None, computeResourceId=None, groupResourceProfileId=None,
allowedBatchQueues=None,):
+    def __init__(self, resourcePolicyId=thrift_spec[1][4], computeResourceId=None, groupResourceProfileId=None,
allowedBatchQueues=None,):
         self.resourcePolicyId = resourcePolicyId
         self.computeResourceId = computeResourceId
         self.groupResourceProfileId = groupResourceProfileId
@@ -521,7 +521,7 @@ class BatchQueueResourcePolicy(object):
 
     thrift_spec = (
         None,  # 0
-        (1, TType.STRING, 'resourcePolicyId', 'UTF8', None, ),  # 1
+        (1, TType.STRING, 'resourcePolicyId', 'UTF8', "DO_NOT_SET_AT_CLIENTS", ),  # 1
         (2, TType.STRING, 'computeResourceId', 'UTF8', None, ),  # 2
         (3, TType.STRING, 'groupResourceProfileId', 'UTF8', None, ),  # 3
         (4, TType.STRING, 'queuename', 'UTF8', None, ),  # 4
@@ -530,7 +530,7 @@ class BatchQueueResourcePolicy(object):
         (7, TType.I32, 'maxAllowedWalltime', None, None, ),  # 7
     )
 
-    def __init__(self, resourcePolicyId=None, computeResourceId=None, groupResourceProfileId=None,
queuename=None, maxAllowedNodes=None, maxAllowedCores=None, maxAllowedWalltime=None,):
+    def __init__(self, resourcePolicyId=thrift_spec[1][4], computeResourceId=None, groupResourceProfileId=None,
queuename=None, maxAllowedNodes=None, maxAllowedCores=None, maxAllowedWalltime=None,):
         self.resourcePolicyId = resourcePolicyId
         self.computeResourceId = computeResourceId
         self.groupResourceProfileId = groupResourceProfileId
@@ -678,8 +678,8 @@ class GroupResourceProfile(object):
 
     thrift_spec = (
         None,  # 0
-        (1, TType.STRING, 'gatewayId', 'UTF8', "DO_NOT_SET_AT_CLIENTS", ),  # 1
-        (2, TType.STRING, 'groupResourceProfileId', 'UTF8', None, ),  # 2
+        (1, TType.STRING, 'gatewayId', 'UTF8', None, ),  # 1
+        (2, TType.STRING, 'groupResourceProfileId', 'UTF8', "DO_NOT_SET_AT_CLIENTS", ), 
# 2
         (3, TType.STRING, 'groupResourceProfileName', 'UTF8', None, ),  # 3
         (4, TType.LIST, 'computePreferences', (TType.STRUCT, (GroupComputeResourcePreference,
GroupComputeResourcePreference.thrift_spec), False), None, ),  # 4
         (5, TType.LIST, 'computeResourcePolicies', (TType.STRUCT, (ComputeResourcePolicy,
ComputeResourcePolicy.thrift_spec), False), None, ),  # 5
@@ -688,7 +688,7 @@ class GroupResourceProfile(object):
         (8, TType.I64, 'updatedTime', None, None, ),  # 8
     )
 
-    def __init__(self, gatewayId=thrift_spec[1][4], groupResourceProfileId=None, groupResourceProfileName=None,
computePreferences=None, computeResourcePolicies=None, batchQueueResourcePolicies=None, creationTime=None,
updatedTime=None,):
+    def __init__(self, gatewayId=None, groupResourceProfileId=thrift_spec[2][4], groupResourceProfileName=None,
computePreferences=None, computeResourcePolicies=None, batchQueueResourcePolicies=None, creationTime=None,
updatedTime=None,):
         self.gatewayId = gatewayId
         self.groupResourceProfileId = groupResourceProfileId
         self.groupResourceProfileName = groupResourceProfileName
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/BatchQueueResourcePolicy.java
b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/BatchQueueResourcePolicy.java
index e032dd0..157b543 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/BatchQueueResourcePolicy.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/BatchQueueResourcePolicy.java
@@ -151,6 +151,8 @@ public class BatchQueueResourcePolicy implements org.apache.thrift.TBase<BatchQu
   }
 
   public BatchQueueResourcePolicy() {
+    this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS";
+
   }
 
   public BatchQueueResourcePolicy(
@@ -192,7 +194,8 @@ public class BatchQueueResourcePolicy implements org.apache.thrift.TBase<BatchQu
 
   @Override
   public void clear() {
-    this.resourcePolicyId = null;
+    this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS";
+
     this.computeResourceId = null;
     this.groupResourceProfileId = null;
     this.queuename = null;
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourcePolicy.java
b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourcePolicy.java
index 7270875..97e3b17 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourcePolicy.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourcePolicy.java
@@ -127,6 +127,8 @@ public class ComputeResourcePolicy implements org.apache.thrift.TBase<ComputeRes
   }
 
   public ComputeResourcePolicy() {
+    this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS";
+
   }
 
   public ComputeResourcePolicy(
@@ -165,7 +167,8 @@ public class ComputeResourcePolicy implements org.apache.thrift.TBase<ComputeRes
 
   @Override
   public void clear() {
-    this.resourcePolicyId = null;
+    this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS";
+
     this.computeResourceId = null;
     this.groupResourceProfileId = null;
     this.allowedBatchQueues = null;
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java
b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java
index 4e732b9..f3dcd7e 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java
@@ -179,7 +179,7 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
   }
 
   public GroupResourceProfile() {
-    this.gatewayId = "DO_NOT_SET_AT_CLIENTS";
+    this.groupResourceProfileId = "DO_NOT_SET_AT_CLIENTS";
 
   }
 
@@ -237,9 +237,9 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
 
   @Override
   public void clear() {
-    this.gatewayId = "DO_NOT_SET_AT_CLIENTS";
+    this.gatewayId = null;
+    this.groupResourceProfileId = "DO_NOT_SET_AT_CLIENTS";
 
-    this.groupResourceProfileId = null;
     this.groupResourceProfileName = null;
     this.computePreferences = null;
     this.computeResourcePolicies = null;
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/AppCatAbstractRepository.java
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/AppCatAbstractRepository.java
index 55637c7..f27dc76 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/AppCatAbstractRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/AppCatAbstractRepository.java
@@ -119,6 +119,9 @@ public abstract class AppCatAbstractRepository<T, E, Id> {
             R r = committer.commit(entityManager);
             entityManager.getTransaction().commit();
             return  r;
+        } catch(Exception e) {
+            logger.error("Failed to execute App Catalog transaction", e);
+            throw e;
         }finally {
             if (entityManager != null && entityManager.isOpen()) {
                 if (entityManager.getTransaction().isActive()) {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepository.java
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepository.java
index 28bc7b4..3c9a401 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepository.java
@@ -23,11 +23,18 @@ import org.apache.airavata.model.appcatalog.groupresourceprofile.BatchQueueResou
 import org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourcePolicy;
 import org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference;
 import org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile;
-import org.apache.airavata.registry.core.entities.appcatalog.*;
+import org.apache.airavata.model.commons.airavata_commonsConstants;
+import org.apache.airavata.registry.core.entities.appcatalog.BatchQueueResourcePolicyPK;
+import org.apache.airavata.registry.core.entities.appcatalog.GroupComputeResourcePrefPK;
+import org.apache.airavata.registry.core.entities.appcatalog.GroupResourceProfileEntity;
+import org.apache.airavata.registry.core.entities.appcatalog.GroupResourceProfilePK;
 import org.apache.airavata.registry.core.utils.DBConstants;
 import org.apache.airavata.registry.core.utils.QueryConstants;
 
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
 
 /**
  * Created by skariyat on 2/8/18.
@@ -43,6 +50,11 @@ public class GroupResourceProfileRepository extends AppCatAbstractRepository<Gro
         final String groupResourceProfileId = UUID.randomUUID().toString();
         groupResourceProfile.setGroupResourceProfileId(groupResourceProfileId);
         groupResourceProfile.setCreationTime(System.currentTimeMillis());
+        updateChildren(groupResourceProfile, groupResourceProfileId);
+        return updateGroupResourceProfile(groupResourceProfile);
+    }
+
+    private void updateChildren(GroupResourceProfile groupResourceProfile, String groupResourceProfileId)
{
         if (groupResourceProfile.getComputePreferences() != null) {
             for (GroupComputeResourcePreference groupComputeResourcePreference: groupResourceProfile.getComputePreferences())
{
                 groupComputeResourcePreference.setGroupResourceProfileId(groupResourceProfileId);
@@ -52,17 +64,27 @@ public class GroupResourceProfileRepository extends AppCatAbstractRepository<Gro
             }
         }
         if (groupResourceProfile.getBatchQueueResourcePolicies() != null) {
-            groupResourceProfile.getBatchQueueResourcePolicies().forEach(bq -> bq.setGroupResourceProfileId(groupResourceProfileId));
+            groupResourceProfile.getBatchQueueResourcePolicies().forEach(bq -> {
+                if (bq.getResourcePolicyId().trim().isEmpty() || bq.getResourcePolicyId().equals(airavata_commonsConstants.DEFAULT_ID))
{
+                    bq.setResourcePolicyId(UUID.randomUUID().toString());
+                }
+                bq.setGroupResourceProfileId(groupResourceProfileId);
+            });
         }
         if (groupResourceProfile.getComputeResourcePolicies() != null) {
-            groupResourceProfile.getComputeResourcePolicies().forEach(cr -> cr.setGroupResourceProfileId(groupResourceProfileId));
+            groupResourceProfile.getComputeResourcePolicies().forEach(cr -> {
+                if (cr.getResourcePolicyId().trim().isEmpty() || cr.getResourcePolicyId().equals(airavata_commonsConstants.DEFAULT_ID))
{
+                    cr.setResourcePolicyId(UUID.randomUUID().toString());
+                }
+                cr.setGroupResourceProfileId(groupResourceProfileId);
+            });
         }
-        return updateGroupResourceProfile(groupResourceProfile);
     }
 
     public String updateGroupResourceProfile(GroupResourceProfile updatedGroupResourceProfile)
{
 
         updatedGroupResourceProfile.setUpdatedTime(System.currentTimeMillis());
+        updateChildren(updatedGroupResourceProfile, updatedGroupResourceProfile.getGroupResourceProfileId());
         GroupResourceProfile groupResourceProfile = update(updatedGroupResourceProfile);
         return groupResourceProfile.getGroupResourceProfileId();
     }
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java
b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java
index 7800c46..684e80f 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java
@@ -19,8 +19,21 @@
  */
 package org.apache.airavata.registry.core.repositories.appcatalog;
 
-import org.apache.airavata.model.appcatalog.computeresource.*;
-import org.apache.airavata.model.data.movement.*;
+import org.apache.airavata.model.appcatalog.computeresource.BatchQueue;
+import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
+import org.apache.airavata.model.appcatalog.computeresource.FileSystems;
+import org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand;
+import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface;
+import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
+import org.apache.airavata.model.appcatalog.computeresource.MonitorMode;
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager;
+import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType;
+import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
+import org.apache.airavata.model.data.movement.DataMovementInterface;
+import org.apache.airavata.model.data.movement.DataMovementProtocol;
+import org.apache.airavata.model.data.movement.GridFTPDataMovement;
+import org.apache.airavata.model.data.movement.SCPDataMovement;
+import org.apache.airavata.model.data.movement.SecurityProtocol;
 import org.apache.airavata.registry.core.repositories.appcatalog.util.Initialize;
 import org.apache.airavata.registry.core.utils.DBConstants;
 import org.apache.airavata.registry.cpi.AppCatalogException;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
index b798b03..49dd277 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
@@ -41,7 +41,7 @@ public class GroupResourceProfileRepositoryTest {
     private ComputeResourceRepository computeResourceRepository;
     private GroupResourceProfileRepository groupResourceProfileRepository;
     private String gatewayId = "TEST_GATEWAY";
-    private String groupResourceProfileId = "";
+    private String groupResourceProfileId = null;
     private static final Logger logger = LoggerFactory.getLogger(ComputeResourceRepository.class);
 
     @Before
@@ -124,7 +124,6 @@ public class GroupResourceProfileRepositoryTest {
 
         GroupResourceProfile groupResourceProfile = new GroupResourceProfile();
         groupResourceProfile.setGatewayId(gatewayId);
-        groupResourceProfile.setGroupResourceProfileId(groupResourceProfileId);
         groupResourceProfile.setGroupResourceProfileName("TEST_GROUP_PROFILE_NAME");
 
         GroupAccountSSHProvisionerConfig groupAccountSSHProvisionerConfig = new GroupAccountSSHProvisionerConfig();
@@ -147,12 +146,10 @@ public class GroupResourceProfileRepositoryTest {
 
         ComputeResourcePolicy computeResourcePolicy = new ComputeResourcePolicy();
         computeResourcePolicy.setComputeResourceId(resourceId1);
-        computeResourcePolicy.setResourcePolicyId("TEST_COM_RESOURCE_POLICY_ID1");
         computeResourcePolicy.addToAllowedBatchQueues("queue1");
 
         ComputeResourcePolicy computeResourcePolicy2 = new ComputeResourcePolicy();
         computeResourcePolicy2.setComputeResourceId(resourceId2);
-        computeResourcePolicy2.setResourcePolicyId("TEST_COM_RESOURCE_POLICY_ID2");
         computeResourcePolicy2.addToAllowedBatchQueues("cmqueue1");
 
         List<ComputeResourcePolicy> computeResourcePolicyList =  new ArrayList<>();
@@ -163,14 +160,12 @@ public class GroupResourceProfileRepositoryTest {
 
         BatchQueueResourcePolicy batchQueueResourcePolicy = new BatchQueueResourcePolicy();
         batchQueueResourcePolicy.setComputeResourceId(resourceId1);
-        batchQueueResourcePolicy.setResourcePolicyId("TEST_BQ_RESOURCE_POLICY_ID1");
         batchQueueResourcePolicy.setQueuename("queue1");
         batchQueueResourcePolicy.setMaxAllowedCores(2);
         batchQueueResourcePolicy.setMaxAllowedWalltime(10);
 
         BatchQueueResourcePolicy batchQueueResourcePolicy2 = new BatchQueueResourcePolicy();
         batchQueueResourcePolicy2.setComputeResourceId(resourceId2);
-        batchQueueResourcePolicy2.setResourcePolicyId("TEST_BQ_RESOURCE_POLICY_ID2");
         batchQueueResourcePolicy2.setQueuename("cmqueue1");
         batchQueueResourcePolicy2.setMaxAllowedCores(3);
         batchQueueResourcePolicy2.setMaxAllowedWalltime(12);
@@ -183,6 +178,8 @@ public class GroupResourceProfileRepositoryTest {
 
         groupResourceProfileId = groupResourceProfileRepository.addGroupResourceProfile(groupResourceProfile);
 
+        String computeResourcePolicyId1 = null;
+        String batchQueueResourcePolicyId2 = null;
         if (groupResourceProfileRepository.isGroupResourceProfileExists(groupResourceProfileId))
{
             GroupResourceProfile getGroupResourceProfile = groupResourceProfileRepository.getGroupResourceProfile(groupResourceProfileId);
 
@@ -192,15 +189,27 @@ public class GroupResourceProfileRepositoryTest {
             assertTrue(getGroupResourceProfile.getComputePreferences().size() == 2);
             assertTrue(getGroupResourceProfile.getComputeResourcePolicies().size() == 2);
             assertTrue(getGroupResourceProfile.getBatchQueueResourcePolicies().size() ==
2);
+            computeResourcePolicyId1 = getGroupResourceProfile.getComputeResourcePolicies()
+                    .stream()
+                    .filter(crp -> crp.getComputeResourceId().equals(resourceId1))
+                    .map(crp -> crp.getResourcePolicyId())
+                    .findFirst()
+                    .get();
+            batchQueueResourcePolicyId2 = getGroupResourceProfile.getBatchQueueResourcePolicies()
+                    .stream()
+                    .filter(bqrp -> bqrp.getComputeResourceId().equals(resourceId2))
+                    .map(bqrp -> bqrp.getResourcePolicyId())
+                    .findFirst()
+                    .get();
         }
 
         assertTrue(groupResourceProfileRepository.getGroupComputeResourcePreference(resourceId1,groupResourceProfileId)
!= null);
         assertTrue(groupResourceProfileRepository.getGroupComputeResourcePreference(resourceId1,groupResourceProfileId).getGroupSSHAccountProvisionerConfigs().size()
== 1);
 
-        ComputeResourcePolicy getComputeResourcePolicy = groupResourceProfileRepository.getComputeResourcePolicy(
"TEST_COM_RESOURCE_POLICY_ID1");
+        ComputeResourcePolicy getComputeResourcePolicy = groupResourceProfileRepository.getComputeResourcePolicy(computeResourcePolicyId1);
         assertTrue(getComputeResourcePolicy.getAllowedBatchQueues().get(0).equals("queue1"));
 
-        BatchQueueResourcePolicy getBatchQueuePolicy = groupResourceProfileRepository.getBatchQueueResourcePolicy("TEST_BQ_RESOURCE_POLICY_ID2");
+        BatchQueueResourcePolicy getBatchQueuePolicy = groupResourceProfileRepository.getBatchQueueResourcePolicy(batchQueueResourcePolicyId2);
         assertTrue(getBatchQueuePolicy != null);
         assertTrue(getBatchQueuePolicy.getMaxAllowedCores() == 3);
         assertTrue(getBatchQueuePolicy.getMaxAllowedWalltime() == 12);
diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift
b/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift
index 1674712..e3d04c2 100644
--- a/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift
+++ b/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift
@@ -56,14 +56,14 @@ struct GroupComputeResourcePreference {
 }
 
 struct ComputeResourcePolicy {
-    1: required string resourcePolicyId,
+    1: required string resourcePolicyId = airavata_commons.DEFAULT_ID,
     2: required string computeResourceId,
     3: required string groupResourceProfileId,
     4: optional list<string> allowedBatchQueues
 }
 
 struct BatchQueueResourcePolicy {
-    1: required string resourcePolicyId,
+    1: required string resourcePolicyId = airavata_commons.DEFAULT_ID,
     2: required string computeResourceId,
     3: required string groupResourceProfileId,
     4: optional string queuename,
@@ -93,8 +93,8 @@ struct BatchQueueResourcePolicy {
 */
 
 struct GroupResourceProfile {
-    1: required string gatewayId = airavata_commons.DEFAULT_ID,
-    2: required string groupResourceProfileId,
+    1: required string gatewayId,
+    2: required string groupResourceProfileId = airavata_commons.DEFAULT_ID,
     3: optional string groupResourceProfileName,
     4: optional list<GroupComputeResourcePreference> computePreferences,
     5: optional list<ComputeResourcePolicy> computeResourcePolicies,

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.

Mime
View raw message