airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [1/5] airavata git commit: AIRAVATA-2500 Implement API method to get provisioner metadata
Date Thu, 07 Sep 2017 13:42:57 GMT
Repository: airavata
Updated Branches:
  refs/heads/AIRAVATA-2500 316656c35 -> b0f6744ef


AIRAVATA-2500 Implement API method to get provisioner metadata


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/02392dba
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/02392dba
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/02392dba

Branch: refs/heads/AIRAVATA-2500
Commit: 02392dbae27a329f54769f77e6c178a46af85e4e
Parents: 316656c
Author: Marcus Christie <machristie@apache.org>
Authored: Thu Sep 7 09:41:17 2017 -0400
Committer: Marcus Christie <machristie@apache.org>
Committed: Thu Sep 7 09:41:17 2017 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 56 ++++++++++++++------
 .../accountprovisioning/SSHAccountManager.java  |  3 +-
 .../SSHAccountProvisioner.java                  | 10 ++--
 .../SSHAccountProvisionerFactory.java           | 14 ++---
 .../SSHAccountProvisionerProvider.java          |  3 +-
 .../IULdapSSHAccountProvisioner.java            | 10 ----
 .../IULdapSSHAccountProvisionerProvider.java    | 31 ++++++++++-
 .../SSHAccountProvisionerFactoryTest.java       |  4 +-
 .../provisioner/TestSSHAccountProvisioner.java  | 10 ----
 .../TestSSHAccountProvisionerProvider.java      | 10 ++++
 .../airavata-apis/airavata_api.thrift           | 12 ++---
 .../account_provisioning_model.thrift           | 12 +++--
 12 files changed, 107 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index bb3f2c0..febb703 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -19,7 +19,10 @@
  */
 package org.apache.airavata.api.server.handler;
 
+import org.apache.airavata.accountprovisioning.ConfigParam;
 import org.apache.airavata.accountprovisioning.SSHAccountManager;
+import org.apache.airavata.accountprovisioning.SSHAccountProvisionerFactory;
+import org.apache.airavata.accountprovisioning.SSHAccountProvisionerProvider;
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.airavata_apiConstants;
 import org.apache.airavata.api.server.util.ThriftClientPool;
@@ -38,6 +41,7 @@ import org.apache.airavata.messaging.core.Type;
 import org.apache.airavata.model.WorkflowModel;
 import org.apache.airavata.model.appcatalog.accountprovisioning.SSHAccountProvisioner;
 import org.apache.airavata.model.appcatalog.accountprovisioning.SSHAccountProvisionerConfigParam;
+import org.apache.airavata.model.appcatalog.accountprovisioning.SSHAccountProvisionerConfigParamType;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
 import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
