Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30DDB10952 for ; Tue, 1 Jul 2014 10:29:04 +0000 (UTC) Received: (qmail 54497 invoked by uid 500); 1 Jul 2014 10:29:04 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 54435 invoked by uid 500); 1 Jul 2014 10:29:04 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 54350 invoked by uid 99); 1 Jul 2014 10:29:03 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2014 10:29:03 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A18AB990D16; Tue, 1 Jul 2014 10:29:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: smarru@apache.org To: commits@airavata.apache.org Date: Tue, 01 Jul 2014 10:29:05 -0000 Message-Id: <93cca34d92c94399b0e5498fe2a62298@git.apache.org> In-Reply-To: <6427275af3ee4cc1908f78a89e7b0828@git.apache.org> References: <6427275af3ee4cc1908f78a89e7b0828@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] git commit: Moving samples into SDK directory for packaging - AIRAVATA-1274 Moving samples into SDK directory for packaging - AIRAVATA-1274 Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/4d338df2 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/4d338df2 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/4d338df2 Branch: refs/heads/master Commit: 4d338df243292ca5b526285a9362cf63512695f8 Parents: 01f648a Author: Suresh Marru Authored: Tue Jul 1 06:28:56 2014 -0400 Committer: Suresh Marru Committed: Tue Jul 1 06:28:56 2014 -0400 ---------------------------------------------------------------------- .../src/main/resources/php-cli-samples/README | 20 ++ .../php-cli-samples/add-compute-resources.php | 78 +++++++ .../airavata-client-api-tester.php | 230 +++++++++++++++++++ .../airavata-client-properties.ini | 24 ++ .../php-cli-samples/cloneExperiment.php | 153 ++++++++++++ .../php-cli-samples/createExperiment.php | 157 +++++++++++++ .../resources/php-cli-samples/createProject.php | 89 +++++++ .../resources/php-cli-samples/getAPIVersion.php | 58 +++++ .../getAllExperimentsInProject.php | 79 +++++++ .../php-cli-samples/getAllUserExperiments.php | 86 +++++++ .../php-cli-samples/getAllUserProjects.php | 79 +++++++ .../resources/php-cli-samples/getAppModule.php | 95 ++++++++ .../resources/php-cli-samples/getExperiment.php | 106 +++++++++ .../php-cli-samples/getExperimentOutputs.php | 113 +++++++++ .../php-cli-samples/getExperimentStatus.php | 97 ++++++++ .../php-cli-samples/launchExperiment.php | 82 +++++++ .../list-application-interfaces.php | 76 ++++++ .../php-cli-samples/list-compute-resources.php | 101 ++++++++ .../php-cli-samples/registerAppModule.php | 102 ++++++++ .../search_experiments_by_application.php | 79 +++++++ .../search_experiments_by_description.php | 79 +++++++ .../search_experiments_by_name.php | 79 +++++++ .../php-cli-samples/terminateExperiment.php | 101 ++++++++ .../php-cli-samples/updateExperiment.php | 155 +++++++++++++ .../resources/php-cli-samples/updateProject.php | 75 ++++++ .../resources/samples/GetAiravataVersion.php | 18 -- .../resources/samples/add-compute-resources.php | 75 ------ .../samples/airavata-client-sample.php | 93 -------- .../samples/list-application-interfaces.php | 73 ------ .../samples/list-compute-resources.php | 97 -------- samples/php-cli-samples/GetAPIVersion.php | 58 ----- samples/php-cli-samples/README | 20 -- .../php-cli-samples/add-compute-resources.php | 78 ------- .../airavata-client-api-tester.php | 230 ------------------- .../airavata-client-properties.ini | 24 -- samples/php-cli-samples/cloneExperiment.php | 153 ------------ samples/php-cli-samples/createExperiment.php | 157 ------------- samples/php-cli-samples/createProject.php | 89 ------- .../getAllExperimentsInProject.php | 79 ------- .../php-cli-samples/getAllUserExperiments.php | 86 ------- samples/php-cli-samples/getAllUserProjects.php | 79 ------- samples/php-cli-samples/getAppModule.php | 95 -------- samples/php-cli-samples/getExperiment.php | 106 --------- .../php-cli-samples/getExperimentOutputs.php | 113 --------- samples/php-cli-samples/getExperimentStatus.php | 97 -------- samples/php-cli-samples/launchExperiment.php | 82 ------- .../list-application-interfaces.php | 76 ------ .../php-cli-samples/list-compute-resources.php | 101 -------- samples/php-cli-samples/registerAppModule.php | 102 -------- .../search_experiments_by_application.php | 79 ------- .../search_experiments_by_description.php | 79 ------- .../search_experiments_by_name.php | 79 ------- samples/php-cli-samples/terminateExperiment.php | 101 -------- samples/php-cli-samples/updateExperiment.php | 155 ------------- samples/php-cli-samples/updateProject.php | 75 ------ 55 files changed, 2393 insertions(+), 2749 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/README ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/README b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/README new file mode 100644 index 0000000..8684750 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/README @@ -0,0 +1,20 @@ +This directory contains files that can be used to test the Apache Airavata client API using PHP command-line tools. You will need PHP installed on your test environment. To run a command from a terminal shell prompt, use, for example, + [prompt%> php createProject.php your-name + +You can modify PHP files using any text editor. + +Run the commands in the following order for your first test. +1. GetAPIVersion.php (a sanity check) +2. createProject.php +3. updateProject.php +4. getAllUserProjects.php +5. createExperiment.php +6. getExperiment.php +7. updateExperiment.php +8. cloneExperiment.php +9. getAllExperimentsInProject.php +10. getAllUserExperiments.php +11. launchExperiment.php +12. getExperimentStatus.php +13. getExperimentOutputs.php +14. terminateExperiment.php http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/add-compute-resources.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/add-compute-resources.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/add-compute-resources.php new file mode 100644 index 0000000..0413903 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/add-compute-resources.php @@ -0,0 +1,78 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); + +$airavataclient = new ApplicationCatalogAPIClient($protocol); +$transport->open(); + +echo "Airavata Server Version is: " . $airavataclient->getAPIVersion() . "\n"; + +echo "Add Compute Resources.... "."\n"; + +$id_list = $airavataclient->listComputeResourceDescriptions(); +$compute_resource = new ComputeResourceDescription(); +$compute_resource->hostName="test-stampede-host"."-".time(); +$compute_resource->hostAliases=array("stampede"); +$compute_resource->ipAddresses=array("stampede.tacc.xsede.org"); +$compute_resource->isEmpty=false; +$compute_resource->scratchLocation="/home1/01437/ogce"; +$compute_resource->jobSubmissionProtocols=array(); +$compute_resource->dataMovementProtocols=array(); + +echo "Adding ".$compute_resource->hostName."..."; +$compute_resource_id=$airavataclient->addComputeResourceDescription($compute_resource); +echo "done [saved in the catalog as ".$compute_resource_id."]\n"; + +$gsissh_protoco_data=new GSISSHJobSubmission(); +$gsissh_protoco_data->resourceJobManager=ResourceJobManager::SLURM; +$gsissh_protoco_data->installedPath="/usr/bin/"; +$gsissh_protoco_data->sshPort=2222; +$gsissh_protoco_data->monitorMode="push"; + +echo "Adding GSISSH protocol data to ".$compute_resource_id."..."; +$airavataclient->addGSISSHJobSubmissionProtocol($compute_resource_id, $gsissh_protoco_data); +echo "done\n"; +$transport->close(); +?> http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-api-tester.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-api-tester.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-api-tester.php new file mode 100755 index 0000000..17d4b80 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-api-tester.php @@ -0,0 +1,230 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); +*/ +$transport = new TSocket('gw127.iu.xsede.org', 8930); +$transport->setRecvTimeout(20000); +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + +try +{ + if ($argc != 2) + { + echo 'php airavata-client-api-tester.php '; + } + else + { + + /* ComputationalResourceScheduling data for Trestles*/ + $cmRST = new ComputationalResourceScheduling(); + $cmRST->resourceHostId = "trestles.sdsc.edu"; + $cmRST->ComputationalProjectAccount = "sds128"; + $cmRST->totalCPUCount = 1; + $cmRST->nodeCount = 1; + $cmRST->numberOfThreads = 0; + $cmRST->queueName = "normal"; + $cmRST->wallTimeLimit = 15; + $cmRST->jobStartTime = 0; + $cmRST->totalPhysicalMemory = 0; + + /* ComputationalResourceScheduling data for Stampede */ + $cmRSS = new ComputationalResourceScheduling(); + $cmRSS->resourceHostId = "stampede.tacc.xsede.org"; + $cmRSS->ComputationalProjectAccount = "TG-STA110014S"; + $cmRSS->totalCPUCount = 1; + $cmRSS->nodeCount = 1; + $cmRSS->numberOfThreads = 0; + $cmRSS->queueName = "normal"; + $cmRSS->wallTimeLimit = 15; + $cmRSS->jobStartTime = 0; + $cmRSS->totalPhysicalMemory = 0; + + /* UserConfigurationData using either Trestles or Stampede*/ + //$cmRS = $cmRSS; + $cmRS = $cmRST; + $userConfigurationData = new UserConfigurationData(); + $userConfigurationData->airavataAutoSchedule = 0; + $userConfigurationData->overrideManualScheduledParams = 0; + $userConfigurationData->computationalResourceScheduling = $cmRS; + //var_dump($cmRS); + //var_dump($userConfigurationData); + + /*Application ID for Trestles or Stamepede */ + $appId_trestles = "SimpleEcho2"; + $appId_stampede = "SimpleEcho3"; + //$appId = $appId_stampede; + $appId = $appId_trestles; + + /* Experiment input and output data. */ + $input = new DataObjectType(); + $input->key = "echo_input"; + $input->value = "echo_output=Hello World"; + $input->type = DataType::STRING; + $exInputs = array($input); + + $output = new DataObjectType(); + $output->key = "echo_output"; + $output->value = ""; + $output->type = DataType::STRING; + $exOutputs = array($output); + + + /* Simple workflow test. */ + $user = $argv[1]; + + /* Create Project */ + $project = new Project(); + $project->owner = $user; + $project->name = "LoadTesterProject"; + $projId = $airavataclient->createProject($project); + echo "$user created project $projId. \n"; + + /* Create Experiment */ + $experiment = new Experiment(); + $experiment->projectID = $projId; + $experiment->userName = $user; + $experiment->name = "LoadTesterExperiment_".time(); + $experiment->applicationId = $appId; + $experiment->userConfigurationData = $userConfigurationData; + $experiment->experimentInputs = $exInputs; + $experiment->experimentOutputs = $exOutputs; + $expId = $airavataclient->createExperiment($experiment); + echo "$user created experiment $expId. \n"; + //var_dump($experiment); + + /* Get whole project */ + $uproj = $airavataclient->getProject($projId); + echo "$user $projId detail follows: \n"; + var_dump($uproj); + + /* Update Project */ + $uproj->description = "Updated project description: ".time(); + $airavataclient->updateProject($projId, $uproj); + echo "$user updated project $projId. \n"; + + /* Get whole experiment */ + $uexp = $airavataclient->getExperiment($expId); + echo "$user experiment $expId detail follows: \n"; + var_dump($uexp); + + /* Update Experiment */ + $uexp->description = "Updated experiment description: ".time(); + $airavataclient->updateExperiment($expId, $uexp); + echo "$user updated experiment $expId. \n"; + + /* Clone Experiment */ + $clone_expId = $airavataclient->cloneExperiment($expId, "CloneLoadTesterExperiment_".time()); + echo "$user cloned experiment $expId as $clone_expId. \n"; + + /* Update Experiment Configuration */ + $update_userConfigurationData = new UserConfigurationData(); + $update_userConfigurationData->airavataAutoSchedule = 0; + $update_userConfigurationData->overrideManualScheduledParams = 0; + $update_userConfigurationData->computationalResourceScheduling = $cmRSS; + $airavataclient->updateExperimentConfiguration($expId, $update_userConfigurationData); + echo "$user updated user configuration data for experiment $expId. \n"; + + /* Update Resource Scheduleing */ + //$airavataclient->updateResourceScheduleing($expId, $cmRST); + //echo "$user updated resource scheduleing for experiment $expId. \n"; + + /* Validate experiment */ + //$valid = $airavataclient->validateExperiment($expId); + //echo "$user experiment $expId validation is $valid. \n"; + + /* Launch Experiment */ + //$airavataclient->launchExperiment($expId, 'airavataToken'); + //echo "$user experiment $expId is launched."; + + /* Get experiment status */ + $experimentStatus = $airavataclient->getExperimentStatus($expId); + $experimentStatusString = ExperimentState::$__names[$experimentStatus->experimentState]; + echo "$user experiment $expId status is $experimentStatusString. \n"; + + /* Get additional information */ + //$version = $airavataclient->GetAPIVersion(); + //echo "$user Airavata Server Version is $version. \n"; + + $userProjects = $airavataclient->getAllUserProjects($user); + echo "$user total number of projects is " . sizeof($userProjects) . ". \n"; + + $userExperiments = $airavataclient->getAllUserExperiments($user); + echo "$user total number of experiments is " . sizeof($userExperiments) . ". \n"; + + //echo $projId; + $projectExperiments = $airavataclient->getAllExperimentsInProject($projId); + echo "$user number of experiments in $projId is " . sizeof($projectExperiments) . ". \n"; + } + +} +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"; +} +catch (ExperimentNotFoundException $enf) +{ + print 'Experiment Not Found Exception: ' . $enf->getMessage()."\n"; +} + + + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-properties.ini ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-properties.ini b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-properties.ini new file mode 100644 index 0000000..4e24eaa --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-properties.ini @@ -0,0 +1,24 @@ +; The is the configuration file with properties needed by Airavata Clients. +; Key properties specify location of Airavata Services, Ports and Such. + +; library path to Thrift Libraries +THRIFT_LIB_DIR = "../../airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Thrift/" + +; library of thrift generated Airavata API PHP Stubs +AIRAVATA_PHP_STUBS_DIR = "../../airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/" + +; Host which runs the Airavata Server +; AIRAVATA_SERVER = "gw111.iu.xsede.org" +AIRAVATA_SERVER = "localhost" + +; Airavata Server thrift port +AIRAVATA_PORT = 8930 + +; Time out value to give enough breathing room for client to get synchronous responses back +AIRAVATA_TIMEOUT = 5000 + +; Host which runs the Application Catalog Server +APP_CATALOG_SERVER = "gw111.iu.xsede.org" + +; Application Catalog Server thrift port +APP_CATALOG_PORT = 8931 http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/cloneExperiment.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/cloneExperiment.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/cloneExperiment.php new file mode 100644 index 0000000..35cd70c --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/cloneExperiment.php @@ -0,0 +1,153 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + +//$expId = 'experiment2_8f9c0ccc-6392-47b3-bcde-f4e82557bc32'; + + +if ($argc != 2) +{ + echo 'php cloneExperiment.php '; +} +else +{ + $cloneId = clone_experiment($argv[1]); + + $clone = get_experiment($cloneId); + + var_dump($clone); + + echo "Created clone with ID $clone->experimentID named $clone->name \n\n"; +} + + + + +//var_dump($experiment); + + +$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!

' . $ire->getMessage(); + } + catch (ExperimentNotFoundException $enf) + { + echo 'ExperimentNotFoundException!

' . $enf->getMessage(); + } + catch (AiravataClientException $ace) + { + echo 'AiravataClientException!

' . $ace->getMessage(); + } + catch (AiravataSystemException $ase) + { + echo 'AiravataSystemException during get!

' . $ase->getMessage(); + } + catch (TTransportException $tte) + { + echo 'TTransportException!

' . $tte->getMessage(); + } + catch (\Exception $e) + { + echo 'Exception!

' . $e->getMessage(); + } + +} + +/** + * Clone the experiment with the given ID + * @param $expId + * @return null + */ +function clone_experiment($expId) +{ + global $airavataclient; + + try + { + $experiment = $airavataclient->getExperiment($expId); + + return $airavataclient->cloneExperiment($expId, $experiment->name .= time()); + } + catch (InvalidRequestException $ire) + { + echo 'InvalidRequestException!

' . $ire->getMessage(); + } + catch (ExperimentNotFoundException $enf) + { + echo 'ExperimentNotFoundException!

' . $enf->getMessage(); + } + catch (AiravataClientException $ace) + { + echo 'AiravataClientException!

' . $ace->getMessage(); + } + catch (AiravataSystemException $ase) + { + echo 'AiravataSystemException during clone!

' . $ase->getMessage(); + } + catch (TTransportException $tte) + { + echo 'TTransportException!

' . $tte->getMessage(); + } +} + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php new file mode 100755 index 0000000..e37c463 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createExperiment.php @@ -0,0 +1,157 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + +try +{ + if ($argc != 4) + { + echo 'php createExperiment.php '; + } + else + { + /* ComputationalResourceScheduling data for Trestles*/ + $cmRST = new ComputationalResourceScheduling(); + $cmRST->resourceHostId = "trestles.sdsc.edu"; + $cmRST->ComputationalProjectAccount = "sds128"; + $cmRST->totalCPUCount = 1; + $cmRST->nodeCount = 1; + $cmRST->numberOfThreads = 0; + $cmRST->queueName = "normal"; + $cmRST->wallTimeLimit = 15; + $cmRST->jobStartTime = 0; + $cmRST->totalPhysicalMemory = 0; + + /* ComputationalResourceScheduling data for Stampede */ + $cmRSS = new ComputationalResourceScheduling(); + $cmRSS->resourceHostId = "stampede.tacc.xsede.org"; + $cmRSS->ComputationalProjectAccount = "TG-STA110014S"; + $cmRSS->totalCPUCount = 1; + $cmRSS->nodeCount = 1; + $cmRSS->numberOfThreads = 0; + $cmRSS->queueName = "normal"; + $cmRSS->wallTimeLimit = 15; + $cmRSS->jobStartTime = 0; + $cmRSS->totalPhysicalMemory = 0; + + /* UserConfigurationData using either Trestles or Stampede*/ + //$cmRS = $cmRSS; + $cmRS = $cmRST; + $userConfigurationData = new UserConfigurationData(); + $userConfigurationData->airavataAutoSchedule = 0; + $userConfigurationData->overrideManualScheduledParams = 0; + $userConfigurationData->computationalResourceScheduling = $cmRS; + //var_dump($cmRS); + //var_dump($userConfigurationData); + + /*Application ID for Trestles or Stamepede */ + $appId_trestles = "SimpleEcho2"; + $appId_stampede = "SimpleEcho3"; + //$appId = $appId_stampede; + $appId = $appId_trestles; + + /* Experiment input and output data. */ + $input = new DataObjectType(); + $input->key = "echo_input"; + $input->value = "echo_output=Hello World"; + $input->type = DataType::STRING; + $exInputs = array($input); + + $output = new DataObjectType(); + $output->key = "echo_output"; + $output->value = ""; + $output->type = DataType::STRING; + $exOutputs = array($output); + + /* Create Experiment: needs to update using unique project ID. */ + $user = $argv[1]; + $exp_name = $argv[2]; + $proj = $argv[3]; + + $experiment = new Experiment(); + $experiment->projectID = $proj; + $experiment->userName = $user; + $experiment->name = $exp_name; + $experiment->applicationId = $appId; + $experiment->userConfigurationData = $userConfigurationData; + $experiment->experimentInputs = $exInputs; + $experiment->experimentOutputs = $exOutputs; + + $expId = $airavataclient->createExperiment($experiment); + + if ($expId) + { + var_dump($experiment); + echo "Experiment $expId created! \n "; + } + else + { + echo "Failed to create experiment. \n"; + } + } + + +} +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/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createProject.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createProject.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createProject.php new file mode 100755 index 0000000..6e33199 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/createProject.php @@ -0,0 +1,89 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + +try +{ + if ($argc != 3) + { + echo 'php createProject.php '; + } + else + { + $project = new Project(); + $project->owner = $argv[1]; + $project->name = $argv[2]; + + $projId = $airavataclient->createProject($project); + + if ($projId) + { + print "$projId"; + } + else + { + echo 'Failed to create project.'; + } + } +} +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/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAPIVersion.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAPIVersion.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAPIVersion.php new file mode 100644 index 0000000..7a2e82e --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAPIVersion.php @@ -0,0 +1,58 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + +try +{ + $version = $airavataclient->getAPIVersion(); +} +catch (TException $texp) +{ + print 'Exception: ' . $texp->getMessage()."\n"; +} + + +echo 'Airavata server version is ' . $version; + + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllExperimentsInProject.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllExperimentsInProject.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllExperimentsInProject.php new file mode 100644 index 0000000..0de2d2c --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllExperimentsInProject.php @@ -0,0 +1,79 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + +try +{ + + if ($argc != 2) { + echo 'php getAllExperimentsInProject.php '; + } + + else { + $projectExperiments = $airavataclient->getAllExperimentsInProject($argv[1]); + echo '# of project experiments = ' . sizeof($projectExperiments) . '

'; + var_dump($projectExperiments); + } + + +} +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/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserExperiments.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserExperiments.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserExperiments.php new file mode 100644 index 0000000..f1877a0 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserExperiments.php @@ -0,0 +1,86 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + + + +try +{ + if ($argc != 2) + { + echo 'php getAllUserExperiments.php '; + } + else + { + $userExperiments = $airavataclient->getAllUserExperiments($argv[1]); + echo '# of user experiments = ' . sizeof($userExperiments) . ' '; + var_dump($userExperiments); + } + + + + + + + +} +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/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserProjects.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserProjects.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserProjects.php new file mode 100644 index 0000000..274f5d9 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAllUserProjects.php @@ -0,0 +1,79 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + + + +try +{ + if ($argc != 2) + { + echo 'php getAllUserProjects.php '; + } + else + { + $userProjects = $airavataclient->getAllUserProjects($argv[1]); + echo '# of user projects = ' . sizeof($userProjects) . ' '; + var_dump($userProjects); + } +} +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/4d338df2/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 new file mode 100644 index 0000000..1324b7d --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAppModule.php @@ -0,0 +1,95 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + +if (count($argv) < 2) { + exit("Please provide an appModuleID. \n"); +} + +$appModuleId = $argv[1]; + +$applicationModule = get_appModule($appModuleId); + +var_dump($applicationModule); + +$transport->close(); + +/** + * Get the appModule with the given ID + * @param $appModuleId + * @return null + */ +function get_appModule($appModuleId) +{ + global $airavataclient; + + try + { + return $airavataclient->getAppicationModule($appModuleId); + } + catch (InvalidRequestException $ire) + { + echo 'InvalidRequestException!

' . $ire->getMessage(); + } + catch (AiravataClientException $ace) + { + echo 'AiravataClientException!

' . $ace->getMessage(); + } + catch (AiravataSystemException $ase) + { + echo 'AiravataSystemException!

' . $ase->getMessage(); + } + catch (TTransportException $tte) + { + echo 'TTransportException!

' . $tte->getMessage(); + } + catch (\Exception $e) + { + echo 'Exception!

' . $e->getMessage(); + } + +} + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperiment.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperiment.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperiment.php new file mode 100644 index 0000000..2872a61 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperiment.php @@ -0,0 +1,106 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + +if (count($argv) < 2) { + exit("Please provide an experimentID. \n"); +} + +$expId = $argv[1]; + + +$experiment = get_experiment($expId); + +var_dump($experiment); + + + + + + +$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!

' . $ire->getMessage(); + } + catch (ExperimentNotFoundException $enf) + { + echo 'ExperimentNotFoundException!

' . $enf->getMessage(); + } + catch (AiravataClientException $ace) + { + echo 'AiravataClientException!

' . $ace->getMessage(); + } + catch (AiravataSystemException $ase) + { + echo 'AiravataSystemException!

' . $ase->getMessage(); + } + catch (TTransportException $tte) + { + echo 'TTransportException!

' . $tte->getMessage(); + } + catch (\Exception $e) + { + echo 'Exception!

' . $e->getMessage(); + } + +} + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentOutputs.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentOutputs.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentOutputs.php new file mode 100644 index 0000000..34b5d6e --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentOutputs.php @@ -0,0 +1,113 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + + +if ($argc != 2) +{ + exit("php getExperimentOutputs.php \n"); +} + +$expId = $argv[1]; + +$outputs = get_experiment_outputs($expId); + +foreach ($outputs as $output) +{ + echo "$output->type: $output->value

"; +} + +var_dump($outputs); + + + + + + +$transport->close(); + + +/** + * Get the experiment with the given ID + * @param $expId + * @return null + */ +function get_experiment_outputs($expId) +{ + global $airavataclient; + + try + { + return $airavataclient->getExperimentOutputs($expId); + } + catch (InvalidRequestException $ire) + { + echo 'InvalidRequestException!

' . $ire->getMessage(); + } + catch (ExperimentNotFoundException $enf) + { + echo 'ExperimentNotFoundException!

' . $enf->getMessage(); + } + catch (AiravataClientException $ace) + { + echo 'AiravataClientException!

' . $ace->getMessage(); + } + catch (AiravataSystemException $ase) + { + echo 'AiravataSystemException!

' . $ase->getMessage(); + } + catch (TTransportException $tte) + { + echo 'TTransportException!

' . $tte->getMessage(); + } + catch (\Exception $e) + { + echo 'Exception!

' . $e->getMessage(); + } + +} + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentStatus.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentStatus.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentStatus.php new file mode 100644 index 0000000..e931a4e --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getExperimentStatus.php @@ -0,0 +1,97 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + +if (count($argv) < 2) { + exit("Please provide an experimentID. \n"); +} + +$expId = $argv[1]; + +$experimentStatusString = get_experiment_status($expId); +echo "experiment status = " . $experimentStatusString . " \n
"; + + +$transport->close(); + + +/** + * Get a string containing the given experiment's status + * @param $expId + * @return mixed + */ +function get_experiment_status($expId) +{ + global $airavataclient; + + try + { + $experimentStatus = $airavataclient->getExperimentStatus($expId); + } + catch (InvalidRequestException $ire) + { + echo 'InvalidRequestException!

' . $ire->getMessage(); + } + catch (ExperimentNotFoundException $enf) + { + echo 'ExperimentNotFoundException!

' . $enf->getMessage(); + } + catch (AiravataClientException $ace) + { + echo 'AiravataClientException!

' . $ace->getMessage(); + } + catch (AiravataSystemException $ase) + { + echo 'AiravataSystemException!

' . $ase->getMessage(); + } + catch (\Exception $e) + { + echo 'Exception!

' . $e->getMessage(); + } + + return ExperimentState::$__names[$experimentStatus->experimentState]; +} + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/launchExperiment.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/launchExperiment.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/launchExperiment.php new file mode 100755 index 0000000..4f528b6 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/launchExperiment.php @@ -0,0 +1,82 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + +try +{ + if (count($argv) < 2) { + exit("Please provide an experimentID. \n"); + } + + $expId = $argv[1]; + $airavataclient->launchExperiment($expId, 'airavataToken'); + echo "Experiment $expId is launched."; +} +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"; +} +catch (ExperimentNotFoundException $enf) +{ + print 'Experiment Not Found Exception: ' . $enf->getMessage()."\n"; +} + + + + + + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-application-interfaces.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-application-interfaces.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-application-interfaces.php new file mode 100644 index 0000000..7d7c9ce --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-application-interfaces.php @@ -0,0 +1,76 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); + +$airavataclient = new ApplicationCatalogAPIClient($protocol); +$transport->open(); + +echo "Airavata Server Version is: " . $airavataclient->getAPIVersion() . "\n"; + +echo "Listing Application Interfaces.... "."\n"; + +$id_list = $airavataclient->listApplicationInterfaceIds(); + +foreach($id_list as $id){ + echo "Application Interface Id : ".$id."\n"; + $app_interface = $airavataclient->getApplicationInterface($id); + echo "\t"."Interface Data : " . $app_interface->applicationInterfaceData."\n"; + echo "\t".count($app_interface->applicationDeployments)." Deployments"."\n"; + foreach($app_interface->applicationDeployments as $deployment){ + echo "\t\t"."Compute Resource : ".$deployment->computeResourceDescription->hostName."\n"; + echo "\t\t\t"."Application Data".$deployment->applicationDescriptor->applicationDescriptorData."\n"; + } +} + +//$compute_resource = new \ComputeResourceDescription(); +//$compute_resource->hostName="localhost"; +//$compute_resource->hostAliases=array("localhost"); +//$compute_resource->ipAddresses=array("127.0.0.1"); + +//Create a Experiment +$transport->close(); + +?> + + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-compute-resources.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-compute-resources.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-compute-resources.php new file mode 100644 index 0000000..cc5c790 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/list-compute-resources.php @@ -0,0 +1,101 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); + +$airavataclient = new ApplicationCatalogAPIClient($protocol); +$transport->open(); + +echo "Airavata Server Version is: " . $airavataclient->getAPIVersion() . "\n"; + +echo "Listing Compute Resources.... "."\n"; + +$id_list = $airavataclient->listComputeResourceDescriptions(); + +foreach($id_list as $id){ + echo "Compute Resource Id : ".$id."\n"; + $compute_resource = $airavataclient->getComputeResourceDescription($id); + echo "\t"."Host name : " . $compute_resource->hostName ."\n"; + echo "\t"."Aliases : " . implode(",",array_keys($compute_resource->hostAliases)) ."\n"; + echo "\t"."Ip addresses : " . implode(",",array_keys($compute_resource->ipAddresses)) ."\n"; + echo "\t".count($compute_resource->jobSubmissionProtocols)." Job Submission Protocols Supported"."\n"; + foreach($compute_resource->jobSubmissionProtocols as $protocol_data_id => $protocol_type){ + echo "\t\t".$protocol_data_id."[".JobSubmissionProtocol::$__names[$protocol_type]. "]"."\n"; + switch ($protocol_type){ + case JobSubmissionProtocol::GRAM: + $globus_data=$airavataclient->getGlobusJobSubmissionProtocol($protocol_data_id); + echo "\t\t\tGate Keeper Endpoint(s) : ".implode(",",($globus_data->globusGateKeeperEndPoint))."\n"; + break; + case JobSubmissionProtocol::GSISSH: + $gsissh_data=$airavataclient->getGSISSHJobSubmissionProtocol($protocol_data_id); + echo "\t\t\tResource Job Manager : ".ResourceJobManager::$__names[$gsissh_data->resourceJobManager]."\n"; + echo "\t\t\tInstalled Path : ".$gsissh_data->installedPath."\n"; + echo "\t\t\tSSH port : ".$gsissh_data->sshPort."\n"; + echo "\t\t\tMonitor Mode : ".$gsissh_data->monitorMode."\n"; + break; + } + } + echo "\t".count($compute_resource->dataMovementProtocols)." Data Movement Protocols Supported"."\n"; + foreach($compute_resource->dataMovementProtocols as $protocol_data_id => $protocol_type){ + echo "\t\t".$protocol_data_id."[".DataMovementProtocol::$__names[$protocol_type] . "]"."\n"; + switch ($protocol_type){ + case DataMovementProtocol::GridFTP: + $gridftp_data=$airavataclient->getGridFTPDataMovementProtocol($protocol_data_id); + echo "\t\t\tGrid FTP Endpoint(s) : ".implode(",",($gridftp_data->gridFTPEndPoint))."\n"; + break; + } + } +} + +//$compute_resource = new \ComputeResourceDescription(); +//$compute_resource->hostName="localhost"; +//$compute_resource->hostAliases=array("localhost"); +//$compute_resource->ipAddresses=array("127.0.0.1"); + +//Create a Experiment +$transport->close(); + +?> + + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/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 new file mode 100755 index 0000000..7bec80e --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppModule.php @@ -0,0 +1,102 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + +try +{ + if ($argc != 4) + { + echo 'php registerAppModule.php '; + } + else + { + $appModuleName = $argv[1]; + $appModuleVersion = $argv[2]; + $appModuleDescription = $argv[3]; + + + $appModule = new ApplicationModule(); + $appModule->appModuleName = $appModuleName; + $appModule->appModuleVersion = $appModuleVersion; + $appModule->appModuleDescription = $appModuleDescription; + + $appModuleId = $airavataclient->registerAppicationModule($appModule); + + if ($appModuleId) + { + var_dump($appModule); + echo "Application Module $appModuleId is registered! \n "; + } + else + { + echo "Failed to register application module. \n"; + } + } +} +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"; +} +catch (\Exception $e) +{ + echo 'Exception!

' . $e->getMessage(); +} + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/4d338df2/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/search_experiments_by_application.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/search_experiments_by_application.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/search_experiments_by_application.php new file mode 100644 index 0000000..4340f9e --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/search_experiments_by_application.php @@ -0,0 +1,79 @@ +setRecvTimeout($airavataconfig['AIRAVATA_TIMEOUT']); + +$protocol = new TBinaryProtocol($transport); +$transport->open(); +$airavataclient = new AiravataClient($protocol); + + +try +{ + + if ($argc != 3) { + echo 'php search_experiments_by_application.php '; + } + + else { + $experiments = $airavataclient->searchExperimentsByApplication($argv[1], $argv[2]); + echo '# results = ' . sizeof($experiments) . '

'; + 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(); + +?> +