airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject [1/8] Initial API Methods for deployment and Interfaces - AIRAVATA-1296
Date Tue, 01 Jul 2014 12:52:02 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 6a30776cd -> f03e6ec54


http://git-wip-us.apache.org/repos/asf/airavata/blob/535ed322/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/GatewayProfile/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/GatewayProfile/Types.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/GatewayProfile/Types.php
new file mode 100644
index 0000000..1ec9fbc
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/GatewayProfile/Types.php
@@ -0,0 +1,154 @@
+<?php
+namespace Airavata\Model\AppCatalog\GatewayProfile;
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * 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;
+
+
+class GatewayProfile {
+  static $_TSPEC;
+
+  public $gatewayID = "DO_NOT_SET_AT_CLIENTS";
+  public $gatewayName = null;
+  public $gatewayDescription = null;
+  public $preferedResource = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'gatewayID',
+          'type' => TType::STRING,
+          ),
+        2 => array(
+          'var' => 'gatewayName',
+          'type' => TType::STRING,
+          ),
+        3 => array(
+          'var' => 'gatewayDescription',
+          'type' => TType::STRING,
+          ),
+        4 => array(
+          'var' => 'preferedResource',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['gatewayID'])) {
+        $this->gatewayID = $vals['gatewayID'];
+      }
+      if (isset($vals['gatewayName'])) {
+        $this->gatewayName = $vals['gatewayName'];
+      }
+      if (isset($vals['gatewayDescription'])) {
+        $this->gatewayDescription = $vals['gatewayDescription'];
+      }
+      if (isset($vals['preferedResource'])) {
+        $this->preferedResource = $vals['preferedResource'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'GatewayProfile';
+  }
+
+  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->gatewayID);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->gatewayName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->gatewayDescription);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->preferedResource);
+          } 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('GatewayProfile');
+    if ($this->gatewayID !== null) {
+      $xfer += $output->writeFieldBegin('gatewayID', TType::STRING, 1);
+      $xfer += $output->writeString($this->gatewayID);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->gatewayName !== null) {
+      $xfer += $output->writeFieldBegin('gatewayName', TType::STRING, 2);
+      $xfer += $output->writeString($this->gatewayName);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->gatewayDescription !== null) {
+      $xfer += $output->writeFieldBegin('gatewayDescription', TType::STRING, 3);
+      $xfer += $output->writeString($this->gatewayDescription);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->preferedResource !== null) {
+      $xfer += $output->writeFieldBegin('preferedResource', TType::STRING, 4);
+      $xfer += $output->writeString($this->preferedResource);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+$GLOBALS['gatewayProfileModel_CONSTANTS']['DEFAULT_ID'] = "DO_NOT_SET_AT_CLIENTS";
+
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/535ed322/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
index 1324b7d..9af252e 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php
@@ -66,7 +66,7 @@ function get_appModule($appModuleId)
 
     try
     {
-        return $airavataclient->getAppicationModule($appModuleId);
+        return $airavataclient->getApplicationDeployment($appModuleId);
     }
     catch (InvalidRequestException $ire)
     {

http://git-wip-us.apache.org/repos/asf/airavata/blob/535ed322/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployedResources.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployedResources.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployedResources.php
new file mode 100644
index 0000000..eccc201
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationDeployedResources.php
@@ -0,0 +1,110 @@
+<?php
+namespace Airavata\Client\Samples;
+
+$airavataconfig = parse_ini_file("airavata-client-properties.ini");
+
+$GLOBALS['THRIFT_ROOT'] = $airavataconfig['THRIFT_LIB_DIR'];
+require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TSocket.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Protocol/TProtocol.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Protocol/TBinaryProtocol.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Exception/TException.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Exception/TApplicationException.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Exception/TProtocolException.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Base/TBase.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Type/TType.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Type/TMessageType.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Factory/TStringFuncFactory.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'StringFunc/TStringFunc.php';
+require_once $GLOBALS['THRIFT_ROOT'] . 'StringFunc/Core.php';
+
+$GLOBALS['AIRAVATA_ROOT'] = $airavataconfig['AIRAVATA_PHP_STUBS_DIR'];
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Airavata.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/AppCatalog/AppDeployment/Types.php';
+
+use Airavata\API\Error\AiravataClientException;
+use Airavata\API\Error\AiravataSystemException;
+use Airavata\API\Error\ExperimentNotFoundException;
+use Airavata\API\Error\InvalidRequestException;
+use Airavata\Client\AiravataClientFactory;
+use Airavata\Model\Workspace\Experiment\ExperimentState;
+use Thrift\Exception\TTransportException;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\TBufferedTransport;
+use Thrift\Transport\TSocket;
+use Airavata\API\AiravataClient;
+
+$transport = new TSocket($airavataconfig['AIRAVATA_SERVER'], $airavataconfig['AIRAVATA_PORT']);
+$transport->setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']);
+
+$protocol = new TBinaryProtocol($transport);
+$transport->open();
+$airavataclient = new AiravataClient($protocol);
+
+
+
+if ($argc != 2)
+{
+    exit("php getApplicationDeployedResources.php <appModuleID> \n");
+}
+
+$appModuleId = $argv[1];
+
+$deployedresources = get_application_deployed_resources($appModuleId);
+
+if (empty($deployedresources)) {
+    echo "deployment returned an empty list \n";
+} else {
+    foreach ($deployedresources as $resource) {
+        echo "$resource->type: $resource->value      <br><br>";
+    }
+}
+
+var_dump($deployedresources);
+
+
+$transport->close();
+
+/**
+ * Get the list of deployed hosts with the given ID
+ * @param $appModuleId
+ * @return null
+ */
+function get_application_deployed_resources($appModuleId)
+{
+    global $airavataclient;
+
+    try
+    {
+        return $airavataclient->getAppModuleDeployedResources($appModuleId);
+    }
+    catch (InvalidRequestException $ire)
+    {
+        echo 'InvalidRequestException!<br><br>' . $ire->getMessage();
+    }
+    catch (ExperimentNotFoundException $enf)
+    {
+        echo 'ExperimentNotFoundException!<br><br>' . $enf->getMessage();
+    }
+    catch (AiravataClientException $ace)
+    {
+        echo 'AiravataClientException!<br><br>' . $ace->getMessage();
+    }
+    catch (AiravataSystemException $ase)
+    {
+        echo 'AiravataSystemException!<br><br>' . $ase->getMessage();
+    }
+    catch (TTransportException $tte)
+    {
+        echo 'TTransportException!<br><br>' . $tte->getMessage();
+    }
+    catch (\Exception $e)
+    {
+        echo 'Exception!<br><br>' . $e->getMessage();
+    }
+
+}
+
+?>
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/535ed322/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppModule.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppModule.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppModule.php
index 7bec80e..e939610 100755
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppModule.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppModule.php
@@ -66,7 +66,7 @@ try
         $appModule->appModuleVersion = $appModuleVersion;
         $appModule->appModuleDescription = $appModuleDescription;
 
-        $appModuleId = $airavataclient->registerAppicationModule($appModule);
+        $appModuleId = $airavataclient->registerApplicationModule($appModule);
 
         if ($appModuleId)
         {

http://git-wip-us.apache.org/repos/asf/airavata/blob/535ed322/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
index 1bc8c99..4bf2d04 100644
--- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
@@ -527,7 +527,7 @@ service Airavata {
  *  are really a suite of applications or encompass an ecosystem. For instance, Amber is
referred to dozens of binaries.
  *  WRF is referred for an ecosystem of applications. In this context, we refer to module
as a single binary.
  *
- * Note: A module has to be defined before a deployment can be registered. .
+ * Note: A module has to be defined before a deployment can be registered.
  *
 */
 
@@ -542,7 +542,7 @@ service Airavata {
    *
    *
   */
-  string registerAppicationModule(1: required applicationDeploymentModel.ApplicationModule
applicationModule)
+  string registerApplicationModule(1: required applicationDeploymentModel.ApplicationModule
applicationModule)
     	throws (1: airavataErrors.InvalidRequestException ire,
               2: airavataErrors.AiravataClientException ace,
               3: airavataErrors.AiravataSystemException ase)
@@ -558,7 +558,7 @@ service Airavata {
    *
    *
   */
-  applicationDeploymentModel.ApplicationModule getAppicationModule(1: required string appModuleId)
+  applicationDeploymentModel.ApplicationModule getApplicationModule(1: required string appModuleId)
       	throws (1: airavataErrors.InvalidRequestException ire,
                 2: airavataErrors.AiravataClientException ace,
                 3: airavataErrors.AiravataSystemException ase)
@@ -577,7 +577,7 @@ service Airavata {
    *
    *
   */
-  bool updateAppicationModule(1: required string appModuleId,
+  bool updateApplicationModule(1: required string appModuleId,
             2: required applicationDeploymentModel.ApplicationModule applicationModule)
       	throws (1: airavataErrors.InvalidRequestException ire,
                 2: airavataErrors.AiravataClientException ace,
@@ -594,9 +594,201 @@ service Airavata {
    *
    *
   */
-  bool deleteAppicationModule(1: required string appModuleId)
+  bool deleteApplicationModule(1: required string appModuleId)
          	throws (1: airavataErrors.InvalidRequestException ire,
                    2: airavataErrors.AiravataClientException ace,
                    3: airavataErrors.AiravataSystemException ase)
 
+/*
+ * Application Deployment registers a deployment of a application module on a compute resource
+ *
+*/
+
+  /**
+   * Register a Application Deployment.
+   *
+   * @param applicationModule
+   *    Application Module Object created from the datamodel.
+   *
+   * @return appDeploymentId
+   *   Returns a server-side generated airavata appDeployment globally unique identifier.
+   *
+   *
+  */
+  string registerApplicationDeployment(1: required applicationDeploymentModel.ApplicationDeploymentDescription
applicationDeployment)
+    	throws (1: airavataErrors.InvalidRequestException ire,
+              2: airavataErrors.AiravataClientException ace,
+              3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Fetch a Application Deployment.
+   *
+   * @param appDeploymentId
+   *   The identifier for the requested application module
+   *
+   * @return applicationDeployment
+   *   Returns a application Deployment Object.
+   *
+   *
+  */
+  applicationDeploymentModel.ApplicationDeploymentDescription getApplicationDeployment(1:
required string appDeploymentId)
+      	throws (1: airavataErrors.InvalidRequestException ire,
+                2: airavataErrors.AiravataClientException ace,
+                3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Update a Application Deployment.
+   *
+   * @param appDeploymentId
+   *   The identifier for the requested application deployment to be updated.
+   *
+   * @param appDeployment
+   *    Application Deployment Object created from the datamodel.
+   *
+   * @return status
+   *   Returns a success/failure of the update.
+   *
+   *
+  */
+  bool updateApplicationDeployment(1: required string appDeploymentId,
+            2: required applicationDeploymentModel.ApplicationDeploymentDescription applicationDeployment)
+      	throws (1: airavataErrors.InvalidRequestException ire,
+                2: airavataErrors.AiravataClientException ace,
+                3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Delete a Application deployment.
+   *
+   * @param appDeploymentId
+   *   The identifier for the requested application deployment to be deleted.
+   *
+   * @return status
+   *   Returns a success/failure of the deletion.
+   *
+   *
+  */
+  bool deleteApplicationDeployment(1: required string appDeploymentId)
+         	throws (1: airavataErrors.InvalidRequestException ire,
+                   2: airavataErrors.AiravataClientException ace,
+                   3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Fetch a list of Deployed Compute Hosts.
+   *
+   * @param appModuleId
+   *   The identifier for the requested application module
+   *
+   * @return list<string>
+   *   Returns a list of Deployed Resources.
+   *
+  */
+  list<string> getAppModuleDeployedResources(1: required string appModuleId)
+      	throws (1: airavataErrors.InvalidRequestException ire,
+                2: airavataErrors.AiravataClientException ace,
+                3: airavataErrors.AiravataSystemException ase)
+
+/*
+ * Application Interface
+ *
+*/
+
+  /**
+   * Register a Application Interface.
+   *
+   * @param applicationModule
+   *    Application Module Object created from the datamodel.
+   *
+   * @return appInterfaceId
+   *   Returns a server-side generated airavata application interface globally unique identifier.
+   *
+   *
+  */
+  string registerApplicationInterface(1: required applicationInterfaceModel.ApplicationInterfaceDescription
+                                            applicationInterface)
+    	throws (1: airavataErrors.InvalidRequestException ire,
+              2: airavataErrors.AiravataClientException ace,
+              3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Fetch a Application Interface.
+   *
+   * @param appInterfaceId
+   *   The identifier for the requested application module
+   *
+   * @return applicationInterface
+   *   Returns a application Interface Object.
+   *
+   *
+  */
+  applicationInterfaceModel.ApplicationInterfaceDescription getApplicationInterface(1: required
string appInterfaceId)
+      	throws (1: airavataErrors.InvalidRequestException ire,
+                2: airavataErrors.AiravataClientException ace,
+                3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Update a Application Interface.
+   *
+   * @param appInterfaceId
+   *   The identifier for the requested application deployment to be updated.
+   *
+   * @param appInterface
+   *    Application Interface Object created from the datamodel.
+   *
+   * @return status
+   *   Returns a success/failure of the update.
+   *
+   *
+  */
+  bool updateApplicationInterface(1: required string appInterfaceId,
+            2: required applicationInterfaceModel.ApplicationInterfaceDescription applicationInterface)
+      	throws (1: airavataErrors.InvalidRequestException ire,
+                2: airavataErrors.AiravataClientException ace,
+                3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Delete a Application Interface.
+   *
+   * @param appInterfaceId
+   *   The identifier for the requested application interface to be deleted.
+   *
+   * @return status
+   *   Returns a success/failure of the deletion.
+   *
+   *
+  */
+  bool deleteApplicationInterface(1: required string appInterfaceId)
+         	throws (1: airavataErrors.InvalidRequestException ire,
+                   2: airavataErrors.AiravataClientException ace,
+                   3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Fetch the list of Application Inputs.
+   *
+   * @param appInterfaceId
+   *   The identifier for the requested application interface
+   *
+   * @return list<applicationInterfaceModel.InputDataObjectType>
+   *   Returns a list of application inputs.
+   *
+  */
+  list<applicationInterfaceModel.InputDataObjectType> getApplicationInputs(1: required
string appInterfaceId)
+      	throws (1: airavataErrors.InvalidRequestException ire,
+                2: airavataErrors.AiravataClientException ace,
+                3: airavataErrors.AiravataSystemException ase)
+
+  /**
+   * Fetch the list of Application Outputs.
+   *
+   * @param appInterfaceId
+   *   The identifier for the requested application interface
+   *
+   * @return list<applicationInterfaceModel.OutputDataObjectType>
+   *   Returns a list of application outputs.
+   *
+  */
+  list<applicationInterfaceModel.OutputDataObjectType> getApplicationOutputs(1: required
string appInterfaceId)
+      	throws (1: airavataErrors.InvalidRequestException ire,
+                2: airavataErrors.AiravataClientException ace,
+                3: airavataErrors.AiravataSystemException ase)
+
 }
\ No newline at end of file


Mime
View raw message