@@ -3969,30 +3973,48 @@ public class AiravataServerHandler implements Airavata.Iface {
 
     @Override
     @SecurityCheck
-    public List<SSHAccountProvisioner> getSSHAccountProvisionerNames(AuthzToken authzToken)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
+    public List<SSHAccountProvisioner> getSSHAccountProvisioners(AuthzToken authzToken)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
 
-        // TODO: implement
-        return null;
-    }
-
-    @Override
-    @SecurityCheck
-    public List<SSHAccountProvisionerConfigParam> getSSHAccountProvisionerConfigParams(AuthzToken
authzToken, String provisionerName) throws InvalidRequestException, AiravataClientException,
AiravataSystemException, AuthorizationException, TException {
-
-        // TODO: implement
-        return null;
+        List<SSHAccountProvisioner> sshAccountProvisioners = new ArrayList<>();
+        List<SSHAccountProvisionerProvider> sshAccountProvisionerProviders = SSHAccountProvisionerFactory.getSSHAccountProvisionerProviders();
+        for (SSHAccountProvisionerProvider provider : sshAccountProvisionerProviders) {
+            // TODO: Move this Thrift conversion to utility class
+            SSHAccountProvisioner sshAccountProvisioner = new SSHAccountProvisioner();
+            sshAccountProvisioner.setCanCreateAccount(provider.canCreateAccount());
+            sshAccountProvisioner.setCanInstallSSHKey(provider.canInstallSSHKey());
+            sshAccountProvisioner.setName(provider.getName());
+            List<SSHAccountProvisionerConfigParam> sshAccountProvisionerConfigParams
= new ArrayList<>();
+            for (ConfigParam configParam : provider.getConfigParams()) {
+                SSHAccountProvisionerConfigParam sshAccountProvisionerConfigParam = new SSHAccountProvisionerConfigParam();
+                sshAccountProvisionerConfigParam.setName(configParam.getName());
+                sshAccountProvisionerConfigParam.setDescription(configParam.getDescription());
+                sshAccountProvisionerConfigParam.setIsOptional(configParam.isOptional());
+                switch (configParam.getType()){
+                    case STRING:
+                        sshAccountProvisionerConfigParam.setType(SSHAccountProvisionerConfigParamType.STRING);
+                        break;
+                    case CRED_STORE_PASSWORD_TOKEN:
+                        sshAccountProvisionerConfigParam.setType(SSHAccountProvisionerConfigParamType.CRED_STORE_PASSWORD_TOKEN);
+                        break;
+                }
+                sshAccountProvisionerConfigParams.add(sshAccountProvisionerConfigParam);
+            }
+            sshAccountProvisioner.setConfigParams(sshAccountProvisionerConfigParams);
+            sshAccountProvisioners.add(sshAccountProvisioner);
+        }
+        return sshAccountProvisioners;
     }
 
     @Override
     @SecurityCheck
-    public boolean doesUserHaveSSHAccount(AuthzToken authzToken, String computeResourceId,
String username) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
+    public boolean doesUserHaveSSHAccount(AuthzToken authzToken, String computeResourceId,
String userId) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
         String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
-        return SSHAccountManager.doesUserHaveSSHAccount(gatewayId, computeResourceId, username);
+        return SSHAccountManager.doesUserHaveSSHAccount(gatewayId, computeResourceId, userId);
     }
 
     @Override
     @SecurityCheck
-    public UserComputeResourcePreference setupUserComputeResourcePreferencesForSSH(AuthzToken
authzToken, String computeResourceId, String username, String airavataCredStoreToken) throws
InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
+    public UserComputeResourcePreference setupUserComputeResourcePreferencesForSSH(AuthzToken
authzToken, String computeResourceId, String userId, String airavataCredStoreToken) throws
InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
         String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
         CredentialStoreService.Client csClient = csClientPool.getResource();
         SSHCredential sshCredential = null;
