airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [4/7] airavata git commit: AIRAVATA-2207 Add cloneExperimentByAdmin API method
Date Thu, 10 Nov 2016 20:08:44 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/5f3b778e/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index 0b614c2..fe72dce 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -1332,6 +1332,63 @@ interface AiravataIf {
   public function cloneExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $existingExperimentID,
$newExperimentName, $newExperimentProjectId);
   /**
    * 
+   * Clone an Existing Experiment by an admin user
+   * Existing specified experiment is cloned and a new name is provided. A copy of the experiment
configuration is made and is persisted with new metadata.
+   *   The client has to subsequently update this configuration if needed and launch the
cloned experiment.
+   * 
+   * @param newExperimentName
+   *    experiment name that should be used in the cloned experiment
+   * 
+   * @param updatedExperiment
+   *    Once an experiment is cloned, to disambiguate, the users are suggested to provide
new metadata. This will again require
+   *      the basic experiment metadata like the name and description, intended user, the
gateway identifier and if the experiment
+   *      should be shared public by default.
+   * @param newExperimentProjectId
+   *    The project in which to create the cloned experiment. This is optional and if null
the experiment will be created
+   *      in the same project as the existing experiment.
+   * 
+   * @return
+   *   The server-side generated.airavata.registry.core.experiment.globally unique identifier
(Experiment ID) for the newly cloned experiment.
+   * 
+   * @throws org.apache.airavata.model.error.InvalidRequestException
+   *    For any incorrect forming of the request itself.
+   * 
+   * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+   *    If the specified experiment is not previously created, then an Experiment Not Found
Exception is thrown.
+   * 
+   * @throws org.apache.airavata.model.error.AiravataClientException
+   *    The following list of exceptions are thrown which Airavata Client can take corrective
actions to resolve:
+   * 
+   *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time
administrative
+   *         step, then Airavata Registry will not have a provenance area setup. The client
has to follow
+   *         gateway registration steps and retry this request.
+   * 
+   *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+   *         For now this is a place holder.
+   * 
+   *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more
robust security hand-shake
+   *         is implemented, the authorization will be more substantial.
+   * 
+   * @throws org.apache.airavata.model.error.AiravataSystemException
+   *    This exception will be thrown for any Airavata Server side issues and if the problem
cannot be corrected by the client
+   *       rather an Airavata Administrator will be notified to take corrective action.
+   * 
+   * 
+   * @param \Airavata\Model\Security\AuthzToken $authzToken
+   * @param string $existingExperimentID
+   * @param string $newExperimentName
+   * @param string $newExperimentProjectId
+   * @return string
+   * @throws \Airavata\API\Error\InvalidRequestException
+   * @throws \Airavata\API\Error\ExperimentNotFoundException
+   * @throws \Airavata\API\Error\AiravataClientException
+   * @throws \Airavata\API\Error\AiravataSystemException
+   * @throws \Airavata\API\Error\AuthorizationException
+   * @throws \Airavata\API\Error\ProjectNotFoundException
+   */
+  public function cloneExperimentByAdmin(\Airavata\Model\Security\AuthzToken $authzToken,
$existingExperimentID, $newExperimentName, $newExperimentProjectId);
+  /**
+   * 
    * Terminate a running Experiment.
    * 
    * @gatewayId
@@ -7280,6 +7337,78 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("cloneExperiment failed: unknown result");
   }
 
+  public function cloneExperimentByAdmin(\Airavata\Model\Security\AuthzToken $authzToken,
$existingExperimentID, $newExperimentName, $newExperimentProjectId)
+  {
+    $this->send_cloneExperimentByAdmin($authzToken, $existingExperimentID, $newExperimentName,
$newExperimentProjectId);
+    return $this->recv_cloneExperimentByAdmin();
+  }
+
+  public function send_cloneExperimentByAdmin(\Airavata\Model\Security\AuthzToken $authzToken,
$existingExperimentID, $newExperimentName, $newExperimentProjectId)
+  {
+    $args = new \Airavata\API\Airavata_cloneExperimentByAdmin_args();
+    $args->authzToken = $authzToken;
+    $args->existingExperimentID = $existingExperimentID;
+    $args->newExperimentName = $newExperimentName;
+    $args->newExperimentProjectId = $newExperimentProjectId;
+    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+    if ($bin_accel)
+    {
+      thrift_protocol_write_binary($this->output_, 'cloneExperimentByAdmin', TMessageType::CALL,
$args, $this->seqid_, $this->output_->isStrictWrite());
+    }
+    else
+    {
+      $this->output_->writeMessageBegin('cloneExperimentByAdmin', TMessageType::CALL,
$this->seqid_);
+      $args->write($this->output_);
+      $this->output_->writeMessageEnd();
+      $this->output_->getTransport()->flush();
+    }
+  }
+
+  public function recv_cloneExperimentByAdmin()
+  {
+    $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_cloneExperimentByAdmin_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_cloneExperimentByAdmin_result();
+      $result->read($this->input_);
+      $this->input_->readMessageEnd();
+    }
+    if ($result->success !== null) {
+      return $result->success;
+    }
+    if ($result->ire !== null) {
+      throw $result->ire;
+    }
+    if ($result->enf !== null) {
+      throw $result->enf;
+    }
+    if ($result->ace !== null) {
+      throw $result->ace;
+    }
+    if ($result->ase !== null) {
+      throw $result->ase;
+    }
+    if ($result->ae !== null) {
+      throw $result->ae;
+    }
+    if ($result->pnfe !== null) {
+      throw $result->pnfe;
+    }
+    throw new \Exception("cloneExperimentByAdmin failed: unknown result");
+  }
+
   public function terminateExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$gatewayId)
   {
     $this->send_terminateExperiment($authzToken, $airavataExperimentId, $gatewayId);
@@ -30341,6 +30470,380 @@ class Airavata_cloneExperiment_result {
 
 }
 
+class Airavata_cloneExperimentByAdmin_args {
+  static $_TSPEC;
+
+  /**
+   * @var \Airavata\Model\Security\AuthzToken
+   */
+  public $authzToken = null;
+  /**
+   * @var string
+   */
+  public $existingExperimentID = null;
+  /**
+   * @var string
+   */
+  public $newExperimentName = null;
+  /**
+   * @var string
+   */
+  public $newExperimentProjectId = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'authzToken',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\Security\AuthzToken',
+          ),
+        2 => array(
+          'var' => 'existingExperimentID',
+          'type' => TType::STRING,
+          ),
+        3 => array(
+          'var' => 'newExperimentName',
+          'type' => TType::STRING,
+          ),
+        4 => array(
+          'var' => 'newExperimentProjectId',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['authzToken'])) {
+        $this->authzToken = $vals['authzToken'];
+      }
+      if (isset($vals['existingExperimentID'])) {
+        $this->existingExperimentID = $vals['existingExperimentID'];
+      }
+      if (isset($vals['newExperimentName'])) {
+        $this->newExperimentName = $vals['newExperimentName'];
+      }
+      if (isset($vals['newExperimentProjectId'])) {
+        $this->newExperimentProjectId = $vals['newExperimentProjectId'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'Airavata_cloneExperimentByAdmin_args';
+  }
+
+  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::STRUCT) {
+            $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+            $xfer += $this->authzToken->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->existingExperimentID);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->newExperimentName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->newExperimentProjectId);
+          } 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('Airavata_cloneExperimentByAdmin_args');
+    if ($this->authzToken !== null) {
+      if (!is_object($this->authzToken)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+      $xfer += $this->authzToken->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->existingExperimentID !== null) {
+      $xfer += $output->writeFieldBegin('existingExperimentID', TType::STRING, 2);
+      $xfer += $output->writeString($this->existingExperimentID);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->newExperimentName !== null) {
+      $xfer += $output->writeFieldBegin('newExperimentName', TType::STRING, 3);
+      $xfer += $output->writeString($this->newExperimentName);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->newExperimentProjectId !== null) {
+      $xfer += $output->writeFieldBegin('newExperimentProjectId', TType::STRING, 4);
+      $xfer += $output->writeString($this->newExperimentProjectId);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+class Airavata_cloneExperimentByAdmin_result {
+  static $_TSPEC;
+
+  /**
+   * @var string
+   */
+  public $success = null;
+  /**
+   * @var \Airavata\API\Error\InvalidRequestException
+   */
+  public $ire = null;
+  /**
+   * @var \Airavata\API\Error\ExperimentNotFoundException
+   */
+  public $enf = null;
+  /**
+   * @var \Airavata\API\Error\AiravataClientException
+   */
+  public $ace = null;
+  /**
+   * @var \Airavata\API\Error\AiravataSystemException
+   */
+  public $ase = null;
+  /**
+   * @var \Airavata\API\Error\AuthorizationException
+   */
+  public $ae = null;
+  /**
+   * @var \Airavata\API\Error\ProjectNotFoundException
+   */
+  public $pnfe = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        0 => array(
+          'var' => 'success',
+          'type' => TType::STRING,
+          ),
+        1 => array(
+          'var' => 'ire',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\InvalidRequestException',
+          ),
+        2 => array(
+          'var' => 'enf',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+          ),
+        3 => array(
+          'var' => 'ace',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AiravataClientException',
+          ),
+        4 => array(
+          'var' => 'ase',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AiravataSystemException',
+          ),
+        5 => array(
+          'var' => 'ae',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AuthorizationException',
+          ),
+        6 => array(
+          'var' => 'pnfe',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\ProjectNotFoundException',
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['success'])) {
+        $this->success = $vals['success'];
+      }
+      if (isset($vals['ire'])) {
+        $this->ire = $vals['ire'];
+      }
+      if (isset($vals['enf'])) {
+        $this->enf = $vals['enf'];
+      }
+      if (isset($vals['ace'])) {
+        $this->ace = $vals['ace'];
+      }
+      if (isset($vals['ase'])) {
+        $this->ase = $vals['ase'];
+      }
+      if (isset($vals['ae'])) {
+        $this->ae = $vals['ae'];
+      }
+      if (isset($vals['pnfe'])) {
+        $this->pnfe = $vals['pnfe'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'Airavata_cloneExperimentByAdmin_result';
+  }
+
+  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 0:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->success);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 1:
+          if ($ftype == TType::STRUCT) {
+            $this->ire = new \Airavata\API\Error\InvalidRequestException();
+            $xfer += $this->ire->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRUCT) {
+            $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+            $xfer += $this->enf->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
+          if ($ftype == TType::STRUCT) {
+            $this->ace = new \Airavata\API\Error\AiravataClientException();
+            $xfer += $this->ace->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRUCT) {
+            $this->ase = new \Airavata\API\Error\AiravataSystemException();
+            $xfer += $this->ase->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 5:
+          if ($ftype == TType::STRUCT) {
+            $this->ae = new \Airavata\API\Error\AuthorizationException();
+            $xfer += $this->ae->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 6:
+          if ($ftype == TType::STRUCT) {
+            $this->pnfe = new \Airavata\API\Error\ProjectNotFoundException();
+            $xfer += $this->pnfe->read($input);
+          } 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('Airavata_cloneExperimentByAdmin_result');
+    if ($this->success !== null) {
+      $xfer += $output->writeFieldBegin('success', TType::STRING, 0);
+      $xfer += $output->writeString($this->success);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ire !== null) {
+      $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+      $xfer += $this->ire->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->enf !== null) {
+      $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+      $xfer += $this->enf->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ace !== null) {
+      $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+      $xfer += $this->ace->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ase !== null) {
+      $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+      $xfer += $this->ase->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ae !== null) {
+      $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 5);
+      $xfer += $this->ae->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->pnfe !== null) {
+      $xfer += $output->writeFieldBegin('pnfe', TType::STRUCT, 6);
+      $xfer += $this->pnfe->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
 class Airavata_terminateExperiment_args {
   static $_TSPEC;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/5f3b778e/modules/configuration/server/src/main/resources/airavata-default-xacml-policy.xml
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-default-xacml-policy.xml
b/modules/configuration/server/src/main/resources/airavata-default-xacml-policy.xml
index 02319e3..58730c9 100644
--- a/modules/configuration/server/src/main/resources/airavata-default-xacml-policy.xml
+++ b/modules/configuration/server/src/main/resources/airavata-default-xacml-policy.xml
@@ -81,6 +81,7 @@
 /airavata/getJobStatuses|
 /airavata/getJobDetails|
 /airavata/cloneExperiment|
+/airavata/cloneExperimentByAdmin|
 /airavata/terminateExperiment|
 /airavata/getApplicationInterface|
 /airavata/getAllApplicationInterfaceNames|

http://git-wip-us.apache.org/repos/asf/airavata/blob/5f3b778e/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
index f64aeb4..9a07df0 100644
--- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
+++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
@@ -1199,6 +1199,60 @@ service Airavata {
 
   /**
    *
+   * Clone an Existing Experiment by an admin user
+   * Existing specified experiment is cloned and a new name is provided. A copy of the experiment
configuration is made and is persisted with new metadata.
+   *   The client has to subsequently update this configuration if needed and launch the
cloned experiment.
+   *
+   * @param newExperimentName
+   *    experiment name that should be used in the cloned experiment
+   *
+   * @param updatedExperiment
+   *    Once an experiment is cloned, to disambiguate, the users are suggested to provide
new metadata. This will again require
+   *      the basic experiment metadata like the name and description, intended user, the
gateway identifier and if the experiment
+   *      should be shared public by default.
+   * @param newExperimentProjectId
+   *    The project in which to create the cloned experiment. This is optional and if null
the experiment will be created
+   *      in the same project as the existing experiment.
+   *
+   * @return
+   *   The server-side generated.airavata.registry.core.experiment.globally unique identifier
(Experiment ID) for the newly cloned experiment.
+   *
+   * @throws org.apache.airavata.model.error.InvalidRequestException
+   *    For any incorrect forming of the request itself.
+   *
+   * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+   *    If the specified experiment is not previously created, then an Experiment Not Found
Exception is thrown.
+   *
+   * @throws org.apache.airavata.model.error.AiravataClientException
+   *    The following list of exceptions are thrown which Airavata Client can take corrective
actions to resolve:
+   *
+   *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time
administrative
+   *         step, then Airavata Registry will not have a provenance area setup. The client
has to follow
+   *         gateway registration steps and retry this request.
+   *
+   *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+   *         For now this is a place holder.
+   *
+   *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more
robust security hand-shake
+   *         is implemented, the authorization will be more substantial.
+   *
+   * @throws org.apache.airavata.model.error.AiravataSystemException
+   *    This exception will be thrown for any Airavata Server side issues and if the problem
cannot be corrected by the client
+   *       rather an Airavata Administrator will be notified to take corrective action.
+   *
+  */
+  string cloneExperimentByAdmin(1: required security_model.AuthzToken authzToken,
+                                2: string existingExperimentID,
+                                3: string newExperimentName,
+                                4: string newExperimentProjectId)
+    throws (1: airavata_errors.InvalidRequestException ire,
+            2: airavata_errors.ExperimentNotFoundException enf,
+            3: airavata_errors.AiravataClientException ace,
+            4: airavata_errors.AiravataSystemException ase,
+            5: airavata_errors.AuthorizationException ae,
+            6: airavata_errors.ProjectNotFoundException pnfe)
+  /**
+   *
    * Terminate a running Experiment.
    *
    * @gatewayId


Mime
View raw message