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 8EE2611669 for ; Tue, 8 Jul 2014 16:33:33 +0000 (UTC) Received: (qmail 60719 invoked by uid 500); 8 Jul 2014 16:33:33 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 60678 invoked by uid 500); 8 Jul 2014 16:33:33 -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 60669 invoked by uid 99); 8 Jul 2014 16:33:33 -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, 08 Jul 2014 16:33:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 212489467F3; Tue, 8 Jul 2014 16:33:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smarru@apache.org To: commits@airavata.apache.org Message-Id: <9e53d790b8ed49658176bac1aba63ef0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Updating PHP Samples - AIRAVATA-1274 Date: Tue, 8 Jul 2014 16:33:33 +0000 (UTC) Repository: airavata Updated Branches: refs/heads/master cf945f01a -> d1d3fae86 Updating PHP Samples - AIRAVATA-1274 Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/d1d3fae8 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/d1d3fae8 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/d1d3fae8 Branch: refs/heads/master Commit: d1d3fae860faf508db8a01c6e54118384082aaa9 Parents: cf945f0 Author: Suresh Marru Authored: Tue Jul 8 12:33:26 2014 -0400 Committer: Suresh Marru Committed: Tue Jul 8 12:33:26 2014 -0400 ---------------------------------------------------------------------- .../conf/airavata-client-properties.ini | 18 +++++ .../airavata-client-properties.ini | 18 ----- .../resources/php-cli-samples/createProject.php | 42 +++-------- .../resources/php-cli-samples/getAPIVersion.php | 37 ++-------- .../php-cli-samples/getAiravataClient.php | 10 ++- .../getAllApplicationInterfaceNames.php | 50 +++++++++++++ .../resources/php-cli-samples/getAppModule.php | 44 +++--------- .../php-cli-samples/getApplicationInputs.php | 60 ++++++++++++++++ .../php-cli-samples/getApplicationOutputs.php | 60 ++++++++++++++++ ...getAvailableAppInterfaceComputeResources.php | 60 ++++++++++++++++ .../php-cli-samples/getExperimentOutputs.php | 35 --------- .../php-cli-samples/registerAppDeployment.php | 74 ++++++++++++++++++++ .../php-cli-samples/registerAppInterface.php | 66 +++++++++++++++++ .../php-cli-samples/registerAppModule.php | 49 +++---------- .../php-cli-samples/registerComputeResource.php | 68 ++++++++++++++++++ 15 files changed, 497 insertions(+), 194 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/airavata-client-properties.ini ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/airavata-client-properties.ini b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/airavata-client-properties.ini new file mode 100644 index 0000000..ddf6f32 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/conf/airavata-client-properties.ini @@ -0,0 +1,18 @@ +; 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 = "../lib/Thrift/" + +; library of thrift generated Airavata API PHP Stubs +AIRAVATA_PHP_STUBS_DIR = "../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 http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/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 deleted file mode 100644 index ddf6f32..0000000 --- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/airavata-client-properties.ini +++ /dev/null @@ -1,18 +0,0 @@ -; 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 = "../lib/Thrift/" - -; library of thrift generated Airavata API PHP Stubs -AIRAVATA_PHP_STUBS_DIR = "../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 http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/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 index daa6da5..88e11e6 100755 --- 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 @@ -1,42 +1,18 @@ getAllApplicationInterfaceNames(); + + if ($appInterfaceNameIdList) + { + var_dump($appInterfaceNameIdList); + } + else + { + echo "\n Failed to fetch application interface names. \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/d1d3fae8/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 index 746de5d..e28dbac 100644 --- 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 @@ -1,43 +1,19 @@ getApplicationDeployment($appModuleId); + return $airavataclient->getApplicationModule($appModuleId); } catch (InvalidRequestException $ire) { http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationInputs.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationInputs.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationInputs.php new file mode 100755 index 0000000..b490d7b --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationInputs.php @@ -0,0 +1,60 @@ +'; + } + else { + + $appInterfaceId = $argv[1]; + + $appInputs = $airavataclient->getApplicationInputs($appInterfaceId); + + if ($appInputs) { + var_dump($appInputs); + } else { + echo "\n Failed to fetch application interface Inputs. \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 (TTransportException $tte) +{ + echo 'TTransportException!

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

' . $e->getMessage(); +} + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationOutputs.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationOutputs.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationOutputs.php new file mode 100755 index 0000000..b8b569f --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getApplicationOutputs.php @@ -0,0 +1,60 @@ +'; + } + else { + + $appInterfaceId = $argv[1]; + + $appOutputs = $airavataclient->getApplicationOutputs($appInterfaceId); + + if ($appOutputs) { + var_dump($appOutputs); + } else { + echo "\n Failed to fetch application interface Outputs. \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 (TTransportException $tte) +{ + echo 'TTransportException!

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

' . $e->getMessage(); +} + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAvailableAppInterfaceComputeResources.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAvailableAppInterfaceComputeResources.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAvailableAppInterfaceComputeResources.php new file mode 100755 index 0000000..aa604fa --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/getAvailableAppInterfaceComputeResources.php @@ -0,0 +1,60 @@ +'; + } + else { + + $appInterfaceId = $argv[1]; + + $appInterfaceComputeResources = $airavataclient->getAvailableAppInterfaceComputeResources($appInterfaceId); + + if ($appInterfaceComputeResources) { + var_dump($appInterfaceComputeResources); + } else { + echo "\n Failed to fetch application interface compute resources. \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 (TTransportException $tte) +{ + echo 'TTransportException!

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

' . $e->getMessage(); +} + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/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 index 3e9f557..b822092 100644 --- 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 @@ -1,46 +1,15 @@ \n"); @@ -58,10 +27,6 @@ foreach ($outputs as $output) var_dump($outputs); - - - - $transport->close(); http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppDeployment.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppDeployment.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppDeployment.php new file mode 100755 index 0000000..4872faf --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppDeployment.php @@ -0,0 +1,74 @@ + '; + } + else + { + $appModuleId = $argv[1]; + $computeHostId = $argv[2]; + $executablePath = $argv[3]; + + $appDeployment = new ApplicationDeploymentDescription(); + $appDeployment->appModuleId = $appModuleId; + $appDeployment->computeHostId = $computeHostId; + $appDeployment->executablePath = $executablePath; + + + + $appDeploymentId = $airavataclient->registerApplicationDeployment($appDeployment); + + if ($appDeploymentId) + { + var_dump($appDeployment); + echo "Application Deployment $appDeploymentId is registered! \n "; + } + else + { + echo "Failed to register application deployment. \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 (TTransportException $tte) +{ + echo 'TTransportException!

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

' . $e->getMessage(); +} + +$transport->close(); + +?> + http://git-wip-us.apache.org/repos/asf/airavata/blob/d1d3fae8/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppInterface.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppInterface.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppInterface.php new file mode 100755 index 0000000..6f74b53 --- /dev/null +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/php-cli-samples/registerAppInterface.php @@ -0,0 +1,66 @@ + '; + } + else + { + $appName = $argv[1]; + $appDescription = $argv[2]; + $appModuleId = $argv[3]; + + $appInterface = new ApplicationInterfaceDescription(); + $appInterface->applicationName = $appName; + $appInterface->applicationDesription = $appDescription; + + $appInterfaceId = $airavataclient->registerApplicationInterface($appInterface); + + if ($appInterfaceId) + { + var_dump($appInterface); + echo "\n Application Interface $appInterfaceId is registered! \n "; + } + else + { + echo "\n Failed to register application interface. \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/d1d3fae8/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 index b3ed27a..b6007ab 100755 --- 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 @@ -1,49 +1,18 @@ '; + } + else + { + $hostName = $argv[1]; + $resourceDescription = $argv[2]; + + $computeResource = new ComputeResourceDescription(); + $computeResource->hostName = $hostName; + $computeResource->resourceDescription = $resourceDescription; + + + + + $computeResourceId = $airavataclient->registerComputeResource($computeResource); + + if ($computeResourceId) + { + var_dump($computeResource); + echo "\n Compute Resource $computeResourceId is registered! \n "; + } + else + { + echo "\n Failed to register compute resource description. \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(); + +?> +