airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject airavata-php-gateway git commit: adding data models for storage resource
Date Thu, 12 Nov 2015 18:10:27 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop ec87b34f3 -> c143b23b6


adding data models for storage resource


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/c143b23b
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/c143b23b
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/c143b23b

Branch: refs/heads/develop
Commit: c143b23b6d8b1fc1e5b5c01c923d5431f920e0d8
Parents: ec87b34
Author: smarru <smarru@apache.org>
Authored: Thu Nov 12 13:10:22 2015 -0500
Committer: smarru <smarru@apache.org>
Committed: Thu Nov 12 13:10:22 2015 -0500

----------------------------------------------------------------------
 .../Model/AppCatalog/GatewayProfile/Types.php   |  37 +--
 .../Model/AppCatalog/StorageResource/Types.php  | 232 +++++++++++++++++++
 app/libraries/Airavata/Model/Task/Types.php     |   2 +
 3 files changed, 241 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c143b23b/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 098ec1e..f63f2f0 100644
--- a/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
+++ b/app/libraries/Airavata/Model/AppCatalog/GatewayProfile/Types.php
@@ -477,10 +477,6 @@ class GatewayResourceProfile {
   /**
    * @var string
    */
-  public $dataStorageHostName = null;
-  /**
-   * @var string
-   */
   public $credentialStoreToken = null;
   /**
    * @var \Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference[]
@@ -499,14 +495,10 @@ class GatewayResourceProfile {
           'type' => TType::STRING,
           ),
         2 => array(
-          'var' => 'dataStorageHostName',
-          'type' => TType::STRING,
-          ),
-        3 => array(
           'var' => 'credentialStoreToken',
           'type' => TType::STRING,
           ),
-        4 => array(
+        3 => array(
           'var' => 'computeResourcePreferences',
           'type' => TType::LST,
           'etype' => TType::STRUCT,
@@ -515,7 +507,7 @@ class GatewayResourceProfile {
             'class' => '\Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference',
             ),
           ),
-        5 => array(
+        4 => array(
           'var' => 'dataStoragePreferences',
           'type' => TType::LST,
           'etype' => TType::STRUCT,
@@ -530,9 +522,6 @@ class GatewayResourceProfile {
       if (isset($vals['gatewayID'])) {
         $this->gatewayID = $vals['gatewayID'];
       }
-      if (isset($vals['dataStorageHostName'])) {
-        $this->dataStorageHostName = $vals['dataStorageHostName'];
-      }
       if (isset($vals['credentialStoreToken'])) {
         $this->credentialStoreToken = $vals['credentialStoreToken'];
       }
@@ -573,19 +562,12 @@ class GatewayResourceProfile {
           break;
         case 2:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->dataStorageHostName);
-          } else {
-            $xfer += $input->skip($ftype);
-          }
-          break;
-        case 3:
-          if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->credentialStoreToken);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 4:
+        case 3:
           if ($ftype == TType::LST) {
             $this->computeResourcePreferences = array();
             $_size0 = 0;
@@ -603,7 +585,7 @@ class GatewayResourceProfile {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 5:
+        case 4:
           if ($ftype == TType::LST) {
             $this->dataStoragePreferences = array();
             $_size6 = 0;
@@ -639,13 +621,8 @@ class GatewayResourceProfile {
       $xfer += $output->writeString($this->gatewayID);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->dataStorageHostName !== null) {
-      $xfer += $output->writeFieldBegin('dataStorageHostName', TType::STRING, 2);
-      $xfer += $output->writeString($this->dataStorageHostName);
-      $xfer += $output->writeFieldEnd();
-    }
     if ($this->credentialStoreToken !== null) {
-      $xfer += $output->writeFieldBegin('credentialStoreToken', TType::STRING, 3);
+      $xfer += $output->writeFieldBegin('credentialStoreToken', TType::STRING, 2);
       $xfer += $output->writeString($this->credentialStoreToken);
       $xfer += $output->writeFieldEnd();
     }
@@ -653,7 +630,7 @@ class GatewayResourceProfile {
       if (!is_array($this->computeResourcePreferences)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('computeResourcePreferences', TType::LST, 4);
+      $xfer += $output->writeFieldBegin('computeResourcePreferences', TType::LST, 3);
       {
         $output->writeListBegin(TType::STRUCT, count($this->computeResourcePreferences));
         {
@@ -670,7 +647,7 @@ class GatewayResourceProfile {
       if (!is_array($this->dataStoragePreferences)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('dataStoragePreferences', TType::LST, 5);
+      $xfer += $output->writeFieldBegin('dataStoragePreferences', TType::LST, 4);
       {
         $output->writeListBegin(TType::STRUCT, count($this->dataStoragePreferences));
         {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c143b23b/app/libraries/Airavata/Model/AppCatalog/StorageResource/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/AppCatalog/StorageResource/Types.php b/app/libraries/Airavata/Model/AppCatalog/StorageResource/Types.php
new file mode 100644
index 0000000..0cf3227
--- /dev/null
+++ b/app/libraries/Airavata/Model/AppCatalog/StorageResource/Types.php
@@ -0,0 +1,232 @@
+<?php
+namespace Airavata\Model\AppCatalog\StorageResource;
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.2)
+ *
+ * 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;
+
+
+/**
+ * Storage Resource Description
+ * 
+ * storageResourceId: Airavata Internal Unique Identifier to distinguish Compute Resource.
+ * 
+ * hostName:
+ *   Fully Qualified Host Name.
+ * 
+ * storageResourceDescription:
+ *  A user friendly description of the resource.
+ * 
+ * 
+ * DataMovementProtocol:
+ *  Option to specify a prefered data movement mechanism of the available options.
+ * 
+ * 
+ */
+class StorageResourceDescription {
+  static $_TSPEC;
+
+  /**
+   * @var string
+   */
+  public $storageResourceId = "DO_NOT_SET_AT_CLIENTS";
+  /**
+   * @var string
+   */
+  public $hostName = null;
+  /**
+   * @var string
+   */
+  public $storageResourceDescription = null;
+  /**
+   * @var bool
+   */
+  public $enabled = null;
+  /**
+   * @var \Airavata\Model\AppCatalog\ComputeResource\DataMovementInterface[]
+   */
+  public $dataMovementInterfaces = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'storageResourceId',
+          'type' => TType::STRING,
+          ),
+        2 => array(
+          'var' => 'hostName',
+          'type' => TType::STRING,
+          ),
+        3 => array(
+          'var' => 'storageResourceDescription',
+          'type' => TType::STRING,
+          ),
+        4 => array(
+          'var' => 'enabled',
+          'type' => TType::BOOL,
+          ),
+        5 => array(
+          'var' => 'dataMovementInterfaces',
+          'type' => TType::LST,
+          'etype' => TType::STRUCT,
+          'elem' => array(
+            'type' => TType::STRUCT,
+            'class' => '\Airavata\Model\AppCatalog\ComputeResource\DataMovementInterface',
+            ),
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['storageResourceId'])) {
+        $this->storageResourceId = $vals['storageResourceId'];
+      }
+      if (isset($vals['hostName'])) {
+        $this->hostName = $vals['hostName'];
+      }
+      if (isset($vals['storageResourceDescription'])) {
+        $this->storageResourceDescription = $vals['storageResourceDescription'];
+      }
+      if (isset($vals['enabled'])) {
+        $this->enabled = $vals['enabled'];
+      }
+      if (isset($vals['dataMovementInterfaces'])) {
+        $this->dataMovementInterfaces = $vals['dataMovementInterfaces'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'StorageResourceDescription';
+  }
+
+  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->storageResourceId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->hostName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->storageResourceDescription);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->enabled);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 5:
+          if ($ftype == TType::LST) {
+            $this->dataMovementInterfaces = array();
+            $_size0 = 0;
+            $_etype3 = 0;
+            $xfer += $input->readListBegin($_etype3, $_size0);
+            for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
+            {
+              $elem5 = null;
+              $elem5 = new \Airavata\Model\AppCatalog\ComputeResource\DataMovementInterface();
+              $xfer += $elem5->read($input);
+              $this->dataMovementInterfaces []= $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('StorageResourceDescription');
+    if ($this->storageResourceId !== null) {
+      $xfer += $output->writeFieldBegin('storageResourceId', TType::STRING, 1);
+      $xfer += $output->writeString($this->storageResourceId);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->hostName !== null) {
+      $xfer += $output->writeFieldBegin('hostName', TType::STRING, 2);
+      $xfer += $output->writeString($this->hostName);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->storageResourceDescription !== null) {
+      $xfer += $output->writeFieldBegin('storageResourceDescription', TType::STRING, 3);
+      $xfer += $output->writeString($this->storageResourceDescription);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->enabled !== null) {
+      $xfer += $output->writeFieldBegin('enabled', TType::BOOL, 4);
+      $xfer += $output->writeBool($this->enabled);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->dataMovementInterfaces !== null) {
+      if (!is_array($this->dataMovementInterfaces)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('dataMovementInterfaces', TType::LST, 5);
+      {
+        $output->writeListBegin(TType::STRUCT, count($this->dataMovementInterfaces));
+        {
+          foreach ($this->dataMovementInterfaces 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/c143b23b/app/libraries/Airavata/Model/Task/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/Task/Types.php b/app/libraries/Airavata/Model/Task/Types.php
index 2e3f678..df9e68d 100644
--- a/app/libraries/Airavata/Model/Task/Types.php
+++ b/app/libraries/Airavata/Model/Task/Types.php
@@ -27,12 +27,14 @@ final class TaskTypes {
   const JOB_SUBMISSION = 2;
   const ENV_CLEANUP = 3;
   const MONITORING = 4;
+  const OUTPUT_FETCHING = 5;
   static public $__names = array(
     0 => 'ENV_SETUP',
     1 => 'DATA_STAGING',
     2 => 'JOB_SUBMISSION',
     3 => 'ENV_CLEANUP',
     4 => 'MONITORING',
+    5 => 'OUTPUT_FETCHING',
   );
 }
 


Mime
View raw message