http://git-wip-us.apache.org/repos/asf/airavata/blob/9800cd39/client-samples/search_experiments_by_description.php ---------------------------------------------------------------------- diff --git a/client-samples/search_experiments_by_description.php b/client-samples/search_experiments_by_description.php deleted file mode 100644 index 8243c0b..0000000 --- a/client-samples/search_experiments_by_description.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -namespace Airavata\Client\Samples; - -$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.php'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TBufferedTransport.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'] . 'Exception/TTransportException.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'] = '../lib/Airavata/'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Airavata.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Experiment/Types.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php'; - -require_once '../lib/AiravataClientFactory.php'; - -use Airavata\API\Error\AiravataClientException; -use Airavata\API\Error\AiravataSystemException; -use Airavata\API\Error\InvalidRequestException; -use Airavata\Client\AiravataClientFactory; -use Thrift\Protocol\TBinaryProtocol; -use Thrift\Transport\TBufferedTransport; -use Thrift\Transport\TSocket; -use Airavata\API\AiravataClient; - -$airavataconfig = parse_ini_file("airavata-client-properties.ini"); - -$transport = new TSocket($airavataconfig['AIRAVATA_SERVER'], $airavataconfig['AIRAVATA_PORT']); -$transport->setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); - -$protocol = new TBinaryProtocol($transport); -$transport->open(); -$airavataclient = new AiravataClient($protocol); - - -try -{ - - if ($argc != 3) { - echo 'php search_experiments_by_description.php <username> <project_ID>'; - } - - else { - $experiments = $airavataclient->searchExperimentsByDesc($argv[1], $argv[2]); - echo '# results = ' . sizeof($experiments) . ' <br><br>'; - var_dump($experiments); - } - - -} -catch (InvalidRequestException $ire) -{ - print 'InvalidRequestException: ' . $ire->getMessage()."\n"; -} -catch (AiravataClientException $ace) -{ - print 'Airavata System Exception: ' . $ace->getMessage()."\n"; -} -catch (AiravataSystemException $ase) -{ - print 'Airavata System Exception: ' . $ase->getMessage()."\n"; -} - - - - - -$transport->close(); - -?> -
http://git-wip-us.apache.org/repos/asf/airavata/blob/9800cd39/client-samples/search_experiments_by_name.php ---------------------------------------------------------------------- diff --git a/client-samples/search_experiments_by_name.php b/client-samples/search_experiments_by_name.php deleted file mode 100644 index 4a51a15..0000000 --- a/client-samples/search_experiments_by_name.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -namespace Airavata\Client\Samples; - -$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.php'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TBufferedTransport.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'] . 'Exception/TTransportException.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'] = '../lib/Airavata/'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Airavata.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Experiment/Types.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php'; - -require_once '../lib/AiravataClientFactory.php'; - -use Airavata\API\Error\AiravataClientException; -use Airavata\API\Error\AiravataSystemException; -use Airavata\API\Error\InvalidRequestException; -use Airavata\Client\AiravataClientFactory; -use Thrift\Protocol\TBinaryProtocol; -use Thrift\Transport\TBufferedTransport; -use Thrift\Transport\TSocket; -use Airavata\API\AiravataClient; - -$airavataconfig = parse_ini_file("airavata-client-properties.ini"); - -$transport = new TSocket($airavataconfig['AIRAVATA_SERVER'], $airavataconfig['AIRAVATA_PORT']); -$transport->setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); - -$protocol = new TBinaryProtocol($transport); -$transport->open(); -$airavataclient = new AiravataClient($protocol); - - -try -{ - - if ($argc != 3) { - echo 'php search_experiments_by_name.php <username> <project_ID>'; - } - - else { - $experiments = $airavataclient->searchExperimentsByName($argv[1], $argv[2]); - echo '# results = ' . sizeof($experiments) . ' <br><br>'; - var_dump($experiments); - } - - -} -catch (InvalidRequestException $ire) -{ - print 'InvalidRequestException: ' . $ire->getMessage()."\n"; -} -catch (AiravataClientException $ace) -{ - print 'Airavata System Exception: ' . $ace->getMessage()."\n"; -} -catch (AiravataSystemException $ase) -{ - print 'Airavata System Exception: ' . $ase->getMessage()."\n"; -} - - - - - -$transport->close(); - -?> - http://git-wip-us.apache.org/repos/asf/airavata/blob/9800cd39/client-samples/terminateExperiment.php ---------------------------------------------------------------------- diff --git a/client-samples/terminateExperiment.php b/client-samples/terminateExperiment.php deleted file mode 100644 index 6eadb4c..0000000 --- a/client-samples/terminateExperiment.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php -namespace Airavata\Client\Samples; - -$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.php'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TBufferedTransport.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'] . 'Exception/TTransportException.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'] = '../lib/Airavata/'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Airavata.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Experiment/Types.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php'; - -require_once '../lib/AiravataClientFactory.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; - -$airavataconfig = parse_ini_file("airavata-client-properties.ini"); - -$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) -{ - echo 'php terminateExperiment.php <experiment_id>'; -} -else -{ - terminate_experiment($argv[1]); - - echo 'If there are no exceptions, assume the experiment terminated successfully'; -} - - -$transport->close(); - - -/** - * End the experiment with the given ID - * @param $expId - */ -function terminate_experiment($expId) -{ - global $airavataclient; - - try - { - $airavataclient->terminateExperiment($expId); - } - catch (InvalidRequestException $ire) - { - echo 'InvalidRequestException!\n\n' . $ire->getMessage(); - } - catch (ExperimentNotFoundException $enf) - { - echo 'ExperimentNotFoundException!\n\n' . $enf->getMessage(); - } - catch (AiravataClientException $ace) - { - echo 'AiravataClientException!\n\n' . $ace->getMessage(); - } - catch (AiravataSystemException $ase) - { - echo 'AiravataSystemException!\n\n' . $ase->getMessage(); - } - catch (TTransportException $tte) - { - echo 'TTransportException!\n\n' . $tte->getMessage(); - } - catch (\Exception $e) - { - echo 'Exception!\n\n' . $e->getMessage(); - } -} - -?> - http://git-wip-us.apache.org/repos/asf/airavata/blob/9800cd39/client-samples/updateExperiment.php ---------------------------------------------------------------------- diff --git a/client-samples/updateExperiment.php b/client-samples/updateExperiment.php deleted file mode 100644 index a15e3a4..0000000 --- a/client-samples/updateExperiment.php +++ /dev/null @@ -1,158 +0,0 @@ -<?php -namespace Airavata\Client\Samples; - -$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.php'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TBufferedTransport.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'] . 'Exception/TTransportException.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'] = '../lib/Airavata/'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Airavata.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Experiment/Types.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php'; - -require_once '../lib/AiravataClientFactory.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; - -$airavataconfig = parse_ini_file("airavata-client-properties.ini"); - -$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) -{ - echo 'php updateExperiment.php <experiment_id>'; -} -else -{ - update_experiment($argv[1]); -} - - - - - - - - - - -$transport->close(); - - -/** - * Get the experiment with the given ID - * @param $expId - * @return null - */ -function get_experiment($expId) -{ - global $airavataclient; - - try - { - return $airavataclient->getExperiment($expId); - } - 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 during get!<br><br>' . $ase->getMessage(); - } - catch (TTransportException $tte) - { - echo 'TTransportException!<br><br>' . $tte->getMessage(); - } - catch (\Exception $e) - { - echo 'Exception!<br><br>' . $e->getMessage(); - } - -} - -/** - * Update the experiment with the given ID - * @param $expId - * @return null - */ -function update_experiment($expId) -{ - global $airavataclient; - - try - { - //create new experiment to receive the clone - $experiment = $airavataclient->getExperiment($expId); - $experiment->name .= time(); - - $airavataclient->updateExperiment($expId, $experiment); - - $updatedExperiment = $airavataclient->getExperiment($expId); - - echo "Experiment $experiment->name updated:\n\n"; - var_dump($updatedExperiment); - } - 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 during update!<br><br>' . $ase->getMessage(); - } - catch (TTransportException $tte) - { - echo 'TTransportException!<br><br>' . $tte->getMessage(); - } -} - -?> - http://git-wip-us.apache.org/repos/asf/airavata/blob/9800cd39/client-samples/updateProject.php ---------------------------------------------------------------------- diff --git a/client-samples/updateProject.php b/client-samples/updateProject.php deleted file mode 100644 index 75935e1..0000000 --- a/client-samples/updateProject.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php -namespace Airavata\Client\Samples; - -$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.php'; -require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TBufferedTransport.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'] . 'Exception/TTransportException.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'] = '../lib/Airavata/'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Airavata.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Types.php'; -require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php'; - -require_once '../lib/AiravataClientFactory.php'; - -use Airavata\API\Error\AiravataClientException; -use Airavata\API\Error\AiravataSystemException; -use Airavata\API\Error\InvalidRequestException; -use Airavata\Client\AiravataClientFactory; -use Thrift\Protocol\TBinaryProtocol; -use Thrift\Transport\TBufferedTransport; -use Thrift\Transport\TSocket; -use Airavata\API\AiravataClient; - -$airavataconfig = parse_ini_file("airavata-client-properties.ini"); - -$transport = new TSocket($airavataconfig['AIRAVATA_SERVER'], $airavataconfig['AIRAVATA_PORT']); -$transport->setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); - -$protocol = new TBinaryProtocol($transport); -$transport->open(); -$airavataclient = new AiravataClient($protocol); - - -try -{ - if($argc != 3) - { - echo 'php updateProject.php <project_id> <project_description>'; - } - else - { - $project=$airavataclient->getProject($argv[1]); - $project->description = $argv[2]; - $airavataclient->updateProject($argv[1], $project); - echo 'Project '.$argv[1] . ' succesfully modified.'; - } -} - -catch (InvalidRequestException $ire) -{ - print 'InvalidRequestException: ' . $ire->getMessage()."\n"; -} -catch (AiravataClientException $ace) -{ - print 'Airavata System Exception: ' . $ace->getMessage()."\n"; -} -catch (AiravataSystemException $ase) -{ - print 'Airavata System Exception: ' . $ase->getMessage()."\n"; -} - -$transport->close(); - -?> -
