Repository: airavata-php-gateway Updated Branches: refs/heads/master ebfb50aba -> 93754768e
adding updating php libraries 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/93754768 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/93754768 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/93754768 Branch: refs/heads/master Commit: 93754768ed1d99aaab8da21d8be0301d4b71d721 Parents: ebfb50a Author: Chathuri Wimalasena <[email protected]> Authored: Tue Oct 13 14:00:39 2015 -0400 Committer: Chathuri Wimalasena <[email protected]> Committed: Tue Oct 13 14:00:39 2015 -0400 ---------------------------------------------------------------------- app/libraries/Airavata/API/Airavata.php | 360 +++++++++++++++++++ .../Model/AppCatalog/AppDeployment/Types.php | 4 + 2 files changed, 364 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/93754768/app/libraries/Airavata/API/Airavata.php ---------------------------------------------------------------------- diff --git a/app/libraries/Airavata/API/Airavata.php b/app/libraries/Airavata/API/Airavata.php index d0cde56..edf5211 100644 --- a/app/libraries/Airavata/API/Airavata.php +++ b/app/libraries/Airavata/API/Airavata.php @@ -559,6 +559,24 @@ interface AiravataIf { */ public function createExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, \Airavata\Model\Experiment\ExperimentModel $experiment); /** + * If the experiment is not already launched experiment can be deleted. + * + * @param authzToken + * @param experiementId + * + * @return boolean identifier for the success or failure of the deletion operation + * + * + * @param \Airavata\Model\Security\AuthzToken $authzToken + * @param string $experimentId + * @return bool + * @throws \Airavata\API\Error\InvalidRequestException + * @throws \Airavata\API\Error\AiravataClientException + * @throws \Airavata\API\Error\AiravataSystemException + * @throws \Airavata\API\Error\AuthorizationException + */ + public function deleteExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $experimentId); + /** * Fetch previously created experiment metadata. * * @param airavataExperimentId @@ -4387,6 +4405,70 @@ class AiravataClient implements \Airavata\API\AiravataIf { throw new \Exception("createExperiment failed: unknown result"); } + public function deleteExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $experimentId) + { + $this->send_deleteExperiment($authzToken, $experimentId); + return $this->recv_deleteExperiment(); + } + + public function send_deleteExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $experimentId) + { + $args = new \Airavata\API\Airavata_deleteExperiment_args(); + $args->authzToken = $authzToken; + $args->experimentId = $experimentId; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'deleteExperiment', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('deleteExperiment', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_deleteExperiment() + { + $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_deleteExperiment_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_deleteExperiment_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("deleteExperiment failed: unknown result"); + } + public function getExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId) { $this->send_getExperiment($authzToken, $airavataExperimentId); @@ -19597,6 +19679,284 @@ class Airavata_createExperiment_result { } +class Airavata_deleteExperiment_args { + static $_TSPEC; + + /** + * @var \Airavata\Model\Security\AuthzToken + */ + public $authzToken = null; + /** + * @var string + */ + public $experimentId = 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' => 'experimentId', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['authzToken'])) { + $this->authzToken = $vals['authzToken']; + } + if (isset($vals['experimentId'])) { + $this->experimentId = $vals['experimentId']; + } + } + } + + public function getName() { + return 'Airavata_deleteExperiment_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->experimentId); + } 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_deleteExperiment_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->experimentId !== null) { + $xfer += $output->writeFieldBegin('experimentId', TType::STRING, 2); + $xfer += $output->writeString($this->experimentId); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class Airavata_deleteExperiment_result { + static $_TSPEC; + + /** + * @var bool + */ + public $success = null; + /** + * @var \Airavata\API\Error\InvalidRequestException + */ + public $ire = 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; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'ire', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\InvalidRequestException', + ), + 2 => array( + 'var' => 'ace', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\AiravataClientException', + ), + 3 => array( + 'var' => 'ase', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\AiravataSystemException', + ), + 4 => array( + 'var' => 'ae', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\AuthorizationException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ire'])) { + $this->ire = $vals['ire']; + } + if (isset($vals['ace'])) { + $this->ace = $vals['ace']; + } + if (isset($vals['ase'])) { + $this->ase = $vals['ase']; + } + if (isset($vals['ae'])) { + $this->ae = $vals['ae']; + } + } + } + + public function getName() { + return 'Airavata_deleteExperiment_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::BOOL) { + $xfer += $input->readBool($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->ace = new \Airavata\API\Error\AiravataClientException(); + $xfer += $this->ace->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->ase = new \Airavata\API\Error\AiravataSystemException(); + $xfer += $this->ase->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRUCT) { + $this->ae = new \Airavata\API\Error\AuthorizationException(); + $xfer += $this->ae->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_deleteExperiment_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($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->ace !== null) { + $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 2); + $xfer += $this->ace->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ase !== null) { + $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 3); + $xfer += $this->ase->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ae !== null) { + $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 4); + $xfer += $this->ae->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class Airavata_getExperiment_args { static $_TSPEC; http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/93754768/app/libraries/Airavata/Model/AppCatalog/AppDeployment/Types.php ---------------------------------------------------------------------- diff --git a/app/libraries/Airavata/Model/AppCatalog/AppDeployment/Types.php b/app/libraries/Airavata/Model/AppCatalog/AppDeployment/Types.php index 1a237c4..61d4c5a 100644 --- a/app/libraries/Airavata/Model/AppCatalog/AppDeployment/Types.php +++ b/app/libraries/Airavata/Model/AppCatalog/AppDeployment/Types.php @@ -38,11 +38,15 @@ final class ApplicationParallelismType { const MPI = 1; const OPENMP = 2; const OPENMP_MPI = 3; + const CCM = 4; + const CRAY_MPI = 5; static public $__names = array( 0 => 'SERIAL', 1 => 'MPI', 2 => 'OPENMP', 3 => 'OPENMP_MPI', + 4 => 'CCM', + 5 => 'CRAY_MPI', ); }
