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 2017/09/25 21:10:55 UTC

[01/12] airavata-php-gateway git commit: AIRAVATA-2500 Initial work to setup ssh accounts and display

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/AIRAVATA-2500 [created] f78e49e07


AIRAVATA-2500 Initial work to setup ssh accounts and display


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

Branch: refs/heads/AIRAVATA-2500
Commit: f6653e2e32dd1b263bbeb97ad409d12ac5ed1c37
Parents: fa310a1
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Sep 7 13:12:00 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Thu Sep 7 15:29:39 2017 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php           |  7 +-
 app/libraries/CRUtilities.php                   |  5 ++
 app/libraries/URPUtilities.php                  | 71 ++++++++++++++++++++
 app/views/account/dashboard.blade.php           |  3 +
 .../auto-provisioned-accounts.blade.php         | 50 ++++++++++++++
 5 files changed, 134 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f6653e2e/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index f9ea073..734e823 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -294,12 +294,15 @@ class AccountController extends BaseController
             umask($old_umask);
         }
 
+        $auto_provisioned_accounts = URPUtilities::setup_auto_provisioned_accounts();
+        Log::debug("auto_provisioned_accounts", array($auto_provisioned_accounts));
+
         if(Session::has("admin") || Session::has("admin-read-only") || Session::has("gateway-provider")){
             return Redirect::to("admin/dashboard". "?status=ok&code=".$accessToken . "&username=".$username
-                . "&refresh_code=" . $refreshToken . "&valid_time=" . $validTime);
+                . "&refresh_code=" . $refreshToken . "&valid_time=" . $validTime)->with("auto_provisioned_accounts", $auto_provisioned_accounts);
         }else{
             return Redirect::to("account/dashboard". "?status=ok&code=".$accessToken ."&username=".$username
-                . "&refresh_code=" . $refreshToken . "&valid_time=" . $validTime);
+                . "&refresh_code=" . $refreshToken . "&valid_time=" . $validTime)->with("auto_provisioned_accounts", $auto_provisioned_accounts);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f6653e2e/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index 3643e72..8a815a1 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -544,6 +544,11 @@ class CRUtilities
         return $gateways;
     }
 
+    public static function getGatewayResourceProfile()
+    {
+        return Airavata::getGatewayResourceProfile( Session::get('authz-token'), Session::get("gateway_id"));
+    }
+
     public static function updateGatewayProfile( $data){
         $gatewayResourceProfile = Airavata::getGatewayResourceProfile( Session::get('authz-token'), $data["gateway_id"]);
         $gatewayResourceProfile->credentialStoreToken = $data["cst"];

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f6653e2e/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 8632d59..906861a 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -161,6 +161,77 @@ class URPUtilities
         $gatewayId = Session::get('gateway_id');
         Airavata::deleteUserResourceProfile(Session::get('authz-token'), $userId, $gatewayId);
     }
+
+    /**
+     * Returns an array with compute resource ids as the key and each entry is a 
+     * map with the following fields:
+     * * hostname: hostname of compute resource
+     * * userComputeResourcePreference: if UserComputeResourcePreference exists for compute resource or was able to be created
+     * * accountExists: (boolean) whether user account exists on cluster
+     * * additionalInfo: Additional info field from ComputeResourcePreference
+     * * errorMessage: Error message associated with trying to setup account
+     */
+    public static function setup_auto_provisioned_accounts()
+    {
+        $results = array();
+        $gatewayResourceProfile = CRUtilities::getGatewayResourceProfile();
+        $computeResourcePreferences = $gatewayResourceProfile->computeResourcePreferences;
+        $userComputeResourcePreferences = URPUtilities::get_all_user_compute_resource_prefs();
+        $sshAccountProvisioners = URPUtilities::get_ssh_account_provisioners();
+        $userId = Session::get("username");
+        $gatewayId = Session::get("gateway_id");
+        foreach( $computeResourcePreferences as $computeResourcePreference)
+        {
+            if( !empty($computeResourcePreference->sshAccountProvisioner))
+            {
+                $sshAccountProvisioner = $sshAccountProvisioners[$computeResourcePreference->sshAccountProvisioner];
+                $computeResourceId = $computeResourcePreference->computeResourceId;
+                $computeResource = CRUtilities::get_compute_resource($computeResourceId);
+                $hostname = $computeResource->hostName;
+                $userComputeResourcePreference = null;
+                if( array_key_exists($computeResourceId, $userComputeResourcePreferences)) {
+                    $userComputeResourcePreference = $userComputeResourcePreferences[$computeResourceId];
+                    $accountExists = true;
+                } else if ($sshAccountProvisioner->canCreateAccount) {
+                    $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
+                    $accountExists = true;
+                } else if (Airavata::doesUserHaveSSHAccount(Session::get('authz-token'), $computeResourceId, $userId)) {
+                    $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
+                    $accountExists = true;
+                } else {
+                    $accountExists = false;
+                }
+                $results[] = array(
+                    "hostname" => $hostname,
+                    "userComputeResourcePreference" => $userComputeResourcePreference,
+                    "accountExists" => $accountExists,
+                    "additionalInfo" => "TODO",
+                    "errorMessage" => "TODO"
+                );
+            }
+        }
+
+        return $results;
+    }
+
+    private static function get_ssh_account_provisioners()
+    {
+        $sshAccountProvisionersByName = array();
+        $sshAccountProvisioners = Airavata::getSSHAccountProvisioners(Session::get('authz-token'));
+        foreach ($sshAccountProvisioners as $sshAccountProvisioner) {
+            $sshAccountProvisionersByName[$sshAccountProvisioner->name] = $sshAccountProvisioner;
+        }
+        return $sshAccountProvisionersByName;
+    }
+
+    private static function setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname)
+    {
+        $credentialStoreToken = AdminUtilities::create_ssh_token_for_user("SSH Key for " . $hostname);
+        // TODO: add error handling if setup fails
+        $userComputeResourcePreference = Airavata::setupUserComputeResourcePreferencesForSSH(Session::get('authz-token'), $computeResourceId, $userId, $credentialStoreToken);
+        $result = Airavata::addUserComputeResourcePreference(Session::get('authz-token'), $userId, $gatewayId, $computeResourceId, $userComputeResourcePreference);
+        return $userComputeResourcePreference;
+    }
 }
 
 ?>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f6653e2e/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index 45abfa6..66e2241 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -225,6 +225,9 @@
             <h1>Gateway: {{Session::get("gateway_id")}}</h1>
             <h3>Let's get started!</h3>
         </div>
+        @if (Session::has('auto_provisioned_accounts'))
+            @include('partials/auto-provisioned-accounts', array("auto_provisioned_accounts" => Session::get('auto_provisioned_accounts')))
+        @endif
         <div class="row text-center admin-options">
 
             <div class="row well">

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f6653e2e/app/views/partials/auto-provisioned-accounts.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/auto-provisioned-accounts.blade.php b/app/views/partials/auto-provisioned-accounts.blade.php
new file mode 100644
index 0000000..78c9648
--- /dev/null
+++ b/app/views/partials/auto-provisioned-accounts.blade.php
@@ -0,0 +1,50 @@
+
+<div class="row">
+    <div class="panel panel-default">
+        <div class="panel-heading">
+            <h3 class="panel-title">Automatically Configured Accounts</h3>
+        </div>
+        <div class="panel-body">
+            <p>
+                The following displays the results from attempting to
+                automatically configure your account on the following
+                cluster(s). All successfully configured accounts can be used
+                from this gateway.
+            </p>
+            <table class="table">
+                <thead>
+                    <tr>
+                        <th>Status</th>
+                        <th>Hostname</th>
+                        <th>Additional Info</th>
+                        <th>Error Message</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach ($auto_provisioned_accounts as $auto_provisioned_account)
+                        <td>
+                            @if ($auto_provisioned_account["errorMessage"] != null)
+                                <span class="glyphicon glyphicon-warning-sign" style="color: red;"></span> FAILED
+                                <p>
+                                    <small>See <strong>Error Message</strong> for more information and contact Gateway Admin for help.</small>
+                                </p>
+                            @elseif ($auto_provisioned_account["accountExists"] === false)
+                                <span class="glyphicon glyphicon-user" style="color: red;"></span> ACCOUNT MISSING
+                                <p>
+                                    <small>See <strong>Additional Info</strong> for more information on how to create your account on {{{ $auto_provisioned_account["hostname"]}}}.</small>
+                                </p>
+                            @elseif ($auto_provisioned_account["userComputeResourcePreference"] != null)
+                                <span class="glyphicon glyphicon-ok" style="color: green;"></span> OK
+                            @else
+                                <span class="glyphicon glyphicon-question-sign" style="color: grey;"></span> UNKNOWN
+                            @endif
+                        </td>
+                        <td>{{{ $auto_provisioned_account["hostname"] }}}</td>
+                        {{-- Not escaping HTML to allow Gateway Admin to put HTML into additionalInfo field --}}
+                        <td>{{ $auto_provisioned_account["additionalInfo"] }}</td>
+                        <td>{{{ $auto_provisioned_account["errorMessage"] }}}</td>
+                    @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
\ No newline at end of file


[11/12] airavata-php-gateway git commit: AIRAVATA-2500 Thrift stub code generation

Posted by ma...@apache.org.
AIRAVATA-2500 Thrift stub code generation


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/4727617a
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/4727617a
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/4727617a

Branch: refs/heads/AIRAVATA-2500
Commit: 4727617a70ffc190f1a2ffd388848d934534c24d
Parents: 8a3b0ad
Author: Marcus Christie <ma...@iu.edu>
Authored: Mon Sep 25 16:20:25 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Mon Sep 25 16:20:25 2017 -0400

----------------------------------------------------------------------
 app/libraries/Airavata/API/Airavata.php         | 10 +++++++
 .../AppCatalog/UserResourceProfile/Types.php    | 28 ++++++++++++++++++++
 2 files changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4727617a/app/libraries/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/API/Airavata.php b/app/libraries/Airavata/API/Airavata.php