@@ -4008,13 +4030,13 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
 
         try {
-            UserComputeResourcePreference userComputeResourcePreference = SSHAccountManager.setupSSHAccount(gatewayId,
computeResourceId, username, sshCredential);
+            UserComputeResourcePreference userComputeResourcePreference = SSHAccountManager.setupSSHAccount(gatewayId,
computeResourceId, userId, sshCredential);
             return userComputeResourcePreference;
         }catch (Exception e){
-            logger.error("Error occurred while automatically setting up SSH account for user
[" + username + "]", e);
+            logger.error("Error occurred while automatically setting up SSH account for user
[" + userId + "]", e);
             AiravataSystemException exception = new AiravataSystemException();
             exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
-            exception.setMessage("Error occurred while automatically setting up SSH account
for user [" + username + "]. More info : " + e.getMessage());
+            exception.setMessage("Error occurred while automatically setting up SSH account
for user [" + userId + "]. More info : " + e.getMessage());
             throw exception;
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
index 74c0dd2..8493dc1 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
@@ -110,11 +110,12 @@ public class SSHAccountManager {
 
         // instantiate and init the account provisioner
         SSHAccountProvisioner sshAccountProvisioner = createSshAccountProvisioner(gatewayId,
computeResourcePreference);
+        boolean canCreateAccount = SSHAccountProvisionerFactory.canCreateAccount(computeResourcePreference.getSshAccountProvisioner());
 
         // First check if username has an account
         boolean hasAccount = sshAccountProvisioner.hasAccount(username);
 
-        if (!hasAccount && !sshAccountProvisioner.canCreateAccount()) {
+        if (!hasAccount && !canCreateAccount) {
             throw new RuntimeException("User [" + username + "] doesn't have account and
[" + computeResourceId + "] doesn't have a SSH Account Provisioner that supports creating
accounts.");
         }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
index 5303081..b8abf1f 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
@@ -25,10 +25,8 @@ import java.util.Map;
 public interface SSHAccountProvisioner {
 
     void init(Map<ConfigParam, String> config);
-    boolean hasAccount(String username);
-    boolean canCreateAccount();
-    void createAccount(String username, String sshPublicKey);
-    boolean canInstallSSHKey();
-    void installSSHKey(String username, String sshPublicKey);
-    String getScratchLocation(String username);
+    boolean hasAccount(String userId);
+    void createAccount(String userId, String sshPublicKey);
+    void installSSHKey(String userId, String sshPublicKey);
+    String getScratchLocation(String userId);
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactory.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactory.java
b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactory.java
index 7b1f6c6..09bf4c3 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactory.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactory.java
@@ -29,12 +29,10 @@ public class SSHAccountProvisionerFactory {
 
     private static ServiceLoader<SSHAccountProvisionerProvider> sshAccountProvisionerProviders
= ServiceLoader.load(SSHAccountProvisionerProvider.class);
 
-    public static List<String> getSSHAccountProvisionerImplementationNames() {
-        List<String> names = new ArrayList<>();
-        for (SSHAccountProvisionerProvider sshAccountProvisionerProvider : sshAccountProvisionerProviders
) {
-            names.add(sshAccountProvisionerProvider.getName());
-        }
-        return names;
+    public static List<SSHAccountProvisionerProvider> getSSHAccountProvisionerProviders()
{
+        List<SSHAccountProvisionerProvider> providers = new ArrayList<>();
+        sshAccountProvisionerProviders.forEach(providers::add);
+        return providers;
     }
 
     public static List<ConfigParam> getSSHAccountProvisionerConfigParams(String provisionerName)
{
@@ -42,6 +40,10 @@ public class SSHAccountProvisionerFactory {
         return getSSHAccountProvisionerProvider(provisionerName).getConfigParams();
     }
 
+    public static boolean canCreateAccount(String provisionerName) {
+        return getSSHAccountProvisionerProvider(provisionerName).canCreateAccount();
+    }
+
     public static SSHAccountProvisioner createSSHAccountProvisioner(String provisionerName,
Map<ConfigParam, String> config) {
 
         SSHAccountProvisionerProvider sshAccountProvisionerProvider = getSSHAccountProvisionerProvider(provisionerName);

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerProvider.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerProvider.java
b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerProvider.java
index a43a022..297c757 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerProvider.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerProvider.java
@@ -34,5 +34,6 @@ public interface SSHAccountProvisionerProvider {
     }
     List<ConfigParam> getConfigParams();
     SSHAccountProvisioner createSSHAccountProvisioner(Map<ConfigParam,String> config);
-    // TODO: should canCreateAccount and canInstallSSHKey move here? All metadata about provisioner
could be on this class
+    boolean canCreateAccount();
+    boolean canInstallSSHKey();
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
index 0714f49..03fa803 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
@@ -40,22 +40,12 @@ public class IULdapSSHAccountProvisioner implements SSHAccountProvisioner
{
     }
 
     @Override
-    public boolean canCreateAccount() {
-        return false;
-    }
-
-    @Override
     public void createAccount(String username, String sshPublicKey) {
 
         throw new UnsupportedOperationException("IULdapSSHAccountProvisioner does not support
creating cluster accounts at this time.");
     }
 
     @Override
-    public boolean canInstallSSHKey() {
-        return true;
-    }
-
-    @Override
     public void installSSHKey(String username, String sshPublicKey) {
         // TODO: implement
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisionerProvider.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisionerProvider.java
b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisionerProvider.java
index b54fdc4..45dc0a6 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisionerProvider.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisionerProvider.java
@@ -24,6 +24,7 @@ import org.apache.airavata.accountprovisioning.ConfigParam;
 import org.apache.airavata.accountprovisioning.SSHAccountProvisioner;
 import org.apache.airavata.accountprovisioning.SSHAccountProvisionerProvider;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -31,8 +32,24 @@ public class IULdapSSHAccountProvisionerProvider implements SSHAccountProvisione
 
     @Override
     public List<ConfigParam> getConfigParams() {
-        // TODO: implement
-        return null;
+        List<ConfigParam> configParams = new ArrayList<>();
+        configParams.add(new ConfigParam("ldap-host")
+                .setDescription("Hostname of LDAP server")
+                .setOptional(false)
+                .setType(ConfigParam.ConfigParamType.STRING));
+        configParams.add(new ConfigParam("ldap-port")
+                .setDescription("Port of LDAP server")
+                .setOptional(false)
+                .setType(ConfigParam.ConfigParamType.STRING));
+        configParams.add(new ConfigParam("ldap-username")
+                .setDescription("Username for LDAP server")
+                .setOptional(false)
+                .setType(ConfigParam.ConfigParamType.STRING));
+        configParams.add(new ConfigParam("ldap-password")
+                .setDescription("Password for LDAP server")
+                .setOptional(false)
+                .setType(ConfigParam.ConfigParamType.CRED_STORE_PASSWORD_TOKEN));
+        return configParams;
     }
 
     @Override
@@ -41,4 +58,14 @@ public class IULdapSSHAccountProvisionerProvider implements SSHAccountProvisione
         sshAccountProvisioner.init(config);
         return sshAccountProvisioner;
     }
+
+    @Override
+    public boolean canCreateAccount() {
+        return false;
+    }
+
+    @Override
+    public boolean canInstallSSHKey() {
+        return true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactoryTest.java
b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactoryTest.java
index 466896e..89e9ff7 100644
--- a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactoryTest.java
+++ b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/SSHAccountProvisionerFactoryTest.java
@@ -27,13 +27,15 @@ import org.junit.Test;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 public class SSHAccountProvisionerFactoryTest {
 
     @Test
     public void testGetSSHAccountProvisionerImplementationNames() {
 
-        List<String> sshAccountProvisionerNames = SSHAccountProvisionerFactory.getSSHAccountProvisionerImplementationNames();
+        List<SSHAccountProvisionerProvider> sshAccountProvisionerProviders = SSHAccountProvisionerFactory.getSSHAccountProvisionerProviders();
+        List<String> sshAccountProvisionerNames = sshAccountProvisionerProviders.stream().map(SSHAccountProvisionerProvider::getName).collect(Collectors.toList());
         Assert.assertTrue("names should contain TestSSHAccountProvisioner", sshAccountProvisionerNames.contains("TestSSHAccountProvisioner"));
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
index d2ef213..f47552f 100644
--- a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
+++ b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
@@ -41,21 +41,11 @@ public class TestSSHAccountProvisioner implements SSHAccountProvisioner
{
     }
 
     @Override
-    public boolean canCreateAccount() {
-        return false;
-    }
-
-    @Override
     public void createAccount(String username, String sshPublicKey) {
 
     }
 
     @Override
-    public boolean canInstallSSHKey() {
-        return false;
-    }
-
-    @Override
     public void installSSHKey(String username, String sshPublicKey) {
 
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisionerProvider.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisionerProvider.java
b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisionerProvider.java
index 65fcfe5..a8d2cb5 100644
--- a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisionerProvider.java
+++ b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisionerProvider.java
@@ -63,4 +63,14 @@ public class TestSSHAccountProvisionerProvider implements SSHAccountProvisionerP
         sshAccountProvisioner.init(config);
         return sshAccountProvisioner;
     }
+
+    @Override
+    public boolean canCreateAccount() {
+        return false;
+    }
+
+    @Override
+    public boolean canInstallSSHKey() {
+        return true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
index e06c234..1eb7b95 100644
--- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
+++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
@@ -2950,13 +2950,7 @@ service Airavata {
               3: airavata_errors.AiravataSystemException ase,
               4: airavata_errors.AuthorizationException ae)
 
-  list<account_provisioning_model.SSHAccountProvisioner> getSSHAccountProvisionerNames(1:
required security_model.AuthzToken authzToken)
-    	throws (1: airavata_errors.InvalidRequestException ire,
-              2: airavata_errors.AiravataClientException ace,
-              3: airavata_errors.AiravataSystemException ase,
-              4: airavata_errors.AuthorizationException ae)
-
-  list<account_provisioning_model.SSHAccountProvisionerConfigParam> getSSHAccountProvisionerConfigParams(1:
required security_model.AuthzToken authzToken, 2: required string provisionerName)
+  list<account_provisioning_model.SSHAccountProvisioner> getSSHAccountProvisioners(1:
required security_model.AuthzToken authzToken)
     	throws (1: airavata_errors.InvalidRequestException ire,
               2: airavata_errors.AiravataClientException ace,
               3: airavata_errors.AiravataSystemException ase,
@@ -2966,7 +2960,7 @@ service Airavata {
    * Check if user has an SSH account on the given compute resource. This
    * method will only work if the compute resource has an SSHAccountProvisioner configured
for it.
    */
-  bool doesUserHaveSSHAccount(1: required security_model.AuthzToken authzToken, 2: required
string computeResourceId, 3: required string username)
+  bool doesUserHaveSSHAccount(1: required security_model.AuthzToken authzToken, 2: required
string computeResourceId, 3: required string userId)
     	throws (1: airavata_errors.InvalidRequestException ire,
               2: airavata_errors.AiravataClientException ace,
               3: airavata_errors.AiravataSystemException ase,
@@ -2979,7 +2973,7 @@ service Airavata {
    * call addUserComputeResourcePreference to persist it.
    */
   user_resource_profile_model.UserComputeResourcePreference setupUserComputeResourcePreferencesForSSH(1:
required security_model.AuthzToken authzToken,
-            2: required string computeResourceId, 3: required string username, 4: required
string airavataCredStoreToken)
+            2: required string computeResourceId, 3: required string userId, 4: required
string airavataCredStoreToken)
     	throws (1: airavata_errors.InvalidRequestException ire,
               2: airavata_errors.AiravataClientException ace,
               3: airavata_errors.AiravataSystemException ase,

http://git-wip-us.apache.org/repos/asf/airavata/blob/02392dba/thrift-interface-descriptions/data-models/resource-catalog-models/account_provisioning_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/account_provisioning_model.thrift
b/thrift-interface-descriptions/data-models/resource-catalog-models/account_provisioning_model.thrift
index 245d295..d314f78 100644
--- a/thrift-interface-descriptions/data-models/resource-catalog-models/account_provisioning_model.thrift
+++ b/thrift-interface-descriptions/data-models/resource-catalog-models/account_provisioning_model.thrift
@@ -28,11 +28,6 @@ enum SSHAccountProvisionerConfigParamType {
     CRED_STORE_PASSWORD_TOKEN
 }
 
-struct SSHAccountProvisioner {
-    1: required string name;
-    2: required bool canCreateAccount;
-    3: required bool canInstallSSHKey;
-}
 
 struct SSHAccountProvisionerConfigParam {
     1: required string name;
@@ -40,3 +35,10 @@ struct SSHAccountProvisionerConfigParam {
     3: required bool isOptional = false;
     4: optional string description;
 }
+
+struct SSHAccountProvisioner {
+    1: required string name;
+    2: required bool canCreateAccount;
+    3: required bool canInstallSSHKey;
+    4: required list<SSHAccountProvisionerConfigParam> configParams;
+}


Mime
View raw message