Repository: airavata Updated Branches: refs/heads/develop 93431b19c -> 400e24d63
http://git-wip-us.apache.org/repos/asf/airavata/blob/0fda5a8f/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 0cea7e2..0b614c2 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 @@ -880,6 +880,67 @@ interface AiravataIf { */ public function getExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId); /** + * * + * * Get Experiment by an admin user + * * + * * Used by an admin user to fetch previously created experiment metadata. + * * + * * @param airavataExperimentId + * * The unique identifier of the requested experiment. This ID is returned during the create experiment step. + * * + * * @return ExperimentModel + * * This method will return the previously stored experiment metadata. + * * + * * @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 $airavataExperimentId + * @return \Airavata\Model\Experiment\ExperimentModel A structure holding the experiment metadata and its child models. + * + * userName: + * The user name of the targeted gateway end user on whose behalf the experiment is being created. + * the associated gateway identity can only be inferred from the security hand-shake so as to avoid + * authorized Airavata Clients mimicking an unauthorized request. If a gateway is not registered with + * Airavata, an authorization exception is thrown. + * + * experimentName: + * The name of the experiment as defined by the user. The name need not be unique as uniqueness is enforced + * by the generated experiment id. + * + * experimentDescription: + * The verbose description of the experiment. This is an optional parameter. + * + * @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 + */ + public function getExperimentByAdmin(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId); + /** * * Get Complete Experiment Details * Fetch the completed nested tree structue of previously created experiment metadata which includes processes -> @@ -6375,6 +6436,73 @@ class AiravataClient implements \Airavata\API\AiravataIf { throw new \Exception("getExperiment failed: unknown result"); } + public function getExperimentByAdmin(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId) + { + $this->send_getExperimentByAdmin($authzToken, $airavataExperimentId); + return $this->recv_getExperimentByAdmin(); + } + + public function send_getExperimentByAdmin(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId) + { + $args = new \Airavata\API\Airavata_getExperimentByAdmin_args(); + $args->authzToken = $authzToken; + $args->airavataExperimentId = $airavataExperimentId; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'getExperimentByAdmin', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('getExperimentByAdmin', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_getExperimentByAdmin() + { + $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_getExperimentByAdmin_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_getExperimentByAdmin_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; + } + throw new \Exception("getExperimentByAdmin failed: unknown result"); + } + public function getDetailedExperimentTree(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId) { $this->send_getDetailedExperimentTree($authzToken, $airavataExperimentId); @@ -26253,6 +26381,314 @@ class Airavata_getExperiment_result { } +class Airavata_getExperimentByAdmin_args { + static $_TSPEC; + + /** + * @var \Airavata\Model\Security\AuthzToken + */ + public $authzToken = null; + /** + * @var string + */ + public $airavataExperimentId = 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' => 'airavataExperimentId', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['authzToken'])) { + $this->authzToken = $vals['authzToken']; + } + if (isset($vals['airavataExperimentId'])) { + $this->airavataExperimentId = $vals['airavataExperimentId']; + } + } + } + + public function getName() { + return 'Airavata_getExperimentByAdmin_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->airavataExperimentId); + } 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_getExperimentByAdmin_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->airavataExperimentId !== null) { + $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 2); + $xfer += $output->writeString($this->airavataExperimentId); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class Airavata_getExperimentByAdmin_result { + static $_TSPEC; + + /** + * @var \Airavata\Model\Experiment\ExperimentModel + */ + 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; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\Airavata\Model\Experiment\ExperimentModel', + ), + 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', + ), + ); + } + 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']; + } + } + } + + public function getName() { + return 'Airavata_getExperimentByAdmin_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::STRUCT) { + $this->success = new \Airavata\Model\Experiment\ExperimentModel(); + $xfer += $this->success->read($input); + } 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; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Airavata_getExperimentByAdmin_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->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(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class Airavata_getDetailedExperimentTree_args { static $_TSPEC; http://git-wip-us.apache.org/repos/asf/airavata/blob/0fda5a8f/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 c5532e2..02319e3 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 @@ -68,6 +68,7 @@ /airavata/createExperiment| /airavata/deleteExperiment| /airavata/getExperiment| +/airavata/getExperimentByAdmin| /airavata/getDetailedExperimentTree| /airavata/updateExperiment| /airavata/updateExperimentConfiguration| http://git-wip-us.apache.org/repos/asf/airavata/blob/0fda5a8f/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 c37bb7d..f64aeb4 100644 --- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift +++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift @@ -818,6 +818,49 @@ service Airavata { /** * + * Get Experiment by an admin user + * + * Used by an admin user to fetch previously created experiment metadata. + * + * @param airavataExperimentId + * The unique identifier of the requested experiment. This ID is returned during the create experiment step. + * + * @return ExperimentModel + * This method will return the previously stored experiment metadata. + * + * @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. + * + **/ + experiment_model.ExperimentModel getExperimentByAdmin(1: required security_model.AuthzToken authzToken, + 2: required string airavataExperimentId) + 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) + /** + * * Get Complete Experiment Details * Fetch the completed nested tree structue of previously created experiment metadata which includes processes -> * tasks -> jobs information.