index c8976ba..a22ef84 100644
--- a/app/libraries/Airavata/API/Airavata.php
+++ b/app/libraries/Airavata/API/Airavata.php
@@ -3485,6 +3485,11 @@ interface AiravataIf {
    *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
    *   default credential store.
    * 
+   * validated:
+   *  If true the the configuration has been validated in the sense that the username and credential can be used to
+   *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+   *  Should be treated as read-only and only mutated by Airavata middleware.
+   * 
    * 
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
@@ -3717,6 +3722,11 @@ interface AiravataIf {
    *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
    *   default credential store.
    * 
+   * validated:
+   *  If true the the configuration has been validated in the sense that the username and credential can be used to
+   *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+   *  Should be treated as read-only and only mutated by Airavata middleware.
+   * 
    * 
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4727617a/app/libraries/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/AppCatalog/UserResourceProfile/Types.php b/app/libraries/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
index 8ab78a0..c4a0a9c 100644
--- a/app/libraries/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
+++ b/app/libraries/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
@@ -43,6 +43,11 @@ use Thrift\Exception\TApplicationException;
  *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
  *   default credential store.
  * 
+ * validated:
+ *  If true the the configuration has been validated in the sense that the username and credential can be used to
+ *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+ *  Should be treated as read-only and only mutated by Airavata middleware.
+ * 
  */
 class UserComputeResourcePreference {
   static $_TSPEC;
@@ -87,6 +92,10 @@ class UserComputeResourcePreference {
    * @var int
    */
   public $reservationEndTime = null;
+  /**
+   * @var bool
+   */
+  public $validated = false;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -131,6 +140,10 @@ class UserComputeResourcePreference {
           'var' => 'reservationEndTime',
           'type' => TType::I64,
           ),
+        11 => array(
+          'var' => 'validated',
+          'type' => TType::BOOL,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -164,6 +177,9 @@ class UserComputeResourcePreference {
       if (isset($vals['reservationEndTime'])) {
         $this->reservationEndTime = $vals['reservationEndTime'];
       }
+      if (isset($vals['validated'])) {
+        $this->validated = $vals['validated'];
+      }
     }
   }
 
@@ -256,6 +272,13 @@ class UserComputeResourcePreference {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 11:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->validated);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -319,6 +342,11 @@ class UserComputeResourcePreference {
       $xfer += $output->writeI64($this->reservationEndTime);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->validated !== null) {
+      $xfer += $output->writeFieldBegin('validated', TType::BOOL, 11);
+      $xfer += $output->writeBool($this->validated);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;


[10/12] airavata-php-gateway git commit: AIRAVATA-2500 Using validated flag on UserComputeResourcePref

Posted by ma...@apache.org.
AIRAVATA-2500 Using validated flag on UserComputeResourcePref


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/8a3b0ad0
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/8a3b0ad0
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/8a3b0ad0

Branch: refs/heads/AIRAVATA-2500
Commit: 8a3b0ad0458c1ce132afb1a37f45ab9610095110
Parents: 20db67c
Author: Marcus Christie <ma...@iu.edu>
Authored: Mon Sep 25 16:19:43 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Mon Sep 25 16:19:43 2017 -0400

----------------------------------------------------------------------
 app/controllers/AccountController.php           |  2 +-
 app/controllers/ExperimentController.php        |  4 +-
 app/libraries/ExperimentUtilities.php           |  2 +-
 app/libraries/URPUtilities.php                  | 56 ++++++++++++++------
 .../auto-provisioned-accounts.blade.php         |  4 +-
 5 files changed, 47 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8a3b0ad0/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 734e823..3bf9e0c 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -295,7 +295,7 @@ class AccountController extends BaseController
         }
 
         $auto_provisioned_accounts = URPUtilities::setup_auto_provisioned_accounts();
-        Log::debug("auto_provisioned_accounts", array($auto_provisioned_accounts));
+        // Log::debug("auto_provisioned_accounts", array($auto_provisioned_accounts));
 
         if(Session::has("admin") || Session::has("admin-read-only") || Session::has("gateway-provider")){
             return Redirect::to("admin/dashboard". "?status=ok&code=".$accessToken . "&username=".$username

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8a3b0ad0/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 131fa1d..dadfb29 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -318,7 +318,7 @@ class ExperimentController extends BaseController
 
         $computeResources = CRUtilities::create_compute_resources_select($experiment->executionId, $expVal['scheduling']->resourceHostId);
 
-        $userComputeResourcePreferences = URPUtilities::get_all_user_compute_resource_prefs();
+        $userComputeResourcePreferences = URPUtilities::get_all_validated_user_compute_resource_prefs();
         $userHasComputeResourcePreference = array_key_exists($expVal['scheduling']->resourceHostId, $userComputeResourcePreferences);
 
         $experimentInputs = array(
@@ -459,7 +459,7 @@ class ExperimentController extends BaseController
         );
 
         $queues = ExperimentUtilities::getQueueDatafromResourceId($computeResourceId);
-        $userComputeResourcePreferences = URPUtilities::get_all_user_compute_resource_prefs();
+        $userComputeResourcePreferences = URPUtilities::get_all_validated_user_compute_resource_prefs();
         $userHasComputeResourcePreference = array_key_exists($computeResourceId, $userComputeResourcePreferences);
         if ($userHasComputeResourcePreference)
         {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8a3b0ad0/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 9424893..ab91a3b 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -691,7 +691,7 @@ class ExperimentUtilities
             if ($experiment->userConfigurationData->useUserCRPref){
                 // Check if this user has a user CR preference for the compute
                 // resource, if not we want to switch this flag to false
-                $userComputeResourcePreferences = URPUtilities::get_all_user_compute_resource_prefs();
+                $userComputeResourcePreferences = URPUtilities::get_all_validated_user_compute_resource_prefs();
                 $userHasComputeResourcePreference = array_key_exists($computeResourceId, $userComputeResourcePreferences);
                 $experiment->userConfigurationData->useUserCRPref = $userHasComputeResourcePreference;
             }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8a3b0ad0/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 27b4c67..c65197b 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -86,6 +86,8 @@ class URPUtilities
             $inputs["reservationEndTime"] = CommonUtilities::convertLocalToUTC(strtotime($inputs["reservationEndTime"])) * 1000;
 
         $userComputeResourcePreference = new UserComputeResourcePreference($inputs);
+        // FIXME: for now assume that if a user is adding or updating a UserComputeResourcePreference then they have also validated that it works. It would be better to confirm that in Airavata.
+        $userComputeResourcePreference->validated = true;
         // Log::debug("add_or_update_user_CRP: ", array($userComputeResourcePreference));
         $userId = Session::get('username');
         if ($update)
@@ -107,9 +109,17 @@ class URPUtilities
     }
 
     /*
-     * Get all user's compute resource preferences, keyed by compute resource id.
+     * Get all user's *validated* compute resource preferences, keyed by compute resource id.
      */
-    public static function get_all_user_compute_resource_prefs()
+    public static function get_all_validated_user_compute_resource_prefs()
+    {
+
+        return array_filter(URPUtilities::get_all_user_compute_resource_prefs(), function($userComputeResourcePreference) {
+            return $userComputeResourcePreference->validated;
+        });
+    }
+
+    private static function get_all_user_compute_resource_prefs()
     {
 
         $userComputeResourcePreferencesById = array();
@@ -167,7 +177,7 @@ class URPUtilities
      * map with the following fields:
      * * hostname: hostname of compute resource
      * * userComputeResourcePreference: if UserComputeResourcePreference exists for compute resource or was able to be created
-     * * accountExists: (boolean) whether user account exists on cluster
+     * * accountIsMissing: (boolean) true if account doesn't exist on cluster and needs to be created manually (or by some other process)
      * * additionalInfo: Additional info field from ComputeResourcePreference
      * * errorMessage: Error message associated with trying to setup account
      */
@@ -190,27 +200,32 @@ class URPUtilities
                 $hostname = $computeResource->hostName;
                 $userComputeResourcePreference = null;
                 $errorMessage = null;
-                $accountExists = false;
+                $accountIsMissing = false;
                 try {
                     if( array_key_exists($computeResourceId, $userComputeResourcePreferences)) {
                         $userComputeResourcePreference = $userComputeResourcePreferences[$computeResourceId];
-                        $accountExists = true;
+                        // If a $userComputeResourcePreference exists but isn't
+                        // validated some error must have occurred the last time
+                        // it was attempted to be setup. We'll try to set it up again.
+                        if (!$userComputeResourcePreference->validated) {
+                            $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname, $userComputeResourcePreference);
+                        }
                     } else if ($sshAccountProvisioner->canCreateAccount) {
                         $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
-                        $accountExists = true;
                     } else if (Airavata::doesUserHaveSSHAccount(Session::get('authz-token'), $computeResourceId, $userId)) {
                         $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
-                        $accountExists = true;
+                    } else {
+                        $accountIsMissing = true;
                     }
                 } catch (Exception $ex) {
-                    Log::error("Failed to setup SSH Account for " . $userId . " on $hostname");
+                    Log::error("Failed to setup SSH Account for " . $userId . " on " . $hostname);
                     Log::error($ex);
                     $errorMessage = $ex->getMessage();
                 }
                 $results[] = array(
                     "hostname" => $hostname,
                     "userComputeResourcePreference" => $userComputeResourcePreference,
-                    "accountExists" => $accountExists,
+                    "accountIsMissing" => $accountIsMissing,
                     "additionalInfo" => $computeResourcePreference->sshAccountProvisionerAdditionalInfo,
                     "errorMessage" => $errorMessage
                 );
@@ -230,13 +245,24 @@ class URPUtilities
         return $sshAccountProvisionersByName;
     }
 
-    private static function setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname)
+    private static function setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname, $userComputeResourcePreference=null)
     {
-        $credentialStoreToken = AdminUtilities::create_ssh_token_for_user("SSH Key for " . $hostname);
-        // TODO: add error handling if setup fails
-        $userComputeResourcePreference = Airavata::setupUserComputeResourcePreferencesForSSH(Session::get('authz-token'), $computeResourceId, $userId, $credentialStoreToken);
-        $result = Airavata::addUserComputeResourcePreference(Session::get('authz-token'), $userId, $gatewayId, $computeResourceId, $userComputeResourcePreference);
-        return $userComputeResourcePreference;
+        if (empty($userComputeResourcePreference)) {
+            Log::debug("userComputeResourcePreference is empty", array($userComputeResourcePreference));
+            // Initially create a UserComputeResourcePreference record to store
+            // the key. This will be marked validated=false initially until it
+            // is successfully setup. This way in case an error occurs we have a
+            // record of the generated SSH key to use and can try again later.
+            $userComputeResourcePreference = new UserComputeResourcePreference();
+            $userComputeResourcePreference->computeResourceId = $computeResourceId;
+            $credentialStoreToken = AdminUtilities::create_ssh_token_for_user("SSH Key for " . $hostname);
+            $userComputeResourcePreference->resourceSpecificCredentialStoreToken = $credentialStoreToken;
+            Airavata::addUserComputeResourcePreference(Session::get('authz-token'), $userId, $gatewayId, $computeResourceId, $userComputeResourcePreference);
+        }
+        $updatedUserCompResourcePref = Airavata::setupUserComputeResourcePreferencesForSSH(Session::get('authz-token'), $computeResourceId, $userId, $userComputeResourcePreference->resourceSpecificCredentialStoreToken);
+        $updatedUserCompResourcePref->resourceSpecificCredentialStoreToken = $userComputeResourcePreference->resourceSpecificCredentialStoreToken;
+        Airavata::updateUserComputeResourcePreference(Session::get('authz-token'), $userId, $gatewayId, $computeResourceId, $updatedUserCompResourcePref);
+        return $updatedUserCompResourcePref;
     }
 }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8a3b0ad0/app/views/partials/auto-provisioned-accounts.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/auto-provisioned-accounts.blade.php b/app/views/partials/auto-provisioned-accounts.blade.php
index 5f56aa3..e10fc32 100644
--- a/app/views/partials/auto-provisioned-accounts.blade.php
+++ b/app/views/partials/auto-provisioned-accounts.blade.php
@@ -29,12 +29,12 @@
                                     <p>
                                         <small>See <strong>Error Message</strong> for more information and contact Gateway Admin for help.</small>
                                     </p>
-                                @elseif ($auto_provisioned_account["accountExists"] === false)
+                                @elseif ($auto_provisioned_account["accountIsMissing"] === true)
                                     <span class="glyphicon glyphicon-user" style="color: red;"></span> ACCOUNT MISSING
                                     <p>
                                         <small>See <strong>Additional Info</strong> for more information on how to create your account on {{{ $auto_provisioned_account["hostname"]}}}.</small>
                                     </p>
-                                @elseif ($auto_provisioned_account["userComputeResourcePreference"] != null)
+                                @elseif ($auto_provisioned_account["userComputeResourcePreference"] != null && $auto_provisioned_account["userComputeResourcePreference"]->validated)
                                     <span class="glyphicon glyphicon-ok" style="color: green;"></span> OK
                                 @else
                                     <span class="glyphicon glyphicon-question-sign" style="color: grey;"></span> UNKNOWN


[02/12] airavata-php-gateway git commit: AIRAVATA-2500 Thrift stub code generation

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cf2eae7e/app/libraries/Airavata/Model/AppCatalog/AccountProvisioning/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/AppCatalog/AccountProvisioning/Types.php b/app/libraries/Airavata/Model/AppCatalog/AccountProvisioning/Types.php
new file mode 100644
index 0000000..541abd8
--- /dev/null
+++ b/app/libraries/Airavata/Model/AppCatalog/AccountProvisioning/Types.php
@@ -0,0 +1,345 @@
+<?php
+namespace Airavata\Model\AppCatalog\AccountProvisioning;
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+final class SSHAccountProvisionerConfigParamType {
+  const STRING = 0;
+  const CRED_STORE_PASSWORD_TOKEN = 1;
+  static public $__names = array(
+    0 => 'STRING',
+    1 => 'CRED_STORE_PASSWORD_TOKEN',
+  );
+}
+
+class SSHAccountProvisionerConfigParam {
+  static $_TSPEC;
+
+  /**
+   * @var string
+   */
+  public $name = null;
+  /**
+   * @var int
+   */
+  public $type =   0;
+  /**
+   * @var bool
+   */
+  public $isOptional = false;
+  /**
+   * @var string
+   */
+  public $description = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'name',
+          'type' => TType::STRING,
+          ),
+        2 => array(
+          'var' => 'type',
+          'type' => TType::I32,
+          ),
+        3 => array(
+          'var' => 'isOptional',
+          'type' => TType::BOOL,
+          ),
+        4 => array(
+          'var' => 'description',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['name'])) {
+        $this->name = $vals['name'];
+      }
+      if (isset($vals['type'])) {
+        $this->type = $vals['type'];
+      }
+      if (isset($vals['isOptional'])) {
+        $this->isOptional = $vals['isOptional'];
+      }
+      if (isset($vals['description'])) {
+        $this->description = $vals['description'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'SSHAccountProvisionerConfigParam';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 1:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->name);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::I32) {
+            $xfer += $input->readI32($this->type);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->isOptional);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->description);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('SSHAccountProvisionerConfigParam');
+    if ($this->name !== null) {
+      $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
+      $xfer += $output->writeString($this->name);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->type !== null) {
+      $xfer += $output->writeFieldBegin('type', TType::I32, 2);
+      $xfer += $output->writeI32($this->type);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->isOptional !== null) {
+      $xfer += $output->writeFieldBegin('isOptional', TType::BOOL, 3);
+      $xfer += $output->writeBool($this->isOptional);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->description !== null) {
+      $xfer += $output->writeFieldBegin('description', TType::STRING, 4);
+      $xfer += $output->writeString($this->description);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+class SSHAccountProvisioner {
+  static $_TSPEC;
+
+  /**
+   * @var string
+   */
+  public $name = null;
+  /**
+   * @var bool
+   */
+  public $canCreateAccount = null;
+  /**
+   * @var bool
+   */
+  public $canInstallSSHKey = null;
+  /**
+   * @var \Airavata\Model\AppCatalog\AccountProvisioning\SSHAccountProvisionerConfigParam[]
+   */
+  public $configParams = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'name',
+          'type' => TType::STRING,
+          ),
+        2 => array(
+          'var' => 'canCreateAccount',
+          'type' => TType::BOOL,
+          ),
+        3 => array(
+          'var' => 'canInstallSSHKey',
+          'type' => TType::BOOL,
+          ),
+        4 => array(
+          'var' => 'configParams',
+          'type' => TType::LST,
+          'etype' => TType::STRUCT,
+          'elem' => array(
+            'type' => TType::STRUCT,
+            'class' => '\Airavata\Model\AppCatalog\AccountProvisioning\SSHAccountProvisionerConfigParam',
+            ),
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['name'])) {
+        $this->name = $vals['name'];
+      }
+      if (isset($vals['canCreateAccount'])) {
+        $this->canCreateAccount = $vals['canCreateAccount'];
+      }
+      if (isset($vals['canInstallSSHKey'])) {
+        $this->canInstallSSHKey = $vals['canInstallSSHKey'];
+      }
+      if (isset($vals['configParams'])) {
+        $this->configParams = $vals['configParams'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'SSHAccountProvisioner';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 1:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->name);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->canCreateAccount);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->canInstallSSHKey);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::LST) {
+            $this->configParams = array();
+            $_size0 = 0;
+            $_etype3 = 0;
+            $xfer += $input->readListBegin($_etype3, $_size0);
+            for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
+            {
+              $elem5 = null;
+              $elem5 = new \Airavata\Model\AppCatalog\AccountProvisioning\SSHAccountProvisionerConfigParam();
+              $xfer += $elem5->read($input);
+              $this->configParams []= $elem5;
+            }
+            $xfer += $input->readListEnd();
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('SSHAccountProvisioner');
+    if ($this->name !== null) {
+      $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
+      $xfer += $output->writeString($this->name);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->canCreateAccount !== null) {
+      $xfer += $output->writeFieldBegin('canCreateAccount', TType::BOOL, 2);
+      $xfer += $output->writeBool($this->canCreateAccount);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->canInstallSSHKey !== null) {
+      $xfer += $output->writeFieldBegin('canInstallSSHKey', TType::BOOL, 3);
+      $xfer += $output->writeBool($this->canInstallSSHKey);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->configParams !== null) {
+      if (!is_array($this->configParams)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('configParams', TType::LST, 4);
+      {
+        $output->writeListBegin(TType::STRUCT, count($this->configParams));
+        {
+          foreach ($this->configParams as $iter6)
+          {
+            $xfer += $iter6->write($output);
+          }
+        }
+        $output->writeListEnd();
+      }
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cf2eae7e/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php b/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
index f0b329d..da3071a 100644
--- a/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
+++ b/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
@@ -110,6 +110,14 @@ class ComputeResourcePreference {
    * @var int
    */
   public $reservationEndTime = null;
+  /**
+   * @var string
+   */
+  public $sshAccountProvisioner = null;
+  /**
+   * @var array
+   */
+  public $sshAccountProvisionerConfig = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -170,6 +178,22 @@ class ComputeResourcePreference {
           'var' => 'reservationEndTime',
           'type' => TType::I64,
           ),
+        15 => array(
+          'var' => 'sshAccountProvisioner',
+          'type' => TType::STRING,
+          ),
+        16 => array(
+          'var' => 'sshAccountProvisionerConfig',
+          'type' => TType::MAP,
+          'ktype' => TType::STRING,
+          'vtype' => TType::STRING,
+          'key' => array(
+            'type' => TType::STRING,
+          ),
+          'val' => array(
+            'type' => TType::STRING,
+            ),
+          ),
         );
     }
     if (is_array($vals)) {
@@ -215,6 +239,12 @@ class ComputeResourcePreference {
       if (isset($vals['reservationEndTime'])) {
         $this->reservationEndTime = $vals['reservationEndTime'];
       }
+      if (isset($vals['sshAccountProvisioner'])) {
+        $this->sshAccountProvisioner = $vals['sshAccountProvisioner'];
+      }
+      if (isset($vals['sshAccountProvisionerConfig'])) {
+        $this->sshAccountProvisionerConfig = $vals['sshAccountProvisionerConfig'];
+      }
     }
   }
 
@@ -335,6 +365,33 @@ class ComputeResourcePreference {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 15:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->sshAccountProvisioner);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 16:
+          if ($ftype == TType::MAP) {
+            $this->sshAccountProvisionerConfig = array();
+            $_size0 = 0;
+            $_ktype1 = 0;
+            $_vtype2 = 0;
+            $xfer += $input->readMapBegin($_ktype1, $_vtype2, $_size0);
+            for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
+            {
+              $key5 = '';
+              $val6 = '';
+              $xfer += $input->readString($key5);
+              $xfer += $input->readString($val6);
+              $this->sshAccountProvisionerConfig[$key5] = $val6;
+            }
+            $xfer += $input->readMapEnd();
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -418,6 +475,29 @@ class ComputeResourcePreference {
       $xfer += $output->writeI64($this->reservationEndTime);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->sshAccountProvisioner !== null) {
+      $xfer += $output->writeFieldBegin('sshAccountProvisioner', TType::STRING, 15);
+      $xfer += $output->writeString($this->sshAccountProvisioner);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->sshAccountProvisionerConfig !== null) {
+      if (!is_array($this->sshAccountProvisionerConfig)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('sshAccountProvisionerConfig', TType::MAP, 16);
+      {
+        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->sshAccountProvisionerConfig));
+        {
+          foreach ($this->sshAccountProvisionerConfig as $kiter7 => $viter8)
+          {
+            $xfer += $output->writeString($kiter7);
+            $xfer += $output->writeString($viter8);
+          }
+        }
+        $output->writeMapEnd();
+      }
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
@@ -711,15 +791,15 @@ class GatewayResourceProfile {
         case 3:
           if ($ftype == TType::LST) {
             $this->computeResourcePreferences = array();
-            $_size0 = 0;
-            $_etype3 = 0;
-            $xfer += $input->readListBegin($_etype3, $_size0);
-            for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
+            $_size9 = 0;
+            $_etype12 = 0;
+            $xfer += $input->readListBegin($_etype12, $_size9);
+            for ($_i13 = 0; $_i13 < $_size9; ++$_i13)
             {
-              $elem5 = null;
-              $elem5 = new \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference();
-              $xfer += $elem5->read($input);
-              $this->computeResourcePreferences []= $elem5;
+              $elem14 = null;
+              $elem14 = new \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference();
+              $xfer += $elem14->read($input);
+              $this->computeResourcePreferences []= $elem14;
             }
             $xfer += $input->readListEnd();
           } else {
@@ -729,15 +809,15 @@ class GatewayResourceProfile {
         case 4:
           if ($ftype == TType::LST) {
             $this->storagePreferences = array();
-            $_size6 = 0;
-            $_etype9 = 0;
-            $xfer += $input->readListBegin($_etype9, $_size6);
-            for ($_i10 = 0; $_i10 < $_size6; ++$_i10)
+            $_size15 = 0;
+            $_etype18 = 0;
+            $xfer += $input->readListBegin($_etype18, $_size15);
+            for ($_i19 = 0; $_i19 < $_size15; ++$_i19)
             {
-              $elem11 = null;
-              $elem11 = new \Airavata\Model\AppCatalog\GatewayProfile\StoragePreference();
-              $xfer += $elem11->read($input);
-              $this->storagePreferences []= $elem11;
+              $elem20 = null;
+              $elem20 = new \Airavata\Model\AppCatalog\GatewayProfile\StoragePreference();
+              $xfer += $elem20->read($input);
+              $this->storagePreferences []= $elem20;
             }
             $xfer += $input->readListEnd();
           } else {
@@ -789,9 +869,9 @@ class GatewayResourceProfile {
       {
         $output->writeListBegin(TType::STRUCT, count($this->computeResourcePreferences));
         {
-          foreach ($this->computeResourcePreferences as $iter12)
+          foreach ($this->computeResourcePreferences as $iter21)
           {
-            $xfer += $iter12->write($output);
+            $xfer += $iter21->write($output);
           }
         }
         $output->writeListEnd();
@@ -806,9 +886,9 @@ class GatewayResourceProfile {
       {
         $output->writeListBegin(TType::STRUCT, count($this->storagePreferences));
         {
-          foreach ($this->storagePreferences as $iter13)
+          foreach ($this->storagePreferences as $iter22)
           {
-            $xfer += $iter13->write($output);
+            $xfer += $iter22->write($output);
           }
         }
         $output->writeListEnd();

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cf2eae7e/app/libraries/Airavata/Model/Tenant/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/Tenant/Types.php b/app/libraries/Airavata/Model/Tenant/Types.php
index b217adf..c1ad4ec 100644
--- a/app/libraries/Airavata/Model/Tenant/Types.php
+++ b/app/libraries/Airavata/Model/Tenant/Types.php
@@ -38,77 +38,314 @@ final class TenantApprovalStatus {
   );
 }
 
-class Tenant {
+class TenantPreferences {
   static $_TSPEC;
 
   /**
    * @var string
    */
-  public $tenantId = null;
+  public $tenantAdminFirstName = null;
   /**
-   * @var int
+   * @var string
    */
-  public $tenantApprovalStatus = null;
+  public $tenantAdminLastName = null;
   /**
    * @var string
    */
-  public $tenantName = null;
+  public $tenantAdminEmail = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        10 => array(
+          'var' => 'tenantAdminFirstName',
+          'type' => TType::STRING,
+          ),
+        11 => array(
+          'var' => 'tenantAdminLastName',
+          'type' => TType::STRING,
+          ),
+        12 => array(
+          'var' => 'tenantAdminEmail',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['tenantAdminFirstName'])) {
+        $this->tenantAdminFirstName = $vals['tenantAdminFirstName'];
+      }
+      if (isset($vals['tenantAdminLastName'])) {
+        $this->tenantAdminLastName = $vals['tenantAdminLastName'];
+      }
+      if (isset($vals['tenantAdminEmail'])) {
+        $this->tenantAdminEmail = $vals['tenantAdminEmail'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'TenantPreferences';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 10:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->tenantAdminFirstName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 11:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->tenantAdminLastName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 12:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->tenantAdminEmail);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('TenantPreferences');
+    if ($this->tenantAdminFirstName !== null) {
+      $xfer += $output->writeFieldBegin('tenantAdminFirstName', TType::STRING, 10);
+      $xfer += $output->writeString($this->tenantAdminFirstName);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->tenantAdminLastName !== null) {
+      $xfer += $output->writeFieldBegin('tenantAdminLastName', TType::STRING, 11);
+      $xfer += $output->writeString($this->tenantAdminLastName);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->tenantAdminEmail !== null) {
+      $xfer += $output->writeFieldBegin('tenantAdminEmail', TType::STRING, 12);
+      $xfer += $output->writeString($this->tenantAdminEmail);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+class TenantConfig {
+  static $_TSPEC;
+
   /**
    * @var string
    */
-  public $domain = null;
+  public $oauthClientId = null;
   /**
    * @var string
    */
-  public $emailAddress = null;
+  public $oauthClientSecret = null;
   /**
    * @var string
    */
-  public $tenantAcronym = null;
+  public $identityServerUserName = null;
   /**
    * @var string
    */
-  public $tenantURL = null;
+  public $identityServerPasswordToken = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        16 => array(
+          'var' => 'oauthClientId',
+          'type' => TType::STRING,
+          ),
+        17 => array(
+          'var' => 'oauthClientSecret',
+          'type' => TType::STRING,
+          ),
+        13 => array(
+          'var' => 'identityServerUserName',
+          'type' => TType::STRING,
+          ),
+        14 => array(
+          'var' => 'identityServerPasswordToken',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['oauthClientId'])) {
+        $this->oauthClientId = $vals['oauthClientId'];
+      }
+      if (isset($vals['oauthClientSecret'])) {
+        $this->oauthClientSecret = $vals['oauthClientSecret'];
+      }
+      if (isset($vals['identityServerUserName'])) {
+        $this->identityServerUserName = $vals['identityServerUserName'];
+      }
+      if (isset($vals['identityServerPasswordToken'])) {
+        $this->identityServerPasswordToken = $vals['identityServerPasswordToken'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'TenantConfig';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 16:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->oauthClientId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 17:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->oauthClientSecret);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 13:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->identityServerUserName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 14:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->identityServerPasswordToken);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('TenantConfig');
+    if ($this->identityServerUserName !== null) {
+      $xfer += $output->writeFieldBegin('identityServerUserName', TType::STRING, 13);
+      $xfer += $output->writeString($this->identityServerUserName);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->identityServerPasswordToken !== null) {
+      $xfer += $output->writeFieldBegin('identityServerPasswordToken', TType::STRING, 14);
+      $xfer += $output->writeString($this->identityServerPasswordToken);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->oauthClientId !== null) {
+      $xfer += $output->writeFieldBegin('oauthClientId', TType::STRING, 16);
+      $xfer += $output->writeString($this->oauthClientId);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->oauthClientSecret !== null) {
+      $xfer += $output->writeFieldBegin('oauthClientSecret', TType::STRING, 17);
+      $xfer += $output->writeString($this->oauthClientSecret);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+class Tenant {
+  static $_TSPEC;
+
   /**
    * @var string
    */
-  public $tenantPublicAbstract = null;
+  public $tenantId = null;
   /**
-   * @var string
+   * @var int
    */
-  public $reviewProposalDescription = null;
+  public $tenantApprovalStatus = null;
   /**
    * @var string
    */
-  public $tenantAdminFirstName = null;
+  public $tenantName = null;
   /**
    * @var string
    */
-  public $tenantAdminLastName = null;
+  public $domain = null;
   /**
    * @var string
    */
-  public $tenantAdminEmail = null;
+  public $emailAddress = null;
   /**
    * @var string
    */
-  public $identityServerUserName = null;
+  public $tenantAcronym = null;
   /**
    * @var string
    */
-  public $identityServerPasswordToken = null;
+  public $tenantURL = null;
   /**
    * @var string
    */
-  public $declinedReason = null;
+  public $tenantPublicAbstract = null;
   /**
    * @var string
    */
-  public $oauthClientId = null;
+  public $reviewProposalDescription = null;
   /**
    * @var string
    */
-  public $oauthClientSecret = null;
+  public $declinedReason = null;
   /**
    * @var int
    */
@@ -157,38 +394,10 @@ class Tenant {
           'var' => 'reviewProposalDescription',
           'type' => TType::STRING,
           ),
-        10 => array(
-          'var' => 'tenantAdminFirstName',
-          'type' => TType::STRING,
-          ),
-        11 => array(
-          'var' => 'tenantAdminLastName',
-          'type' => TType::STRING,
-          ),
-        12 => array(
-          'var' => 'tenantAdminEmail',
-          'type' => TType::STRING,
-          ),
-        13 => array(
-          'var' => 'identityServerUserName',
-          'type' => TType::STRING,
-          ),
-        14 => array(
-          'var' => 'identityServerPasswordToken',
-          'type' => TType::STRING,
-          ),
         15 => array(
           'var' => 'declinedReason',
           'type' => TType::STRING,
           ),
-        16 => array(
-          'var' => 'oauthClientId',
-          'type' => TType::STRING,
-          ),
-        17 => array(
-          'var' => 'oauthClientSecret',
-          'type' => TType::STRING,
-          ),
         18 => array(
           'var' => 'requestCreationTime',
           'type' => TType::I64,
@@ -227,30 +436,9 @@ class Tenant {
       if (isset($vals['reviewProposalDescription'])) {
         $this->reviewProposalDescription = $vals['reviewProposalDescription'];
       }
-      if (isset($vals['tenantAdminFirstName'])) {
-        $this->tenantAdminFirstName = $vals['tenantAdminFirstName'];
-      }
-      if (isset($vals['tenantAdminLastName'])) {
-        $this->tenantAdminLastName = $vals['tenantAdminLastName'];
-      }
-      if (isset($vals['tenantAdminEmail'])) {
-        $this->tenantAdminEmail = $vals['tenantAdminEmail'];
-      }
-      if (isset($vals['identityServerUserName'])) {
-        $this->identityServerUserName = $vals['identityServerUserName'];
-      }
-      if (isset($vals['identityServerPasswordToken'])) {
-        $this->identityServerPasswordToken = $vals['identityServerPasswordToken'];
-      }
       if (isset($vals['declinedReason'])) {
         $this->declinedReason = $vals['declinedReason'];
       }
-      if (isset($vals['oauthClientId'])) {
-        $this->oauthClientId = $vals['oauthClientId'];
-      }
-      if (isset($vals['oauthClientSecret'])) {
-        $this->oauthClientSecret = $vals['oauthClientSecret'];
-      }
       if (isset($vals['requestCreationTime'])) {
         $this->requestCreationTime = $vals['requestCreationTime'];
       }
@@ -342,41 +530,6 @@ class Tenant {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 10:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->tenantAdminFirstName);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 11:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->tenantAdminLastName);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 12:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->tenantAdminEmail);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 13:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->identityServerUserName);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 14:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->identityServerPasswordToken);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
         case 15:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->declinedReason);
@@ -384,20 +537,6 @@ class Tenant {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 16:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->oauthClientId);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 17:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->oauthClientSecret);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
         case 18:
           if ($ftype == TType::I64) {
             $xfer += $input->readI64($this->requestCreationTime);
@@ -470,46 +609,11 @@ class Tenant {
       $xfer += $output->writeString($this->reviewProposalDescription);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->tenantAdminFirstName !== null) {
-      $xfer += $output->writeFieldBegin('tenantAdminFirstName', TType::STRING, 10);
-      $xfer += $output->writeString($this->tenantAdminFirstName);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->tenantAdminLastName !== null) {
-      $xfer += $output->writeFieldBegin('tenantAdminLastName', TType::STRING, 11);
-      $xfer += $output->writeString($this->tenantAdminLastName);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->tenantAdminEmail !== null) {
-      $xfer += $output->writeFieldBegin('tenantAdminEmail', TType::STRING, 12);
-      $xfer += $output->writeString($this->tenantAdminEmail);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->identityServerUserName !== null) {
-      $xfer += $output->writeFieldBegin('identityServerUserName', TType::STRING, 13);
-      $xfer += $output->writeString($this->identityServerUserName);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->identityServerPasswordToken !== null) {
-      $xfer += $output->writeFieldBegin('identityServerPasswordToken', TType::STRING, 14);
-      $xfer += $output->writeString($this->identityServerPasswordToken);
-      $xfer += $output->writeFieldEnd();
-    }
     if ($this->declinedReason !== null) {
       $xfer += $output->writeFieldBegin('declinedReason', TType::STRING, 15);
       $xfer += $output->writeString($this->declinedReason);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->oauthClientId !== null) {
-      $xfer += $output->writeFieldBegin('oauthClientId', TType::STRING, 16);
-      $xfer += $output->writeString($this->oauthClientId);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->oauthClientSecret !== null) {
-      $xfer += $output->writeFieldBegin('oauthClientSecret', TType::STRING, 17);
-      $xfer += $output->writeString($this->oauthClientSecret);
-      $xfer += $output->writeFieldEnd();
-    }
     if ($this->requestCreationTime !== null) {
       $xfer += $output->writeFieldBegin('requestCreationTime', TType::I64, 18);
       $xfer += $output->writeI64($this->requestCreationTime);


[07/12] airavata-php-gateway git commit: AIRAVATA-2500 SSHAccountProvisioner error reporting

Posted by ma...@apache.org.
AIRAVATA-2500 SSHAccountProvisioner error reporting


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/2782a493
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/2782a493
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/2782a493

Branch: refs/heads/AIRAVATA-2500
Commit: 2782a4939136b7a968f3efb35ceb4c42ee627638
Parents: 2db05f4
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Sep 7 15:24:07 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Thu Sep 7 16:20:04 2017 -0400

----------------------------------------------------------------------
 app/libraries/URPUtilities.php | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2782a493/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 33b1e5e..27b4c67 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -189,24 +189,30 @@ class URPUtilities
                 $computeResource = CRUtilities::get_compute_resource($computeResourceId);
                 $hostname = $computeResource->hostName;
                 $userComputeResourcePreference = null;
-                if( array_key_exists($computeResourceId, $userComputeResourcePreferences)) {
-                    $userComputeResourcePreference = $userComputeResourcePreferences[$computeResourceId];
-                    $accountExists = true;
-                } else if ($sshAccountProvisioner->canCreateAccount) {
-                    $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
-                    $accountExists = true;
-                } else if (Airavata::doesUserHaveSSHAccount(Session::get('authz-token'), $computeResourceId, $userId)) {
-                    $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
-                    $accountExists = true;
-                } else {
-                    $accountExists = false;
+                $errorMessage = null;
+                $accountExists = false;
+                try {
+                    if( array_key_exists($computeResourceId, $userComputeResourcePreferences)) {
+                        $userComputeResourcePreference = $userComputeResourcePreferences[$computeResourceId];
+                        $accountExists = true;
+                    } else if ($sshAccountProvisioner->canCreateAccount) {
+                        $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
+                        $accountExists = true;
+                    } else if (Airavata::doesUserHaveSSHAccount(Session::get('authz-token'), $computeResourceId, $userId)) {
+                        $userComputeResourcePreference = URPUtilities::setup_ssh_account($gatewayId, $userId, $computeResourceId, $hostname);
+                        $accountExists = true;
+                    }
+                } catch (Exception $ex) {
+                    Log::error("Failed to setup SSH Account for " . $userId . " on $hostname");
+                    Log::error($ex);
+                    $errorMessage = $ex->getMessage();
                 }
                 $results[] = array(
                     "hostname" => $hostname,
                     "userComputeResourcePreference" => $userComputeResourcePreference,
                     "accountExists" => $accountExists,
                     "additionalInfo" => $computeResourcePreference->sshAccountProvisionerAdditionalInfo,
-                    "errorMessage" => "TODO"
+                    "errorMessage" => $errorMessage
                 );
             }
         }


[06/12] airavata-php-gateway git commit: AIRAVATA-2500 Display SSHAccountProvisioner additional info

Posted by ma...@apache.org.
AIRAVATA-2500 Display SSHAccountProvisioner additional info


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/3f67f683
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3f67f683
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3f67f683

Branch: refs/heads/AIRAVATA-2500
Commit: 3f67f683459245977d90183f3039e4d11e1ffdb3
Parents: cf2eae7
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Sep 7 15:15:42 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Thu Sep 7 15:30:48 2017 -0400

----------------------------------------------------------------------
 app/libraries/URPUtilities.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f67f683/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index 906861a..33b1e5e 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -205,7 +205,7 @@ class URPUtilities
                     "hostname" => $hostname,
                     "userComputeResourcePreference" => $userComputeResourcePreference,
                     "accountExists" => $accountExists,
-                    "additionalInfo" => "TODO",
+                    "additionalInfo" => $computeResourcePreference->sshAccountProvisionerAdditionalInfo,
                     "errorMessage" => "TODO"
                 );
             }


[08/12] airavata-php-gateway git commit: AIRAVATA-2500 Prevent deleting in-use user credentials

Posted by ma...@apache.org.
AIRAVATA-2500 Prevent deleting in-use user credentials


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/277f3468
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/277f3468
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/277f3468

Branch: refs/heads/AIRAVATA-2500
Commit: 277f34685da4273b1ee2f030b02c2830f6ca55e9
Parents: 2782a49
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Sep 7 16:31:28 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Thu Sep 7 16:31:28 2017 -0400

----------------------------------------------------------------------
 app/controllers/UserSettingsController.php   | 22 +++++++++++++++++++++-
 app/views/account/credential-store.blade.php | 11 +++++------
 2 files changed, 26 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/277f3468/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index d73e874..7f449a6 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -17,7 +17,7 @@ class UserSettingsController extends BaseController
         $userCredentialSummaries = URPUtilities::get_all_ssh_pub_keys_summary_for_user();
         $defaultCredentialToken = $userResourceProfile->credentialStoreToken;
         foreach ($userCredentialSummaries as $credentialSummary) {
-            $credentialSummary->canDelete = ($credentialSummary->token != $defaultCredentialToken);
+            $credentialSummary->canDelete = $this->canDeleteCredential($credentialSummary->token, $userResourceProfile);
         }
 
         return View::make("account/credential-store", array(
@@ -27,6 +27,26 @@ class UserSettingsController extends BaseController
         ));
     }
 
+    // Don't allow deleting credential if default credential or in use by a
+    // userComputeResourcePreference or a userStoragePreference
+    private function canDeleteCredential($token, $userResourceProfile) {
+        if ($token == $userResourceProfile->credentialStoreToken) {
+            return false;
+        } else {
+            foreach ($userResourceProfile->userComputeResourcePreferences as $userCompResPref) {
+                if ($userCompResPref->resourceSpecificCredentialStoreToken == $token) {
+                    return false;
+                }
+            }
+            foreach ($userResourceProfile->userStoragePreferences as $userStoragePreference) {
+                if ($userStoragePreference->resourceSpecificCredentialStoreToken == $token) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
     public function setDefaultCredential() {
 
         $defaultToken = Input::get("defaultToken");

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/277f3468/app/views/account/credential-store.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/credential-store.blade.php b/app/views/account/credential-store.blade.php
index a6b0b33..32e0f0d 100644
--- a/app/views/account/credential-store.blade.php
+++ b/app/views/account/credential-store.blade.php
@@ -57,15 +57,14 @@
                     @if ($credentialSummary->token != $defaultCredentialToken)
                     <form style="display: inline" action="{{ URL::to('/') }}/account/set-default-credential" method="post">
                         <input type="hidden" name="defaultToken" value="{{$credentialSummary->token}}"/>
-                        <button type="submit" class="btn btn-default">Make Default</button>
+                        <button type="submit" class="btn btn-default" title="Test">Make Default</button>
                     </form>
-                    @else
-                    <small>This is the default SSH public key that the gateway will use to authenticate to your compute and storage accounts.</small>
-                    @endif
-                    @if ($credentialSummary->canDelete)
                     <button data-token="{{$credentialSummary->token}}"
                         data-description="{{$credentialSummary->description}}"
-                        class="btn btn-danger delete-credential">Delete</button>
+                        class="btn btn-danger delete-credential"
+                        @if(!$credentialSummary->canDelete) disabled @endif>Delete</button>
+                    @else
+                    <small>This is the default SSH public key that the gateway will use to authenticate to your compute and storage accounts.</small>
                     @endif
                 </div>
             </div><!-- .row -->


[03/12] airavata-php-gateway git commit: AIRAVATA-2500 Thrift stub code generation

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cf2eae7e/app/libraries/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/API/Airavata.php b/app/libraries/Airavata/API/Airavata.php
index ae27035..c8976ba 100644
--- a/app/libraries/Airavata/API/Airavata.php
+++ b/app/libraries/Airavata/API/Airavata.php
@@ -3428,6 +3428,71 @@ interface AiravataIf {
    */
   public function deleteGatewayStoragePreference(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $storageId);
   /**
+   * @param \Airavata\Model\Security\AuthzToken $authzToken
+   * @return \Airavata\Model\AppCatalog\AccountProvisioning\SSHAccountProvisioner[]
+   * @throws \Airavata\API\Error\InvalidRequestException
+   * @throws \Airavata\API\Error\AiravataClientException
+   * @throws \Airavata\API\Error\AiravataSystemException
+   * @throws \Airavata\API\Error\AuthorizationException
+   */
+  public function getSSHAccountProvisioners(\Airavata\Model\Security\AuthzToken $authzToken);
+  /**
+   * 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.
+   * 
+   * @param \Airavata\Model\Security\AuthzToken $authzToken
+   * @param string $computeResourceId
+   * @param string $userId
+   * @return bool
+   * @throws \Airavata\API\Error\InvalidRequestException
+   * @throws \Airavata\API\Error\AiravataClientException
+   * @throws \Airavata\API\Error\AiravataSystemException
+   * @throws \Airavata\API\Error\AuthorizationException
+   */
+  public function doesUserHaveSSHAccount(\Airavata\Model\Security\AuthzToken $authzToken, $computeResourceId, $userId);
+  /**
+   * Setup and return a UserComputeResourcePreference object for this user to SSH into the given compute resource with
+   * the given SSH credential. This method will only work if the compute resource has an SSHAccountProvisioner
+   * configured for it. The returned UserComputeResourcePreference object is not saved; it is up to the client to
+   * call addUserComputeResourcePreference to persist it.
+   * 
+   * @param \Airavata\Model\Security\AuthzToken $authzToken
+   * @param string $computeResourceId
+   * @param string $userId
+   * @param string $airavataCredStoreToken
+   * @return \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference User specific preferences for a Computer Resource
+   * 
+   * computeResourceId:
+   *   Corelate the preference to a compute resource.
+   * 
+   * 
+   * loginUserName:
+   *   If turned true, Airavata will override the preferences of better alternatives exist.
+   * 
+   * 
+   * preferredBatchQueue:
+   *  Gateways can choose a defualt batch queue based on average job dimention, reservations or other metrics.
+   * 
+   * scratchLocation:
+   *  Path to the local scratch space on a HPC cluster. Typically used to create working directory for job execution.
+   * 
+   * allocationProjectNumber:
+   *  Typically used on HPC machines to charge computing usage to a account number. For instance, on XSEDE once an
+   *    allocation is approved, an allocation number is assigned. Before passing this number with job submittions, the
+   *    account to be used has to be added to the allocation.
+   * 
+   * resourceSpecificCredentialStoreToken:
+   *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
+   *   default credential store.
+   * 
+   * 
+   * @throws \Airavata\API\Error\InvalidRequestException
+   * @throws \Airavata\API\Error\AiravataClientException
+   * @throws \Airavata\API\Error\AiravataSystemException
+   * @throws \Airavata\API\Error\AuthorizationException
+   */
+  public function setupUserComputeResourcePreferencesForSSH(\Airavata\Model\Security\AuthzToken $authzToken, $computeResourceId, $userId, $airavataCredStoreToken);
+  /**
    * Register User Resource Profile.
    * 
    * @param UserResourceProfile
@@ -4045,7 +4110,7 @@ interface AiravataIf {
   /**
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param \Airavata\Model\Group\GroupModel $groupModel
-   * @return bool
+   * @return string
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
@@ -4066,14 +4131,13 @@ interface AiravataIf {
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $groupId
    * @param string $ownerId
-   * @param string $gatewayId
    * @return bool
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
    * @throws \Airavata\API\Error\AuthorizationException
    */
-  public function deleteGroup(\Airavata\Model\Security\AuthzToken $authzToken, $groupId, $ownerId, $gatewayId);
+  public function deleteGroup(\Airavata\Model\Security\AuthzToken $authzToken, $groupId, $ownerId);
   /**
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $groupId
@@ -4087,14 +4151,13 @@ interface AiravataIf {
   /**
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $userName
-   * @param string $gatewayId
    * @return \Airavata\Model\Group\GroupModel[]
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
    * @throws \Airavata\API\Error\AuthorizationException
    */
-  public function getAllGroupsUserBelongs(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId);
+  public function getAllGroupsUserBelongs(\Airavata\Model\Security\AuthzToken $authzToken, $userName);
 }
 
 class AiravataClient implements \Airavata\API\AiravataIf {
@@ -12722,6 +12785,200 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("deleteGatewayStoragePreference failed: unknown result");
   }
 
+  public function getSSHAccountProvisioners(\Airavata\Model\Security\AuthzToken $authzToken)
+  {
+    $this->send_getSSHAccountProvisioners($authzToken);
+    return $this->recv_getSSHAccountProvisioners();
+  }
+
+  public function send_getSSHAccountProvisioners(\Airavata\Model\Security\AuthzToken $authzToken)
+  {
+    $args = new \Airavata\API\Airavata_getSSHAccountProvisioners_args();
+    $args->authzToken = $authzToken;
+    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+    if ($bin_accel)
+    {
+      thrift_protocol_write_binary($this->output_, 'getSSHAccountProvisioners', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+    }
+    else
+    {
+      $this->output_->writeMessageBegin('getSSHAccountProvisioners', TMessageType::CALL, $this->seqid_);
+      $args->write($this->output_);
+      $this->output_->writeMessageEnd();
+      $this->output_->getTransport()->flush();
+    }
+  }
+
+  public function recv_getSSHAccountProvisioners()
+  {
+    $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+    if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getSSHAccountProvisioners_result', $this->input_->isStrictRead());
+    else
+    {
+      $rseqid = 0;
+      $fname = null;
+      $mtype = 0;
+
+      $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+      if ($mtype == TMessageType::EXCEPTION) {
+        $x = new TApplicationException();
+        $x->read($this->input_);
+        $this->input_->readMessageEnd();
+        throw $x;
+      }
+      $result = new \Airavata\API\Airavata_getSSHAccountProvisioners_result();
+      $result->read($this->input_);
+      $this->input_->readMessageEnd();
+    }
+    if ($result->success !== null) {
+      return $result->success;
+    }
+    if ($result->ire !== null) {
+      throw $result->ire;
+    }
+    if ($result->ace !== null) {
+      throw $result->ace;
+    }
+    if ($result->ase !== null) {
+      throw $result->ase;
+    }
+    if ($result->ae !== null) {
+      throw $result->ae;
+    }
+    throw new \Exception("getSSHAccountProvisioners failed: unknown result");
+  }
+
+  public function doesUserHaveSSHAccount(\Airavata\Model\Security\AuthzToken $authzToken, $computeResourceId, $userId)
+  {
+    $this->send_doesUserHaveSSHAccount($authzToken, $computeResourceId, $userId);
+    return $this->recv_doesUserHaveSSHAccount();
+  }
+
+  public function send_doesUserHaveSSHAccount(\Airavata\Model\Security\AuthzToken $authzToken, $computeResourceId, $userId)
+  {
+    $args = new \Airavata\API\Airavata_doesUserHaveSSHAccount_args();
+    $args->authzToken = $authzToken;
+    $args->computeResourceId = $computeResourceId;
+    $args->userId = $userId;
+    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+    if ($bin_accel)
+    {
+      thrift_protocol_write_binary($this->output_, 'doesUserHaveSSHAccount', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+    }
+    else
+    {
+      $this->output_->writeMessageBegin('doesUserHaveSSHAccount', TMessageType::CALL, $this->seqid_);
+      $args->write($this->output_);
+      $this->output_->writeMessageEnd();
+      $this->output_->getTransport()->flush();
+    }
+  }
+
+  public function recv_doesUserHaveSSHAccount()
+  {
+    $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+    if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_doesUserHaveSSHAccount_result', $this->input_->isStrictRead());
+    else
+    {
+      $rseqid = 0;
+      $fname = null;
+      $mtype = 0;
+
+      $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+      if ($mtype == TMessageType::EXCEPTION) {
+        $x = new TApplicationException();
+        $x->read($this->input_);
+        $this->input_->readMessageEnd();
+        throw $x;
+      }
+      $result = new \Airavata\API\Airavata_doesUserHaveSSHAccount_result();
+      $result->read($this->input_);
+      $this->input_->readMessageEnd();
+    }
+    if ($result->success !== null) {
+      return $result->success;
+    }
+    if ($result->ire !== null) {
+      throw $result->ire;
+    }
+    if ($result->ace !== null) {
+      throw $result->ace;
+    }
+    if ($result->ase !== null) {
+      throw $result->ase;
+    }
+    if ($result->ae !== null) {
+      throw $result->ae;
+    }
+    throw new \Exception("doesUserHaveSSHAccount failed: unknown result");
+  }
+
+  public function setupUserComputeResourcePreferencesForSSH(\Airavata\Model\Security\AuthzToken $authzToken, $computeResourceId, $userId, $airavataCredStoreToken)
+  {
+    $this->send_setupUserComputeResourcePreferencesForSSH($authzToken, $computeResourceId, $userId, $airavataCredStoreToken);
+    return $this->recv_setupUserComputeResourcePreferencesForSSH();
+  }
+
+  public function send_setupUserComputeResourcePreferencesForSSH(\Airavata\Model\Security\AuthzToken $authzToken, $computeResourceId, $userId, $airavataCredStoreToken)
+  {
+    $args = new \Airavata\API\Airavata_setupUserComputeResourcePreferencesForSSH_args();
+    $args->authzToken = $authzToken;
+    $args->computeResourceId = $computeResourceId;
+    $args->userId = $userId;
+    $args->airavataCredStoreToken = $airavataCredStoreToken;
+    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+    if ($bin_accel)
+    {
+      thrift_protocol_write_binary($this->output_, 'setupUserComputeResourcePreferencesForSSH', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+    }
+    else
+    {
+      $this->output_->writeMessageBegin('setupUserComputeResourcePreferencesForSSH', TMessageType::CALL, $this->seqid_);
+      $args->write($this->output_);
+      $this->output_->writeMessageEnd();
+      $this->output_->getTransport()->flush();
+    }
+  }
+
+  public function recv_setupUserComputeResourcePreferencesForSSH()
+  {
+    $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+    if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_setupUserComputeResourcePreferencesForSSH_result', $this->input_->isStrictRead());
+    else
+    {
+      $rseqid = 0;
+      $fname = null;
+      $mtype = 0;
+
+      $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+      if ($mtype == TMessageType::EXCEPTION) {
+        $x = new TApplicationException();
+        $x->read($this->input_);
+        $this->input_->readMessageEnd();
+        throw $x;
+      }
+      $result = new \Airavata\API\Airavata_setupUserComputeResourcePreferencesForSSH_result();
+      $result->read($this->input_);
+      $this->input_->readMessageEnd();
+    }
+    if ($result->success !== null) {
+      return $result->success;
+    }
+    if ($result->ire !== null) {
+      throw $result->ire;
+    }
+    if ($result->ace !== null) {
+      throw $result->ace;
+    }
+    if ($result->ase !== null) {
+      throw $result->ase;
+    }
+    if ($result->ae !== null) {
+      throw $result->ae;
+    }
+    throw new \Exception("setupUserComputeResourcePreferencesForSSH failed: unknown result");
+  }
+
   public function registerUserResourceProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile $userResourceProfile)
   {
     $this->send_registerUserResourceProfile($authzToken, $userResourceProfile);
@@ -14860,19 +15117,18 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("updateGroup failed: unknown result");
   }
 
-  public function deleteGroup(\Airavata\Model\Security\AuthzToken $authzToken, $groupId, $ownerId, $gatewayId)
+  public function deleteGroup(\Airavata\Model\Security\AuthzToken $authzToken, $groupId, $ownerId)
   {
-    $this->send_deleteGroup($authzToken, $groupId, $ownerId, $gatewayId);
+    $this->send_deleteGroup($authzToken, $groupId, $ownerId);
     return $this->recv_deleteGroup();
   }
 
-  public function send_deleteGroup(\Airavata\Model\Security\AuthzToken $authzToken, $groupId, $ownerId, $gatewayId)
+  public function send_deleteGroup(\Airavata\Model\Security\AuthzToken $authzToken, $groupId, $ownerId)
   {
     $args = new \Airavata\API\Airavata_deleteGroup_args();
     $args->authzToken = $authzToken;
     $args->groupId = $groupId;
     $args->ownerId = $ownerId;
-    $args->gatewayId = $gatewayId;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
     {
@@ -14990,18 +15246,17 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("getGroup failed: unknown result");
   }
 
-  public function getAllGroupsUserBelongs(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+  public function getAllGroupsUserBelongs(\Airavata\Model\Security\AuthzToken $authzToken, $userName)
   {
-    $this->send_getAllGroupsUserBelongs($authzToken, $userName, $gatewayId);
+    $this->send_getAllGroupsUserBelongs($authzToken, $userName);
     return $this->recv_getAllGroupsUserBelongs();
   }
 
-  public function send_getAllGroupsUserBelongs(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+  public function send_getAllGroupsUserBelongs(\Airavata\Model\Security\AuthzToken $authzToken, $userName)
   {
     $args = new \Airavata\API\Airavata_getAllGroupsUserBelongs_args();
     $args->authzToken = $authzToken;
     $args->userName = $userName;
-    $args->gatewayId = $gatewayId;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
     {
@@ -55773,17 +56028,13 @@ class Airavata_deleteGatewayStoragePreference_result {
 
 }
 
-class Airavata_registerUserResourceProfile_args {
+class Airavata_getSSHAccountProvisioners_args {
   static $_TSPEC;
 
   /**
    * @var \Airavata\Model\Security\AuthzToken
    */
   public $authzToken = null;
-  /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile
-   */
-  public $userResourceProfile = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -55793,25 +56044,17 @@ class Airavata_registerUserResourceProfile_args {
           'type' => TType::STRUCT,
           'class' => '\Airavata\Model\Security\AuthzToken',
           ),
-        2 => array(
-          'var' => 'userResourceProfile',
-          'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile',
-          ),
         );
     }
     if (is_array($vals)) {
       if (isset($vals['authzToken'])) {
         $this->authzToken = $vals['authzToken'];
       }
-      if (isset($vals['userResourceProfile'])) {
-        $this->userResourceProfile = $vals['userResourceProfile'];
-      }
     }
   }
 
   public function getName() {
-    return 'Airavata_registerUserResourceProfile_args';
+    return 'Airavata_getSSHAccountProvisioners_args';
   }
 
   public function read($input)
@@ -55837,14 +56080,6 @@ class Airavata_registerUserResourceProfile_args {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 2:
-          if ($ftype == TType::STRUCT) {
-            $this->userResourceProfile = new \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile();
-            $xfer += $this->userResourceProfile->read($input);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -55857,7 +56092,7 @@ class Airavata_registerUserResourceProfile_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_registerUserResourceProfile_args');
+    $xfer += $output->writeStructBegin('Airavata_getSSHAccountProvisioners_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -55866,14 +56101,6 @@ class Airavata_registerUserResourceProfile_args {
       $xfer += $this->authzToken->write($output);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userResourceProfile !== null) {
-      if (!is_object($this->userResourceProfile)) {
-        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
-      }
-      $xfer += $output->writeFieldBegin('userResourceProfile', TType::STRUCT, 2);
-      $xfer += $this->userResourceProfile->write($output);
-      $xfer += $output->writeFieldEnd();
-    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
@@ -55881,11 +56108,11 @@ class Airavata_registerUserResourceProfile_args {
 
 }
 
-class Airavata_registerUserResourceProfile_result {
+class Airavata_getSSHAccountProvisioners_result {
   static $_TSPEC;
 
   /**
-   * @var string
+   * @var \Airavata\Model\AppCatalog\AccountProvisioning\SSHAccountProvisioner[]
    */
   public $success = null;
   /**
@@ -55910,7 +56137,12 @@ class Airavata_registerUserResourceProfile_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::STRING,
+          'type' => TType::LST,
+          'etype' => TType::STRUCT,
+          'elem' => array(
+            'type' => TType::STRUCT,
+            'class' => '\Airavata\Model\AppCatalog\AccountProvisioning\SSHAccountProvisioner',
+            ),
           ),
         1 => array(
           'var' => 'ire',
@@ -55954,7 +56186,7 @@ class Airavata_registerUserResourceProfile_result {
   }
 
   public function getName() {
-    return 'Airavata_registerUserResourceProfile_result';
+    return 'Airavata_getSSHAccountProvisioners_result';
   }
 
   public function read($input)
@@ -55973,8 +56205,19 @@ class Airavata_registerUserResourceProfile_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->success);
+          if ($ftype == TType::LST) {
+            $this->success = array();
+            $_size253 = 0;
+            $_etype256 = 0;
+            $xfer += $input->readListBegin($_etype256, $_size253);
+            for ($_i257 = 0; $_i257 < $_size253; ++$_i257)
+            {
+              $elem258 = null;
+              $elem258 = new \Airavata\Model\AppCatalog\AccountProvisioning\SSHAccountProvisioner();
+              $xfer += $elem258->read($input);
+              $this->success []= $elem258;
+            }
+            $xfer += $input->readListEnd();
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -56023,10 +56266,22 @@ class Airavata_registerUserResourceProfile_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_registerUserResourceProfile_result');
+    $xfer += $output->writeStructBegin('Airavata_getSSHAccountProvisioners_result');
     if ($this->success !== null) {
-      $xfer += $output->writeFieldBegin('success', TType::STRING, 0);
-      $xfer += $output->writeString($this->success);
+      if (!is_array($this->success)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('success', TType::LST, 0);
+      {
+        $output->writeListBegin(TType::STRUCT, count($this->success));
+        {
+          foreach ($this->success as $iter259)
+          {
+            $xfer += $iter259->write($output);
+          }
+        }
+        $output->writeListEnd();
+      }
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -56056,7 +56311,7 @@ class Airavata_registerUserResourceProfile_result {
 
 }
 
-class Airavata_getUserResourceProfile_args {
+class Airavata_doesUserHaveSSHAccount_args {
   static $_TSPEC;
 
   /**
@@ -56066,11 +56321,11 @@ class Airavata_getUserResourceProfile_args {
   /**
    * @var string
    */
-  public $userId = null;
+  public $computeResourceId = null;
   /**
    * @var string
    */
-  public $gatewayID = null;
+  public $userId = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -56081,11 +56336,11 @@ class Airavata_getUserResourceProfile_args {
           'class' => '\Airavata\Model\Security\AuthzToken',
           ),
         2 => array(
-          'var' => 'userId',
+          'var' => 'computeResourceId',
           'type' => TType::STRING,
           ),
         3 => array(
-          'var' => 'gatewayID',
+          'var' => 'userId',
           'type' => TType::STRING,
           ),
         );
@@ -56094,17 +56349,17 @@ class Airavata_getUserResourceProfile_args {
       if (isset($vals['authzToken'])) {
         $this->authzToken = $vals['authzToken'];
       }
+      if (isset($vals['computeResourceId'])) {
+        $this->computeResourceId = $vals['computeResourceId'];
+      }
       if (isset($vals['userId'])) {
         $this->userId = $vals['userId'];
       }
-      if (isset($vals['gatewayID'])) {
-        $this->gatewayID = $vals['gatewayID'];
-      }
     }
   }
 
   public function getName() {
-    return 'Airavata_getUserResourceProfile_args';
+    return 'Airavata_doesUserHaveSSHAccount_args';
   }
 
   public function read($input)
@@ -56132,14 +56387,14 @@ class Airavata_getUserResourceProfile_args {
           break;
         case 2:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userId);
+            $xfer += $input->readString($this->computeResourceId);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
         case 3:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->gatewayID);
+            $xfer += $input->readString($this->userId);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -56156,7 +56411,7 @@ class Airavata_getUserResourceProfile_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getUserResourceProfile_args');
+    $xfer += $output->writeStructBegin('Airavata_doesUserHaveSSHAccount_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -56165,14 +56420,14 @@ class Airavata_getUserResourceProfile_args {
       $xfer += $this->authzToken->write($output);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userId !== null) {
-      $xfer += $output->writeFieldBegin('userId', TType::STRING, 2);
-      $xfer += $output->writeString($this->userId);
+    if ($this->computeResourceId !== null) {
+      $xfer += $output->writeFieldBegin('computeResourceId', TType::STRING, 2);
+      $xfer += $output->writeString($this->computeResourceId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->gatewayID !== null) {
-      $xfer += $output->writeFieldBegin('gatewayID', TType::STRING, 3);
-      $xfer += $output->writeString($this->gatewayID);
+    if ($this->userId !== null) {
+      $xfer += $output->writeFieldBegin('userId', TType::STRING, 3);
+      $xfer += $output->writeString($this->userId);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
@@ -56182,11 +56437,11 @@ class Airavata_getUserResourceProfile_args {
 
 }
 
-class Airavata_getUserResourceProfile_result {
+class Airavata_doesUserHaveSSHAccount_result {
   static $_TSPEC;
 
   /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile
+   * @var bool
    */
   public $success = null;
   /**
@@ -56211,8 +56466,7 @@ class Airavata_getUserResourceProfile_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile',
+          'type' => TType::BOOL,
           ),
         1 => array(
           'var' => 'ire',
@@ -56256,7 +56510,7 @@ class Airavata_getUserResourceProfile_result {
   }
 
   public function getName() {
-    return 'Airavata_getUserResourceProfile_result';
+    return 'Airavata_doesUserHaveSSHAccount_result';
   }
 
   public function read($input)
@@ -56275,9 +56529,8 @@ class Airavata_getUserResourceProfile_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::STRUCT) {
-            $this->success = new \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile();
-            $xfer += $this->success->read($input);
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->success);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -56326,13 +56579,10 @@ class Airavata_getUserResourceProfile_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getUserResourceProfile_result');
+    $xfer += $output->writeStructBegin('Airavata_doesUserHaveSSHAccount_result');
     if ($this->success !== null) {
-      if (!is_object($this->success)) {
-        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
-      }
-      $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
-      $xfer += $this->success->write($output);
+      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
+      $xfer += $output->writeBool($this->success);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -56362,7 +56612,7 @@ class Airavata_getUserResourceProfile_result {
 
 }
 
-class Airavata_updateUserResourceProfile_args {
+class Airavata_setupUserComputeResourcePreferencesForSSH_args {
   static $_TSPEC;
 
   /**
@@ -56372,15 +56622,15 @@ class Airavata_updateUserResourceProfile_args {
   /**
    * @var string
    */
-  public $userId = null;
+  public $computeResourceId = null;
   /**
    * @var string
    */
-  public $gatewayID = null;
+  public $userId = null;
   /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile
+   * @var string
    */
-  public $userResourceProfile = null;
+  public $airavataCredStoreToken = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -56391,17 +56641,16 @@ class Airavata_updateUserResourceProfile_args {
           'class' => '\Airavata\Model\Security\AuthzToken',
           ),
         2 => array(
-          'var' => 'userId',
+          'var' => 'computeResourceId',
           'type' => TType::STRING,
           ),
         3 => array(
-          'var' => 'gatewayID',
+          'var' => 'userId',
           'type' => TType::STRING,
           ),
         4 => array(
-          'var' => 'userResourceProfile',
-          'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile',
+          'var' => 'airavataCredStoreToken',
+          'type' => TType::STRING,
           ),
         );
     }
@@ -56409,20 +56658,20 @@ class Airavata_updateUserResourceProfile_args {
       if (isset($vals['authzToken'])) {
         $this->authzToken = $vals['authzToken'];
       }
+      if (isset($vals['computeResourceId'])) {
+        $this->computeResourceId = $vals['computeResourceId'];
+      }
       if (isset($vals['userId'])) {
         $this->userId = $vals['userId'];
       }
-      if (isset($vals['gatewayID'])) {
-        $this->gatewayID = $vals['gatewayID'];
-      }
-      if (isset($vals['userResourceProfile'])) {
-        $this->userResourceProfile = $vals['userResourceProfile'];
+      if (isset($vals['airavataCredStoreToken'])) {
+        $this->airavataCredStoreToken = $vals['airavataCredStoreToken'];
       }
     }
   }
 
   public function getName() {
-    return 'Airavata_updateUserResourceProfile_args';
+    return 'Airavata_setupUserComputeResourcePreferencesForSSH_args';
   }
 
   public function read($input)
@@ -56450,22 +56699,21 @@ class Airavata_updateUserResourceProfile_args {
           break;
         case 2:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userId);
+            $xfer += $input->readString($this->computeResourceId);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
         case 3:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->gatewayID);
+            $xfer += $input->readString($this->userId);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
         case 4:
-          if ($ftype == TType::STRUCT) {
-            $this->userResourceProfile = new \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile();
-            $xfer += $this->userResourceProfile->read($input);
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->airavataCredStoreToken);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -56482,7 +56730,7 @@ class Airavata_updateUserResourceProfile_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_updateUserResourceProfile_args');
+    $xfer += $output->writeStructBegin('Airavata_setupUserComputeResourcePreferencesForSSH_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -56491,22 +56739,19 @@ class Airavata_updateUserResourceProfile_args {
       $xfer += $this->authzToken->write($output);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userId !== null) {
-      $xfer += $output->writeFieldBegin('userId', TType::STRING, 2);
-      $xfer += $output->writeString($this->userId);
+    if ($this->computeResourceId !== null) {
+      $xfer += $output->writeFieldBegin('computeResourceId', TType::STRING, 2);
+      $xfer += $output->writeString($this->computeResourceId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->gatewayID !== null) {
-      $xfer += $output->writeFieldBegin('gatewayID', TType::STRING, 3);
-      $xfer += $output->writeString($this->gatewayID);
+    if ($this->userId !== null) {
+      $xfer += $output->writeFieldBegin('userId', TType::STRING, 3);
+      $xfer += $output->writeString($this->userId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userResourceProfile !== null) {
-      if (!is_object($this->userResourceProfile)) {
-        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
-      }
-      $xfer += $output->writeFieldBegin('userResourceProfile', TType::STRUCT, 4);
-      $xfer += $this->userResourceProfile->write($output);
+    if ($this->airavataCredStoreToken !== null) {
+      $xfer += $output->writeFieldBegin('airavataCredStoreToken', TType::STRING, 4);
+      $xfer += $output->writeString($this->airavataCredStoreToken);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
@@ -56516,11 +56761,11 @@ class Airavata_updateUserResourceProfile_args {
 
 }
 
-class Airavata_updateUserResourceProfile_result {
+class Airavata_setupUserComputeResourcePreferencesForSSH_result {
   static $_TSPEC;
 
   /**
-   * @var bool
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference
    */
   public $success = null;
   /**
@@ -56545,7 +56790,8 @@ class Airavata_updateUserResourceProfile_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::BOOL,
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference',
           ),
         1 => array(
           'var' => 'ire',
@@ -56589,7 +56835,7 @@ class Airavata_updateUserResourceProfile_result {
   }
 
   public function getName() {
-    return 'Airavata_updateUserResourceProfile_result';
+    return 'Airavata_setupUserComputeResourcePreferencesForSSH_result';
   }
 
   public function read($input)
@@ -56608,8 +56854,9 @@ class Airavata_updateUserResourceProfile_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::BOOL) {
-            $xfer += $input->readBool($this->success);
+          if ($ftype == TType::STRUCT) {
+            $this->success = new \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference();
+            $xfer += $this->success->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -56658,10 +56905,13 @@ class Airavata_updateUserResourceProfile_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_updateUserResourceProfile_result');
+    $xfer += $output->writeStructBegin('Airavata_setupUserComputeResourcePreferencesForSSH_result');
     if ($this->success !== null) {
-      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
-      $xfer += $output->writeBool($this->success);
+      if (!is_object($this->success)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
+      $xfer += $this->success->write($output);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -56691,7 +56941,7 @@ class Airavata_updateUserResourceProfile_result {
 
 }
 
-class Airavata_deleteUserResourceProfile_args {
+class Airavata_registerUserResourceProfile_args {
   static $_TSPEC;
 
   /**
@@ -56699,13 +56949,9 @@ class Airavata_deleteUserResourceProfile_args {
    */
   public $authzToken = null;
   /**
-   * @var string
-   */
-  public $userId = null;
-  /**
-   * @var string
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile
    */
-  public $gatewayID = null;
+  public $userResourceProfile = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -56716,12 +56962,9 @@ class Airavata_deleteUserResourceProfile_args {
           'class' => '\Airavata\Model\Security\AuthzToken',
           ),
         2 => array(
-          'var' => 'userId',
-          'type' => TType::STRING,
-          ),
-        3 => array(
-          'var' => 'gatewayID',
-          'type' => TType::STRING,
+          'var' => 'userResourceProfile',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile',
           ),
         );
     }
@@ -56729,17 +56972,14 @@ class Airavata_deleteUserResourceProfile_args {
       if (isset($vals['authzToken'])) {
         $this->authzToken = $vals['authzToken'];
       }
-      if (isset($vals['userId'])) {
-        $this->userId = $vals['userId'];
-      }
-      if (isset($vals['gatewayID'])) {
-        $this->gatewayID = $vals['gatewayID'];
+      if (isset($vals['userResourceProfile'])) {
+        $this->userResourceProfile = $vals['userResourceProfile'];
       }
     }
   }
 
   public function getName() {
-    return 'Airavata_deleteUserResourceProfile_args';
+    return 'Airavata_registerUserResourceProfile_args';
   }
 
   public function read($input)
@@ -56766,15 +57006,9 @@ class Airavata_deleteUserResourceProfile_args {
           }
           break;
         case 2:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userId);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 3:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->gatewayID);
+          if ($ftype == TType::STRUCT) {
+            $this->userResourceProfile = new \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile();
+            $xfer += $this->userResourceProfile->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -56791,7 +57025,7 @@ class Airavata_deleteUserResourceProfile_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_deleteUserResourceProfile_args');
+    $xfer += $output->writeStructBegin('Airavata_registerUserResourceProfile_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -56800,14 +57034,12 @@ class Airavata_deleteUserResourceProfile_args {
       $xfer += $this->authzToken->write($output);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userId !== null) {
-      $xfer += $output->writeFieldBegin('userId', TType::STRING, 2);
-      $xfer += $output->writeString($this->userId);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->gatewayID !== null) {
-      $xfer += $output->writeFieldBegin('gatewayID', TType::STRING, 3);
-      $xfer += $output->writeString($this->gatewayID);
+    if ($this->userResourceProfile !== null) {
+      if (!is_object($this->userResourceProfile)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('userResourceProfile', TType::STRUCT, 2);
+      $xfer += $this->userResourceProfile->write($output);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
@@ -56817,11 +57049,11 @@ class Airavata_deleteUserResourceProfile_args {
 
 }
 
-class Airavata_deleteUserResourceProfile_result {
+class Airavata_registerUserResourceProfile_result {
   static $_TSPEC;
 
   /**
-   * @var bool
+   * @var string
    */
   public $success = null;
   /**
@@ -56846,7 +57078,7 @@ class Airavata_deleteUserResourceProfile_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::BOOL,
+          'type' => TType::STRING,
           ),
         1 => array(
           'var' => 'ire',
@@ -56890,7 +57122,7 @@ class Airavata_deleteUserResourceProfile_result {
   }
 
   public function getName() {
-    return 'Airavata_deleteUserResourceProfile_result';
+    return 'Airavata_registerUserResourceProfile_result';
   }
 
   public function read($input)
@@ -56909,8 +57141,8 @@ class Airavata_deleteUserResourceProfile_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::BOOL) {
-            $xfer += $input->readBool($this->success);
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->success);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -56959,10 +57191,10 @@ class Airavata_deleteUserResourceProfile_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_deleteUserResourceProfile_result');
+    $xfer += $output->writeStructBegin('Airavata_registerUserResourceProfile_result');
     if ($this->success !== null) {
-      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
-      $xfer += $output->writeBool($this->success);
+      $xfer += $output->writeFieldBegin('success', TType::STRING, 0);
+      $xfer += $output->writeString($this->success);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -56992,7 +57224,7 @@ class Airavata_deleteUserResourceProfile_result {
 
 }
 
-class Airavata_addUserComputeResourcePreference_args {
+class Airavata_getUserResourceProfile_args {
   static $_TSPEC;
 
   /**
@@ -57007,14 +57239,6 @@ class Airavata_addUserComputeResourcePreference_args {
    * @var string
    */
   public $gatewayID = null;
-  /**
-   * @var string
-   */
-  public $userComputeResourceId = null;
-  /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference
-   */
-  public $userComputeResourcePreference = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -57032,15 +57256,6 @@ class Airavata_addUserComputeResourcePreference_args {
           'var' => 'gatewayID',
           'type' => TType::STRING,
           ),
-        4 => array(
-          'var' => 'userComputeResourceId',
-          'type' => TType::STRING,
-          ),
-        5 => array(
-          'var' => 'userComputeResourcePreference',
-          'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference',
-          ),
         );
     }
     if (is_array($vals)) {
@@ -57053,17 +57268,11 @@ class Airavata_addUserComputeResourcePreference_args {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
-      if (isset($vals['userComputeResourceId'])) {
-        $this->userComputeResourceId = $vals['userComputeResourceId'];
-      }
-      if (isset($vals['userComputeResourcePreference'])) {
-        $this->userComputeResourcePreference = $vals['userComputeResourcePreference'];
-      }
     }
   }
 
   public function getName() {
-    return 'Airavata_addUserComputeResourcePreference_args';
+    return 'Airavata_getUserResourceProfile_args';
   }
 
   public function read($input)
@@ -57103,21 +57312,6 @@ class Airavata_addUserComputeResourcePreference_args {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 4:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userComputeResourceId);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 5:
-          if ($ftype == TType::STRUCT) {
-            $this->userComputeResourcePreference = new \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference();
-            $xfer += $this->userComputeResourcePreference->read($input);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -57130,7 +57324,7 @@ class Airavata_addUserComputeResourcePreference_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_addUserComputeResourcePreference_args');
+    $xfer += $output->writeStructBegin('Airavata_getUserResourceProfile_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -57149,19 +57343,6 @@ class Airavata_addUserComputeResourcePreference_args {
       $xfer += $output->writeString($this->gatewayID);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userComputeResourceId !== null) {
-      $xfer += $output->writeFieldBegin('userComputeResourceId', TType::STRING, 4);
-      $xfer += $output->writeString($this->userComputeResourceId);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->userComputeResourcePreference !== null) {
-      if (!is_object($this->userComputeResourcePreference)) {
-        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
-      }
-      $xfer += $output->writeFieldBegin('userComputeResourcePreference', TType::STRUCT, 5);
-      $xfer += $this->userComputeResourcePreference->write($output);
-      $xfer += $output->writeFieldEnd();
-    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
@@ -57169,11 +57350,11 @@ class Airavata_addUserComputeResourcePreference_args {
 
 }
 
-class Airavata_addUserComputeResourcePreference_result {
+class Airavata_getUserResourceProfile_result {
   static $_TSPEC;
 
   /**
-   * @var bool
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile
    */
   public $success = null;
   /**
@@ -57198,7 +57379,8 @@ class Airavata_addUserComputeResourcePreference_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::BOOL,
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile',
           ),
         1 => array(
           'var' => 'ire',
@@ -57242,7 +57424,7 @@ class Airavata_addUserComputeResourcePreference_result {
   }
 
   public function getName() {
-    return 'Airavata_addUserComputeResourcePreference_result';
+    return 'Airavata_getUserResourceProfile_result';
   }
 
   public function read($input)
@@ -57261,8 +57443,9 @@ class Airavata_addUserComputeResourcePreference_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::BOOL) {
-            $xfer += $input->readBool($this->success);
+          if ($ftype == TType::STRUCT) {
+            $this->success = new \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile();
+            $xfer += $this->success->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -57311,10 +57494,13 @@ class Airavata_addUserComputeResourcePreference_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_addUserComputeResourcePreference_result');
+    $xfer += $output->writeStructBegin('Airavata_getUserResourceProfile_result');
     if ($this->success !== null) {
-      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
-      $xfer += $output->writeBool($this->success);
+      if (!is_object($this->success)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
+      $xfer += $this->success->write($output);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -57344,7 +57530,7 @@ class Airavata_addUserComputeResourcePreference_result {
 
 }
 
-class Airavata_addUserStoragePreference_args {
+class Airavata_updateUserResourceProfile_args {
   static $_TSPEC;
 
   /**
@@ -57360,13 +57546,9 @@ class Airavata_addUserStoragePreference_args {
    */
   public $gatewayID = null;
   /**
-   * @var string
-   */
-  public $userStorageResourceId = null;
-  /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile
    */
-  public $userStoragePreference = null;
+  public $userResourceProfile = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -57385,13 +57567,9 @@ class Airavata_addUserStoragePreference_args {
           'type' => TType::STRING,
           ),
         4 => array(
-          'var' => 'userStorageResourceId',
-          'type' => TType::STRING,
-          ),
-        5 => array(
-          'var' => 'userStoragePreference',
+          'var' => 'userResourceProfile',
           'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference',
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile',
           ),
         );
     }
@@ -57405,17 +57583,14 @@ class Airavata_addUserStoragePreference_args {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
-      if (isset($vals['userStorageResourceId'])) {
-        $this->userStorageResourceId = $vals['userStorageResourceId'];
-      }
-      if (isset($vals['userStoragePreference'])) {
-        $this->userStoragePreference = $vals['userStoragePreference'];
+      if (isset($vals['userResourceProfile'])) {
+        $this->userResourceProfile = $vals['userResourceProfile'];
       }
     }
   }
 
   public function getName() {
-    return 'Airavata_addUserStoragePreference_args';
+    return 'Airavata_updateUserResourceProfile_args';
   }
 
   public function read($input)
@@ -57456,16 +57631,9 @@ class Airavata_addUserStoragePreference_args {
           }
           break;
         case 4:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userStorageResourceId);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 5:
           if ($ftype == TType::STRUCT) {
-            $this->userStoragePreference = new \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference();
-            $xfer += $this->userStoragePreference->read($input);
+            $this->userResourceProfile = new \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile();
+            $xfer += $this->userResourceProfile->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -57482,7 +57650,7 @@ class Airavata_addUserStoragePreference_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_addUserStoragePreference_args');
+    $xfer += $output->writeStructBegin('Airavata_updateUserResourceProfile_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -57501,17 +57669,12 @@ class Airavata_addUserStoragePreference_args {
       $xfer += $output->writeString($this->gatewayID);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userStorageResourceId !== null) {
-      $xfer += $output->writeFieldBegin('userStorageResourceId', TType::STRING, 4);
-      $xfer += $output->writeString($this->userStorageResourceId);
-      $xfer += $output->writeFieldEnd();
-    }
-    if ($this->userStoragePreference !== null) {
-      if (!is_object($this->userStoragePreference)) {
+    if ($this->userResourceProfile !== null) {
+      if (!is_object($this->userResourceProfile)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('userStoragePreference', TType::STRUCT, 5);
-      $xfer += $this->userStoragePreference->write($output);
+      $xfer += $output->writeFieldBegin('userResourceProfile', TType::STRUCT, 4);
+      $xfer += $this->userResourceProfile->write($output);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
@@ -57521,7 +57684,7 @@ class Airavata_addUserStoragePreference_args {
 
 }
 
-class Airavata_addUserStoragePreference_result {
+class Airavata_updateUserResourceProfile_result {
   static $_TSPEC;
 
   /**
@@ -57594,7 +57757,7 @@ class Airavata_addUserStoragePreference_result {
   }
 
   public function getName() {
-    return 'Airavata_addUserStoragePreference_result';
+    return 'Airavata_updateUserResourceProfile_result';
   }
 
   public function read($input)
@@ -57663,7 +57826,7 @@ class Airavata_addUserStoragePreference_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_addUserStoragePreference_result');
+    $xfer += $output->writeStructBegin('Airavata_updateUserResourceProfile_result');
     if ($this->success !== null) {
       $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
       $xfer += $output->writeBool($this->success);
@@ -57696,7 +57859,7 @@ class Airavata_addUserStoragePreference_result {
 
 }
 
-class Airavata_getUserComputeResourcePreference_args {
+class Airavata_deleteUserResourceProfile_args {
   static $_TSPEC;
 
   /**
@@ -57711,10 +57874,6 @@ class Airavata_getUserComputeResourcePreference_args {
    * @var string
    */
   public $gatewayID = null;
-  /**
-   * @var string
-   */
-  public $userComputeResourceId = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -57732,10 +57891,6 @@ class Airavata_getUserComputeResourcePreference_args {
           'var' => 'gatewayID',
           'type' => TType::STRING,
           ),
-        4 => array(
-          'var' => 'userComputeResourceId',
-          'type' => TType::STRING,
-          ),
         );
     }
     if (is_array($vals)) {
@@ -57748,14 +57903,11 @@ class Airavata_getUserComputeResourcePreference_args {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
-      if (isset($vals['userComputeResourceId'])) {
-        $this->userComputeResourceId = $vals['userComputeResourceId'];
-      }
     }
   }
 
   public function getName() {
-    return 'Airavata_getUserComputeResourcePreference_args';
+    return 'Airavata_deleteUserResourceProfile_args';
   }
 
   public function read($input)
@@ -57795,13 +57947,6 @@ class Airavata_getUserComputeResourcePreference_args {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 4:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userComputeResourceId);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -57814,7 +57959,7 @@ class Airavata_getUserComputeResourcePreference_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getUserComputeResourcePreference_args');
+    $xfer += $output->writeStructBegin('Airavata_deleteUserResourceProfile_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -57833,11 +57978,6 @@ class Airavata_getUserComputeResourcePreference_args {
       $xfer += $output->writeString($this->gatewayID);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userComputeResourceId !== null) {
-      $xfer += $output->writeFieldBegin('userComputeResourceId', TType::STRING, 4);
-      $xfer += $output->writeString($this->userComputeResourceId);
-      $xfer += $output->writeFieldEnd();
-    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
@@ -57845,11 +57985,11 @@ class Airavata_getUserComputeResourcePreference_args {
 
 }
 
-class Airavata_getUserComputeResourcePreference_result {
+class Airavata_deleteUserResourceProfile_result {
   static $_TSPEC;
 
   /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference
+   * @var bool
    */
   public $success = null;
   /**
@@ -57874,8 +58014,7 @@ class Airavata_getUserComputeResourcePreference_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference',
+          'type' => TType::BOOL,
           ),
         1 => array(
           'var' => 'ire',
@@ -57919,7 +58058,7 @@ class Airavata_getUserComputeResourcePreference_result {
   }
 
   public function getName() {
-    return 'Airavata_getUserComputeResourcePreference_result';
+    return 'Airavata_deleteUserResourceProfile_result';
   }
 
   public function read($input)
@@ -57938,9 +58077,8 @@ class Airavata_getUserComputeResourcePreference_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::STRUCT) {
-            $this->success = new \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference();
-            $xfer += $this->success->read($input);
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->success);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -57989,13 +58127,10 @@ class Airavata_getUserComputeResourcePreference_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getUserComputeResourcePreference_result');
+    $xfer += $output->writeStructBegin('Airavata_deleteUserResourceProfile_result');
     if ($this->success !== null) {
-      if (!is_object($this->success)) {
-        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
-      }
-      $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
-      $xfer += $this->success->write($output);
+      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
+      $xfer += $output->writeBool($this->success);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -58025,7 +58160,7 @@ class Airavata_getUserComputeResourcePreference_result {
 
 }
 
-class Airavata_getUserStoragePreference_args {
+class Airavata_addUserComputeResourcePreference_args {
   static $_TSPEC;
 
   /**
@@ -58043,7 +58178,11 @@ class Airavata_getUserStoragePreference_args {
   /**
    * @var string
    */
-  public $userStorageResourceId = null;
+  public $userComputeResourceId = null;
+  /**
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference
+   */
+  public $userComputeResourcePreference = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -58062,9 +58201,14 @@ class Airavata_getUserStoragePreference_args {
           'type' => TType::STRING,
           ),
         4 => array(
-          'var' => 'userStorageResourceId',
+          'var' => 'userComputeResourceId',
           'type' => TType::STRING,
           ),
+        5 => array(
+          'var' => 'userComputeResourcePreference',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference',
+          ),
         );
     }
     if (is_array($vals)) {
@@ -58077,14 +58221,17 @@ class Airavata_getUserStoragePreference_args {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
-      if (isset($vals['userStorageResourceId'])) {
-        $this->userStorageResourceId = $vals['userStorageResourceId'];
+      if (isset($vals['userComputeResourceId'])) {
+        $this->userComputeResourceId = $vals['userComputeResourceId'];
+      }
+      if (isset($vals['userComputeResourcePreference'])) {
+        $this->userComputeResourcePreference = $vals['userComputeResourcePreference'];
       }
     }
   }
 
   public function getName() {
-    return 'Airavata_getUserStoragePreference_args';
+    return 'Airavata_addUserComputeResourcePreference_args';
   }
 
   public function read($input)
@@ -58126,7 +58273,15 @@ class Airavata_getUserStoragePreference_args {
           break;
         case 4:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userStorageResourceId);
+            $xfer += $input->readString($this->userComputeResourceId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 5:
+          if ($ftype == TType::STRUCT) {
+            $this->userComputeResourcePreference = new \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference();
+            $xfer += $this->userComputeResourcePreference->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -58143,7 +58298,7 @@ class Airavata_getUserStoragePreference_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getUserStoragePreference_args');
+    $xfer += $output->writeStructBegin('Airavata_addUserComputeResourcePreference_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -58162,9 +58317,17 @@ class Airavata_getUserStoragePreference_args {
       $xfer += $output->writeString($this->gatewayID);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->userStorageResourceId !== null) {
-      $xfer += $output->writeFieldBegin('userStorageResourceId', TType::STRING, 4);
-      $xfer += $output->writeString($this->userStorageResourceId);
+    if ($this->userComputeResourceId !== null) {
+      $xfer += $output->writeFieldBegin('userComputeResourceId', TType::STRING, 4);
+      $xfer += $output->writeString($this->userComputeResourceId);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->userComputeResourcePreference !== null) {
+      if (!is_object($this->userComputeResourcePreference)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('userComputeResourcePreference', TType::STRUCT, 5);
+      $xfer += $this->userComputeResourcePreference->write($output);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
@@ -58174,11 +58337,11 @@ class Airavata_getUserStoragePreference_args {
 
 }
 
-class Airavata_getUserStoragePreference_result {
+class Airavata_addUserComputeResourcePreference_result {
   static $_TSPEC;
 
   /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference
+   * @var bool
    */
   public $success = null;
   /**
@@ -58203,8 +58366,7 @@ class Airavata_getUserStoragePreference_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference',
+          'type' => TType::BOOL,
           ),
         1 => array(
           'var' => 'ire',
@@ -58248,7 +58410,7 @@ class Airavata_getUserStoragePreference_result {
   }
 
   public function getName() {
-    return 'Airavata_getUserStoragePreference_result';
+    return 'Airavata_addUserComputeResourcePreference_result';
   }
 
   public function read($input)
@@ -58267,9 +58429,8 @@ class Airavata_getUserStoragePreference_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::STRUCT) {
-            $this->success = new \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference();
-            $xfer += $this->success->read($input);
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->success);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -58318,13 +58479,10 @@ class Airavata_getUserStoragePreference_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getUserStoragePreference_result');
+    $xfer += $output->writeStructBegin('Airavata_addUserComputeResourcePreference_result');
     if ($this->success !== null) {
-      if (!is_object($this->success)) {
-        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
-      }
-      $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
-      $xfer += $this->success->write($output);
+      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
+      $xfer += $output->writeBool($this->success);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -58354,7 +58512,7 @@ class Airavata_getUserStoragePreference_result {
 
 }
 
-class Airavata_getAllUserComputeResourcePreferences_args {
+class Airavata_addUserStoragePreference_args {
   static $_TSPEC;
 
   /**
@@ -58369,6 +58527,14 @@ class Airavata_getAllUserComputeResourcePreferences_args {
    * @var string
    */
   public $gatewayID = null;
+  /**
+   * @var string
+   */
+  public $userStorageResourceId = null;
+  /**
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference
+   */
+  public $userStoragePreference = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -58386,6 +58552,15 @@ class Airavata_getAllUserComputeResourcePreferences_args {
           'var' => 'gatewayID',
           'type' => TType::STRING,
           ),
+        4 => array(
+          'var' => 'userStorageResourceId',
+          'type' => TType::STRING,
+          ),
+        5 => array(
+          'var' => 'userStoragePreference',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference',
+          ),
         );
     }
     if (is_array($vals)) {
@@ -58398,11 +58573,17 @@ class Airavata_getAllUserComputeResourcePreferences_args {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
+      if (isset($vals['userStorageResourceId'])) {
+        $this->userStorageResourceId = $vals['userStorageResourceId'];
+      }
+      if (isset($vals['userStoragePreference'])) {
+        $this->userStoragePreference = $vals['userStoragePreference'];
+      }
     }
   }
 
   public function getName() {
-    return 'Airavata_getAllUserComputeResourcePreferences_args';
+    return 'Airavata_addUserStoragePreference_args';
   }
 
   public function read($input)
@@ -58442,6 +58623,21 @@ class Airavata_getAllUserComputeResourcePreferences_args {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 4:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->userStorageResourceId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 5:
+          if ($ftype == TType::STRUCT) {
+            $this->userStoragePreference = new \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference();
+            $xfer += $this->userStoragePreference->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -58454,7 +58650,7 @@ class Airavata_getAllUserComputeResourcePreferences_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getAllUserComputeResourcePreferences_args');
+    $xfer += $output->writeStructBegin('Airavata_addUserStoragePreference_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -58473,6 +58669,19 @@ class Airavata_getAllUserComputeResourcePreferences_args {
       $xfer += $output->writeString($this->gatewayID);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->userStorageResourceId !== null) {
+      $xfer += $output->writeFieldBegin('userStorageResourceId', TType::STRING, 4);
+      $xfer += $output->writeString($this->userStorageResourceId);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->userStoragePreference !== null) {
+      if (!is_object($this->userStoragePreference)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('userStoragePreference', TType::STRUCT, 5);
+      $xfer += $this->userStoragePreference->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
@@ -58480,11 +58689,11 @@ class Airavata_getAllUserComputeResourcePreferences_args {
 
 }
 
-class Airavata_getAllUserComputeResourcePreferences_result {
+class Airavata_addUserStoragePreference_result {
   static $_TSPEC;
 
   /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference[]
+   * @var bool
    */
   public $success = null;
   /**
@@ -58509,12 +58718,7 @@ class Airavata_getAllUserComputeResourcePreferences_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::LST,
-          'etype' => TType::STRUCT,
-          'elem' => array(
-            'type' => TType::STRUCT,
-            'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference',
-            ),
+          'type' => TType::BOOL,
           ),
         1 => array(
           'var' => 'ire',
@@ -58558,7 +58762,7 @@ class Airavata_getAllUserComputeResourcePreferences_result {
   }
 
   public function getName() {
-    return 'Airavata_getAllUserComputeResourcePreferences_result';
+    return 'Airavata_addUserStoragePreference_result';
   }
 
   public function read($input)
@@ -58577,19 +58781,8 @@ class Airavata_getAllUserComputeResourcePreferences_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::LST) {
-            $this->success = array();
-            $_size253 = 0;
-            $_etype256 = 0;
-            $xfer += $input->readListBegin($_etype256, $_size253);
-            for ($_i257 = 0; $_i257 < $_size253; ++$_i257)
-            {
-              $elem258 = null;
-              $elem258 = new \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference();
-              $xfer += $elem258->read($input);
-              $this->success []= $elem258;
-            }
-            $xfer += $input->readListEnd();
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->success);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -58638,22 +58831,10 @@ class Airavata_getAllUserComputeResourcePreferences_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getAllUserComputeResourcePreferences_result');
+    $xfer += $output->writeStructBegin('Airavata_addUserStoragePreference_result');
     if ($this->success !== null) {
-      if (!is_array($this->success)) {
-        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
-      }
-      $xfer += $output->writeFieldBegin('success', TType::LST, 0);
-      {
-        $output->writeListBegin(TType::STRUCT, count($this->success));
-        {
-          foreach ($this->success as $iter259)
-          {
-            $xfer += $iter259->write($output);
-          }
-        }
-        $output->writeListEnd();
-      }
+      $xfer += $output->writeFieldBegin('success', TType::BOOL, 0);
+      $xfer += $output->writeBool($this->success);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -58683,7 +58864,7 @@ class Airavata_getAllUserComputeResourcePreferences_result {
 
 }
 
-class Airavata_getAllUserStoragePreferences_args {
+class Airavata_getUserComputeResourcePreference_args {
   static $_TSPEC;
 
   /**
@@ -58698,6 +58879,10 @@ class Airavata_getAllUserStoragePreferences_args {
    * @var string
    */
   public $gatewayID = null;
+  /**
+   * @var string
+   */
+  public $userComputeResourceId = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -58715,6 +58900,10 @@ class Airavata_getAllUserStoragePreferences_args {
           'var' => 'gatewayID',
           'type' => TType::STRING,
           ),
+        4 => array(
+          'var' => 'userComputeResourceId',
+          'type' => TType::STRING,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -58727,11 +58916,14 @@ class Airavata_getAllUserStoragePreferences_args {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
+      if (isset($vals['userComputeResourceId'])) {
+        $this->userComputeResourceId = $vals['userComputeResourceId'];
+      }
     }
   }
 
   public function getName() {
-    return 'Airavata_getAllUserStoragePreferences_args';
+    return 'Airavata_getUserComputeResourcePreference_args';
   }
 
   public function read($input)
@@ -58771,6 +58963,13 @@ class Airavata_getAllUserStoragePreferences_args {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 4:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->userComputeResourceId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -58783,7 +58982,7 @@ class Airavata_getAllUserStoragePreferences_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getAllUserStoragePreferences_args');
+    $xfer += $output->writeStructBegin('Airavata_getUserComputeResourcePreference_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -58802,6 +59001,11 @@ class Airavata_getAllUserStoragePreferences_args {
       $xfer += $output->writeString($this->gatewayID);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->userComputeResourceId !== null) {
+      $xfer += $output->writeFieldBegin('userComputeResourceId', TType::STRING, 4);
+      $xfer += $output->writeString($this->userComputeResourceId);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
@@ -58809,11 +59013,11 @@ class Airavata_getAllUserStoragePreferences_args {
 
 }
 
-class Airavata_getAllUserStoragePreferences_result {
+class Airavata_getUserComputeResourcePreference_result {
   static $_TSPEC;
 
   /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference[]
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference
    */
   public $success = null;
   /**
@@ -58838,12 +59042,8 @@ class Airavata_getAllUserStoragePreferences_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::LST,
-          'etype' => TType::STRUCT,
-          'elem' => array(
-            'type' => TType::STRUCT,
-            'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference',
-            ),
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference',
           ),
         1 => array(
           'var' => 'ire',
@@ -58887,7 +59087,7 @@ class Airavata_getAllUserStoragePreferences_result {
   }
 
   public function getName() {
-    return 'Airavata_getAllUserStoragePreferences_result';
+    return 'Airavata_getUserComputeResourcePreference_result';
   }
 
   public function read($input)
@@ -58906,19 +59106,9 @@ class Airavata_getAllUserStoragePreferences_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::LST) {
-            $this->success = array();
-            $_size260 = 0;
-            $_etype263 = 0;
-            $xfer += $input->readListBegin($_etype263, $_size260);
-            for ($_i264 = 0; $_i264 < $_size260; ++$_i264)
-            {
-              $elem265 = null;
-              $elem265 = new \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference();
-              $xfer += $elem265->read($input);
-              $this->success []= $elem265;
-            }
-            $xfer += $input->readListEnd();
+          if ($ftype == TType::STRUCT) {
+            $this->success = new \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference();
+            $xfer += $this->success->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -58967,22 +59157,13 @@ class Airavata_getAllUserStoragePreferences_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getAllUserStoragePreferences_result');
+    $xfer += $output->writeStructBegin('Airavata_getUserComputeResourcePreference_result');
     if ($this->success !== null) {
-      if (!is_array($this->success)) {
+      if (!is_object($this->success)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('success', TType::LST, 0);
-      {
-        $output->writeListBegin(TType::STRUCT, count($this->success));
-        {
-          foreach ($this->success as $iter266)
-          {
-            $xfer += $iter266->write($output);
-          }
-        }
-        $output->writeListEnd();
-      }
+      $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
+      $xfer += $this->success->write($output);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -59012,13 +59193,25 @@ class Airavata_getAllUserStoragePreferences_result {
 
 }
 
-class Airavata_getAllUserResourceProfiles_args {
+class Airavata_getUserStoragePreference_args {
   static $_TSPEC;
 
   /**
    * @var \Airavata\Model\Security\AuthzToken
    */
   public $authzToken = null;
+  /**
+   * @var string
+   */
+  public $userId = null;
+  /**
+   * @var string
+   */
+  public $gatewayID = null;
+  /**
+   * @var string
+   */
+  public $userStorageResourceId = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -59028,17 +59221,38 @@ class Airavata_getAllUserResourceProfiles_args {
           'type' => TType::STRUCT,
           'class' => '\Airavata\Model\Security\AuthzToken',
           ),
+        2 => array(
+          'var' => 'userId',
+          'type' => TType::STRING,
+          ),
+        3 => array(
+          'var' => 'gatewayID',
+          'type' => TType::STRING,
+          ),
+        4 => array(
+          'var' => 'userStorageResourceId',
+          'type' => TType::STRING,
+          ),
         );
     }
     if (is_array($vals)) {
       if (isset($vals['authzToken'])) {
         $this->authzToken = $vals['authzToken'];
       }
+      if (isset($vals['userId'])) {
+        $this->userId = $vals['userId'];
+      }
+      if (isset($vals['gatewayID'])) {
+        $this->gatewayID = $vals['gatewayID'];
+      }
+      if (isset($vals['userStorageResourceId'])) {
+        $this->userStorageResourceId = $vals['userStorageResourceId'];
+      }
     }
   }
 
   public function getName() {
-    return 'Airavata_getAllUserResourceProfiles_args';
+    return 'Airavata_getUserStoragePreference_args';
   }
 
   public function read($input)
@@ -59064,6 +59278,27 @@ class Airavata_getAllUserResourceProfiles_args {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 2:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->userId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->gatewayID);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->userStorageResourceId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -59076,7 +59311,7 @@ class Airavata_getAllUserResourceProfiles_args {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getAllUserResourceProfiles_args');
+    $xfer += $output->writeStructBegin('Airavata_getUserStoragePreference_args');
     if ($this->authzToken !== null) {
       if (!is_object($this->authzToken)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
@@ -59085,6 +59320,21 @@ class Airavata_getAllUserResourceProfiles_args {
       $xfer += $this->authzToken->write($output);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->userId !== null) {
+      $xfer += $output->writeFieldBegin('userId', TType::STRING, 2);
+      $xfer += $output->writeString($this->userId);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->gatewayID !== null) {
+      $xfer += $output->writeFieldBegin('gatewayID', TType::STRING, 3);
+      $xfer += $output->writeString($this->gatewayID);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->userStorageResourceId !== null) {
+      $xfer += $output->writeFieldBegin('userStorageResourceId', TType::STRING, 4);
+      $xfer += $output->writeString($this->userStorageResourceId);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
@@ -59092,11 +59342,11 @@ class Airavata_getAllUserResourceProfiles_args {
 
 }
 
-class Airavata_getAllUserResourceProfiles_result {
+class Airavata_getUserStoragePreference_result {
   static $_TSPEC;
 
   /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile[]
+   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference
    */
   public $success = null;
   /**
@@ -59121,12 +59371,8 @@ class Airavata_getAllUserResourceProfiles_result {
       self::$_TSPEC = array(
         0 => array(
           'var' => 'success',
-          'type' => TType::LST,
-          'etype' => TType::STRUCT,
-          'elem' => array(
-            'type' => TType::STRUCT,
-            'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile',
-            ),
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference',
           ),
         1 => array(
           'var' => 'ire',
@@ -59170,7 +59416,7 @@ class Airavata_getAllUserResourceProfiles_result {
   }
 
   public function getName() {
-    return 'Airavata_getAllUserResourceProfiles_result';
+    return 'Airavata_getUserStoragePreference_result';
   }
 
   public function read($input)
@@ -59189,19 +59435,9 @@ class Airavata_getAllUserResourceProfiles_result {
       switch ($fid)
       {
         case 0:
-          if ($ftype == TType::LST) {
-            $this->success = array();
-            $_size267 = 0;
-            $_etype270 = 0;
-            $xfer += $input->readListBegin($_etype270, $_size267);
-            for ($_i271 = 0; $_i271 < $_size267; ++$_i271)
-            {
-              $elem272 = null;
-              $elem272 = new \Airavata\Model\AppCatalog\UserResourceProfile\UserResourceProfile();
-              $xfer += $elem272->read($input);
-              $this->success []= $elem272;
-            }
-            $xfer += $input->readListEnd();
+          if ($ftype == TType::STRUCT) {
+            $this->success = new \Airavata\Model\AppCatalog\UserResourceProfile\UserStoragePreference();
+            $xfer += $this->success->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -59250,22 +59486,13 @@ class Airavata_getAllUserResourceProfiles_result {
 
   public function write($output) {
     $xfer = 0;
-    $xfer += $output->writeStructBegin('Airavata_getAllUserResourceProfiles_result');
+    $xfer += $output->writeStructBegin('Airavata_getUserStoragePreference_result');
     if ($this->success !== null) {
-      if (!is_array($this->success)) {
+      if (!is_object($this->success)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('success', TType::LST, 0);
-      {
-        $output->writeListBegin(TType::STRUCT, count($this->success));
-        {
-          foreach ($this->success as $iter273)
-          {
-            $xfer += $iter273->write($output);
-          }
-        }
-        $output->writeListEnd();
-      }
+      $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
+      $xfer += $this->success->write($output);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->ire !== null) {
@@ -59295,7 +59522,7 @@ class Airavata_getAllUserResourceProfiles_result {
 
 }
 
-class Airavata_updateUserComputeResourcePreference_args {
+class Airavata_getAllUserComputeResourcePreferences_args {
   static $_TSPEC;
 
   /**
@@ -59310,14 +59537,6 @@ class Airavata_updateUserComputeResourcePreference_args {
    * @var string
    */
   public $gatewayID = null;
-  /**
-   * @var string
-   */
-  public $userComputeResourceId = null;
-  /**
-   * @var \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference
-   */
-  public $userComputeResourcePreference = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -59335,15 +59554,6 @@ class Airavata_updateUserComputeResourcePreference_args {
           'var' => 'gatewayID',
           'type' => TType::STRING,
           ),
-        4 => array(
-          'var' => 'userComputeResourceId',
-          'type' => TType::STRING,
-          ),
-        5 => array(
-          'var' => 'userComputeResourcePreference',
-          'type' => TType::STRUCT,
-          'class' => '\Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference',
-          ),
         );
     }
     if (is_array($vals)) {
@@ -59356,17 +59566,11 @@ class Airavata_updateUserComputeResourcePreference_args {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
-      if (isset($vals['userComputeResourceId'])) {
-        $this->userComputeResourceId = $vals['userComputeResourceId'];
-      }
-      if (isset($vals['userComputeResourcePreference'])) {
-        $this->userComputeResourcePreference = $vals['userComputeResourcePreference'];
-      }
     }
   }
 
   public function getName() {
-    return 'Airavata_updateUserComputeResourcePreference_args';
+    return 'Airavata_getAllUserComputeResourcePreferences_args';
   }
 
   public function read($input)
@@ -59406,21 +59610,6 @@ class Airavata_updateUserComputeResourcePreference_args {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 4:
-          if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->userComputeResourceId);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 5:
-          if ($ftype == TType::STRUCT) {
-            $this->userComputeResourcePreference = new \Airavata\Model\AppCatalog\UserResourceProfile\UserComputeResourcePreference();
-            $xfer += $this->userComputeResourcePreference->read($input);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -59433,7 +59622,7 @@ class Airavata_updateUserComputeResourcePreference_args {
 
   public functi

<TRUNCATED>

[12/12] airavata-php-gateway git commit: AIRAVATA-2500 Disallow editing auto provisioned ssh accounts

Posted by ma...@apache.org.
AIRAVATA-2500 Disallow editing auto provisioned ssh accounts


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

Branch: refs/heads/AIRAVATA-2500
Commit: f78e49e07486d66fc68e9838ed858bc6bc19c3fb
Parents: 4727617
Author: Marcus Christie <ma...@iu.edu>
Authored: Mon Sep 25 17:10:02 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Mon Sep 25 17:10:02 2017 -0400

----------------------------------------------------------------------
 app/controllers/UserSettingsController.php      | 12 +++++++++
 .../user-compute-resource-preferences.blade.php | 27 +++++++++++++-------
 2 files changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f78e49e0/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index 7f449a6..ef17e17 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -102,6 +102,12 @@ class UserSettingsController extends BaseController
     public function getComputeResources(){
 
         $userResourceProfile = URPUtilities::get_or_create_user_resource_profile();
+        $gatewayResourceProfile = CRUtilities::getGatewayResourceProfile();
+        $computeResourcePreferences = $gatewayResourceProfile->computeResourcePreferences;
+        $computeResourcePreferencesById = array();
+        foreach ($computeResourcePreferences as $computeResourcePreference) {
+            $computeResourcePreferencesById[$computeResourcePreference->computeResourceId] = $computeResourcePreference;
+        }
 
         $allCRs = CRUtilities::getAllCRObjects();
         foreach( $allCRs as $index => $crObject)
@@ -111,6 +117,12 @@ class UserSettingsController extends BaseController
         // Add crDetails to each UserComputeResourcePreference
         foreach ($userResourceProfile->userComputeResourcePreferences as $index => $userCompResPref) {
             $userCompResPref->crDetails = $allCRsById[$userCompResPref->computeResourceId];
+            // Disallow editing a UserComputeResourcePreference that was automatically setup by an sshAccountProvisioner
+            $userCompResPref->editable = true;
+            if (array_key_exists($userCompResPref->computeResourceId, $computeResourcePreferencesById)) {
+                $computeResourcePreference = $computeResourcePreferencesById[$userCompResPref->computeResourceId];
+                $userCompResPref->editable = $computeResourcePreference->sshAccountProvisioner == null;
+            }
             // To figure out the unselectedCRs, remove this compute resource from allCRsById
             unset($allCRsById[$userCompResPref->computeResourceId]);
         }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f78e49e0/app/views/partials/user-compute-resource-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-compute-resource-preferences.blade.php b/app/views/partials/user-compute-resource-preferences.blade.php
index 49c3f85..caedb92 100644
--- a/app/views/partials/user-compute-resource-preferences.blade.php
+++ b/app/views/partials/user-compute-resource-preferences.blade.php
@@ -13,14 +13,15 @@
 
     <div class="col-md-9">
         <input type="text" name="loginUserName" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"/>
+               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"
+               @if(isset($preferences) && !$preferences->editable) disabled @endif/>
     </div>
 </div>
 <div class="form-group">
     <label class="control-label col-md-3">Preferred Batch Queue</label>
 
     <div class="col-md-9">
-        <select name="preferredBatchQueue" class="form-control">
+        <select name="preferredBatchQueue" class="form-control" @if(isset($preferences) && !$preferences->editable) disabled @endif>
             <option value="">Select a Queue from list</option>
             @foreach( (array)$computeResource->batchQueues as $index => $queue)
             <option value="{{ $queue->queueName}}"
@@ -35,7 +36,8 @@
 
     <div class="col-md-9">
         <input type="text" name="scratchLocation" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->scratchLocation}}@endif"/>
+               value="@if( isset( $preferences) ){{$preferences->scratchLocation}}@endif"
+               @if(isset($preferences) && !$preferences->editable) disabled @endif/>
     </div>
 </div>
 
@@ -44,7 +46,8 @@
 
     <div class="col-md-9">
         <input type="text" name="allocationProjectNumber" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->allocationProjectNumber}}@endif"/>
+               value="@if( isset( $preferences) ){{$preferences->allocationProjectNumber}}@endif"
+               @if(isset($preferences) && !$preferences->editable) disabled @endif/>
     </div>
 </div>
 
@@ -52,7 +55,7 @@
     <label class="control-label col-md-3">Resource Specific SSH Key</label>
 
     <div class="col-md-9">
-        <select class="form-control" name="resourceSpecificCredentialStoreToken" >
+        <select class="form-control" name="resourceSpecificCredentialStoreToken" @if(isset($preferences) && !$preferences->editable) disabled @endif>
             <option value="" @if( isset( $preferences) && $preferences->resourceSpecificCredentialStoreToken == null) selected @endif>
                 No resource specific SSH key, just use the default one ({{{$defaultCredentialSummary->description}}})
             </option>
@@ -72,7 +75,8 @@
 
     <div class="col-md-9">
         <input type="text" name="qualityOfService" class="qualityOfService form-control"
-               value="@if( isset( $preferences) ){{$preferences->qualityOfService}}@endif" data-toggle="popover" data-placement="bottom" data-content="Format: <queue name1>=<qos1>,<queue name2>=<qos2>"/>
+               value="@if( isset( $preferences) ){{$preferences->qualityOfService}}@endif" data-toggle="popover" data-placement="bottom" data-content="Format: <queue name1>=<qos1>,<queue name2>=<qos2>"
+               @if(isset($preferences) && !$preferences->editable) disabled @endif/>
     </div>
 </div>
 
@@ -81,7 +85,8 @@
 
     <div class="col-md-9">
         <input type="text" name="reservation" class="form-control"
-               value="@if( isset( $preferences) ){{$preferences->reservation}}@endif"/>
+               value="@if( isset( $preferences) ){{$preferences->reservation}}@endif"
+               @if(isset($preferences) && !$preferences->editable) disabled @endif/>
     </div>
 </div>
 <?php
@@ -106,7 +111,8 @@ if( isset( $preferences) && $preferences->reservationEndTime != '') {
 
         <div class="input-group date datetimepicker1">
             <input type="text" name="reservationStartTime" class="form-control"
-                   value="{{$reservationStartTime}}"/>
+                   value="{{$reservationStartTime}}"
+                   @if(isset($preferences) && !$preferences->editable) disabled @endif/>
             <span class="input-group-addon">
                 <span class="glyphicon glyphicon-calendar"></span>
             </span>
@@ -118,7 +124,8 @@ if( isset( $preferences) && $preferences->reservationEndTime != '') {
 
         <div class="input-group date datetimepicker2">
             <input type="text" name="reservationEndTime" class="form-control"
-                   value="{{$reservationEndTime}}"/>
+                   value="{{$reservationEndTime}}"
+                   @if(isset($preferences) && !$preferences->editable) disabled @endif/>
             <span class="input-group-addon">
                 <span class="glyphicon glyphicon-calendar"></span>
             </span>
@@ -126,6 +133,7 @@ if( isset( $preferences) && $preferences->reservationEndTime != '') {
     </div>
 </div>
 
+@if(!isset($preferences) || $preferences->editable)
 <div class="row">
     <div class="form-group col-md-12 text-center">
         <input type="submit" class="btn btn-primary" value="Save"/>
@@ -138,5 +146,6 @@ if( isset( $preferences) && $preferences->reservationEndTime != '') {
         </button>
     </div>
 </div>
+@endif
 
 </div>


[05/12] airavata-php-gateway git commit: AIRAVATA-2500 Thrift stub code generation

Posted by ma...@apache.org.
AIRAVATA-2500 Thrift stub code generation


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/2db05f4f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/2db05f4f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/2db05f4f

Branch: refs/heads/AIRAVATA-2500
Commit: 2db05f4f64988558d10fc7b4b059f422a523e3f7
Parents: 3f67f68
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Sep 7 15:16:14 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Thu Sep 7 15:30:48 2017 -0400

----------------------------------------------------------------------
 .../Model/AppCatalog/GatewayProfile/Types.php   | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2db05f4f/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php b/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
index da3071a..63e39bc 100644
--- a/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
+++ b/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
@@ -118,6 +118,10 @@ class ComputeResourcePreference {
    * @var array
    */
   public $sshAccountProvisionerConfig = null;
+  /**
+   * @var string
+   */
+  public $sshAccountProvisionerAdditionalInfo = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -194,6 +198,10 @@ class ComputeResourcePreference {
             'type' => TType::STRING,
             ),
           ),
+        17 => array(
+          'var' => 'sshAccountProvisionerAdditionalInfo',
+          'type' => TType::STRING,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -245,6 +253,9 @@ class ComputeResourcePreference {
       if (isset($vals['sshAccountProvisionerConfig'])) {
         $this->sshAccountProvisionerConfig = $vals['sshAccountProvisionerConfig'];
       }
+      if (isset($vals['sshAccountProvisionerAdditionalInfo'])) {
+        $this->sshAccountProvisionerAdditionalInfo = $vals['sshAccountProvisionerAdditionalInfo'];
+      }
     }
   }
 
@@ -392,6 +403,13 @@ class ComputeResourcePreference {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 17:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->sshAccountProvisionerAdditionalInfo);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -498,6 +516,11 @@ class ComputeResourcePreference {
       }
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->sshAccountProvisionerAdditionalInfo !== null) {
+      $xfer += $output->writeFieldBegin('sshAccountProvisionerAdditionalInfo', TType::STRING, 17);
+      $xfer += $output->writeString($this->sshAccountProvisionerAdditionalInfo);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;


[04/12] airavata-php-gateway git commit: AIRAVATA-2500 Thrift stub code generation

Posted by ma...@apache.org.
AIRAVATA-2500 Thrift stub code generation


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

Branch: refs/heads/AIRAVATA-2500
Commit: cf2eae7e1e30bf02cb0ee30ae91f558999b9f90d
Parents: f6653e2
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Sep 7 13:12:53 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Thu Sep 7 15:30:43 2017 -0400

----------------------------------------------------------------------
 app/libraries/Airavata/API/Airavata.php         | 4126 +++++++++++-------
 .../AppCatalog/AccountProvisioning/Types.php    |  345 ++
 .../Model/AppCatalog/GatewayProfile/Types.php   |  120 +-
 app/libraries/Airavata/Model/Tenant/Types.php   |  410 +-
 4 files changed, 3326 insertions(+), 1675 deletions(-)
----------------------------------------------------------------------



[09/12] airavata-php-gateway git commit: AIRAVATA-2500 Fixing layout

Posted by ma...@apache.org.
AIRAVATA-2500 Fixing layout


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/20db67cb
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/20db67cb
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/20db67cb

Branch: refs/heads/AIRAVATA-2500
Commit: 20db67cb21d836b6ab4dd42a8bbdb4fb3ee7fbb8
Parents: 277f346
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Sep 22 13:53:40 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Sep 22 13:53:58 2017 -0400

----------------------------------------------------------------------
 .../auto-provisioned-accounts.blade.php         | 44 ++++++++++----------
 1 file changed, 23 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/20db67cb/app/views/partials/auto-provisioned-accounts.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/auto-provisioned-accounts.blade.php b/app/views/partials/auto-provisioned-accounts.blade.php
index 78c9648..5f56aa3 100644
--- a/app/views/partials/auto-provisioned-accounts.blade.php
+++ b/app/views/partials/auto-provisioned-accounts.blade.php
@@ -22,27 +22,29 @@
                 </thead>
                 <tbody>
                     @foreach ($auto_provisioned_accounts as $auto_provisioned_account)
-                        <td>
-                            @if ($auto_provisioned_account["errorMessage"] != null)
-                                <span class="glyphicon glyphicon-warning-sign" style="color: red;"></span> FAILED
-                                <p>
-                                    <small>See <strong>Error Message</strong> for more information and contact Gateway Admin for help.</small>
-                                </p>
-                            @elseif ($auto_provisioned_account["accountExists"] === false)
-                                <span class="glyphicon glyphicon-user" style="color: red;"></span> ACCOUNT MISSING
-                                <p>
-                                    <small>See <strong>Additional Info</strong> for more information on how to create your account on {{{ $auto_provisioned_account["hostname"]}}}.</small>
-                                </p>
-                            @elseif ($auto_provisioned_account["userComputeResourcePreference"] != null)
-                                <span class="glyphicon glyphicon-ok" style="color: green;"></span> OK
-                            @else
-                                <span class="glyphicon glyphicon-question-sign" style="color: grey;"></span> UNKNOWN
-                            @endif
-                        </td>
-                        <td>{{{ $auto_provisioned_account["hostname"] }}}</td>
-                        {{-- Not escaping HTML to allow Gateway Admin to put HTML into additionalInfo field --}}
-                        <td>{{ $auto_provisioned_account["additionalInfo"] }}</td>
-                        <td>{{{ $auto_provisioned_account["errorMessage"] }}}</td>
+                        <tr>
+                            <td>
+                                @if ($auto_provisioned_account["errorMessage"] != null)
+                                    <span class="glyphicon glyphicon-warning-sign" style="color: red;"></span> FAILED
+                                    <p>
+                                        <small>See <strong>Error Message</strong> for more information and contact Gateway Admin for help.</small>
+                                    </p>
+                                @elseif ($auto_provisioned_account["accountExists"] === false)
+                                    <span class="glyphicon glyphicon-user" style="color: red;"></span> ACCOUNT MISSING
+                                    <p>
+                                        <small>See <strong>Additional Info</strong> for more information on how to create your account on {{{ $auto_provisioned_account["hostname"]}}}.</small>
+                                    </p>
+                                @elseif ($auto_provisioned_account["userComputeResourcePreference"] != null)
+                                    <span class="glyphicon glyphicon-ok" style="color: green;"></span> OK
+                                @else
+                                    <span class="glyphicon glyphicon-question-sign" style="color: grey;"></span> UNKNOWN
+                                @endif
+                            </td>
+                            <td>{{{ $auto_provisioned_account["hostname"] }}}</td>
+                            {{-- Not escaping HTML to allow Gateway Admin to put HTML into additionalInfo field --}}
+                            <td>{{ $auto_provisioned_account["additionalInfo"] }}</td>
+                            <td>{{{ $auto_provisioned_account["errorMessage"] }}}</td>
+                        </tr>
                     @endforeach
                 </tbody>
             </table>