You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2014/07/01 05:01:50 UTC
[02/14] moving php command line samples and pointing to airavata sdk
- AIRAVATA-1274
http://git-wip-us.apache.org/repos/asf/airavata/blob/c09963aa/airavata-api/thrift-interface-descriptions/appCatalogAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/appCatalogAPI.thrift b/airavata-api/thrift-interface-descriptions/appCatalogAPI.thrift
new file mode 100644
index 0000000..e41ea10
--- /dev/null
+++ b/airavata-api/thrift-interface-descriptions/appCatalogAPI.thrift
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+/*
+ * Application Programming Interface definitions for Apache Airavata App Catalog.
+ *
+*/
+
+include "airavataErrors.thrift"
+include "airavataDataModel.thrift"
+include "appCatalogModels.thrift"
+
+namespace java org.apache.airavata.api.appcatalog
+namespace php Airavata.API.AppCatalog
+namespace cpp airavata.api.appcatalog
+namespace perl AiravataAPI.AppCatalog
+namespace py airavata.api.appcatalog
+namespace js AiravataAPI.AppCatalog
+
+service ApplicationCatalogAPI {
+
+/*
+ * Apache Airavata API Service Methods. For data structures associated in the signatures, please see included thrift files
+*/
+
+ /** Query Airavata to fetch the API version */
+ string GetAPIVersion(),
+
+ /**
+ * Manage Computer Resources
+ */
+ string addComputeResourceDescription(1: required computeHostModel.ComputeResourceDescription computeResourceDescription)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ string addSSHJobSubmissionProtocol(1: required string computeResourceId, 2: required computeHostModel.SSHJobSubmission jobSubmission)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ string addGSISSHJobSubmissionProtocol(1: required string computeResourceId, 2: required computeHostModel.GSISSHJobSubmission jobSubmission)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ string addGlobusJobSubmissionProtocol(1: required string computeResourceId, 2: required computeHostModel.GlobusJobSubmission jobSubmission)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ string addSCPDataMovementProtocol(1: required string computeResourceId, 2: required computeHostModel.SCPDataMovement dataMovement)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ string addGridFTPDataMovementProtocol(1: required string computeResourceId, 2: required computeHostModel.GridFTPDataMovement dataMovement)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ list<string> listComputeResourceDescriptions()
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ computeHostModel.ComputeResourceDescription getComputeResourceDescription(1: required string computeResourceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ computeHostModel.SSHJobSubmission getSSHJobSubmissionProtocol(1: required string sshJobSubmissionProtocolResourceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ computeHostModel.GSISSHJobSubmission getGSISSHJobSubmissionProtocol(1: required string gsisshJobSubmissionProtocolResourceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ computeHostModel.GlobusJobSubmission getGlobusJobSubmissionProtocol(1: required string globusJobSubmissionProtocolResourceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ computeHostModel.SCPDataMovement getSCPDataMovementProtocol(1: required string scpDataMovementResourceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ computeHostModel.GridFTPDataMovement getGridFTPDataMovementProtocol(1: required string gridFTPDataMovementResourceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ bool isComputeResourceDescriptionRegistered(1: required string hostName)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ computeHostModel.ComputeResourceDescription getComputeResourceDescriptionFromHostName(1: required string hostName)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ /**
+ * Manage Application Interfaces
+ */
+ string addApplicationInterface(1: required applicationInterfaceModel.ApplicationInterfaceDescription applicationInterface)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ list<string> listApplicationInterfaceIds()
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ applicationInterfaceModel.ApplicationInterfaceDescription getApplicationInterface(1: required string applicationInterfaceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ /**
+ * Manage application modules
+ */
+
+ string registerAppicationModule(1: required applicationDeploymentModel.ApplicationModule applicationModule,
+ 2:optional bool publish)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ applicationDeploymentModel.ApplicationModule getAppicationModule(1: required string appModuleId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ bool updateAppicationModule(1: required string appModuleId,
+ 2: required applicationDeploymentModel.ApplicationModule applicationModule)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ bool deleteAppicationModule(1: required string appModuleId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ /**
+ * Manage application modules
+ */
+
+ string addApplicationDeployment(1: required string applicationInterfaceId, 2: required applicationDeploymentModel.ApplicationDeploymentDescription applicationDeployment)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ list<string> listApplicationDeploymentIds(1: required string applicationInterfaceId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+
+ applicationDeploymentModel.ApplicationDeploymentDescription getApplicationDeployment(1: required string applicationInterfaceId, 2: required string applicationDeploymentId)
+ throws (1: airavataErrors.InvalidRequestException ire,
+ 2: airavataErrors.AiravataClientException ace,
+ 3: airavataErrors.AiravataSystemException ase)
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/c09963aa/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift b/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift
deleted file mode 100644
index c86ca60..0000000
--- a/airavata-api/thrift-interface-descriptions/applicationCatalogAPI.thrift
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * Application Programming Interface definition for Apache Airavata Services.
- * this parent thrift file is contains all service interfaces. The data models are
- * described in respective thrift files.
-*/
-
-include "airavataErrors.thrift"
-include "airavataDataModel.thrift"
-include "computeHostModel.thrift"
-include "applicationInterfaceModel.thrift"
-include "applicationDeploymentModel.thrift"
-
-namespace java org.apache.airavata.api.appcatalog
-namespace php Airavata.API.AppCatalog
-namespace cpp airavata.api.appcatalog
-namespace perl AiravataAPI.AppCatalog
-namespace py airavata.api.appcatalog
-namespace js AiravataAPI.AppCatalog
-
-/*
- * Airavata Interface Versions depend upon this Thrift Interface File. When Making changes, please edit the
- * Version Constants according to Semantic Versioning Specification (SemVer) http://semver.org.
- *
- * Note: The Airavata API version may be different from the Airavata software release versions.
- *
- * The Airavata API version is composed as a dot delimited string with major, minor, and patch level components.
- *
- * - Major: Incremented for backward incompatible changes. An example would be changes to interfaces.
- * - Minor: Incremented for backward compatible changes. An example would be the addition of a new optional methods.
- * - Patch: Incremented for bug fixes. The patch level should be increased for every edit that doesn't result
- * in a change to major/minor version numbers.
-*/
-const string AIRAVATA_API_VERSION = "0.12.0"
-
-service ApplicationCatalogAPI {
-
-/*
- * Apache Airavata API Service Methods. For data structures associated in the signatures, please see included thrift files
-*/
-
- /** Query Airavata to fetch the API version */
- string GetAPIVersion(),
-
- /**
- * Manage Computer Resources
- */
- string addComputeResourceDescription(1: required computeHostModel.ComputeResourceDescription computeResourceDescription)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- string addSSHJobSubmissionProtocol(1: required string computeResourceId, 2: required computeHostModel.SSHJobSubmission jobSubmission)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- string addGSISSHJobSubmissionProtocol(1: required string computeResourceId, 2: required computeHostModel.GSISSHJobSubmission jobSubmission)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- string addGlobusJobSubmissionProtocol(1: required string computeResourceId, 2: required computeHostModel.GlobusJobSubmission jobSubmission)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- string addSCPDataMovementProtocol(1: required string computeResourceId, 2: required computeHostModel.SCPDataMovement dataMovement)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- string addGridFTPDataMovementProtocol(1: required string computeResourceId, 2: required computeHostModel.GridFTPDataMovement dataMovement)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- list<string> listComputeResourceDescriptions()
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- computeHostModel.ComputeResourceDescription getComputeResourceDescription(1: required string computeResourceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- computeHostModel.SSHJobSubmission getSSHJobSubmissionProtocol(1: required string sshJobSubmissionProtocolResourceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- computeHostModel.GSISSHJobSubmission getGSISSHJobSubmissionProtocol(1: required string gsisshJobSubmissionProtocolResourceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- computeHostModel.GlobusJobSubmission getGlobusJobSubmissionProtocol(1: required string globusJobSubmissionProtocolResourceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- computeHostModel.SCPDataMovement getSCPDataMovementProtocol(1: required string scpDataMovementResourceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- computeHostModel.GridFTPDataMovement getGridFTPDataMovementProtocol(1: required string gridFTPDataMovementResourceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- bool isComputeResourceDescriptionRegistered(1: required string hostName)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- computeHostModel.ComputeResourceDescription getComputeResourceDescriptionFromHostName(1: required string hostName)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- /**
- * Manage Application Interfaces
- */
- string addApplicationInterface(1: required applicationInterfaceModel.ApplicationInterfaceDescription applicationInterface)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- list<string> listApplicationInterfaceIds()
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- applicationInterfaceModel.ApplicationInterfaceDescription getApplicationInterface(1: required string applicationInterfaceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- /**
- * Manage application modules
- */
-
- string registerAppicationModule(1: required applicationDeploymentModel.ApplicationModule applicationModule,
- 2:optional bool publish)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- applicationDeploymentModel.ApplicationModule getAppicationModule(1: required string appModuleId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- bool updateAppicationModule(1: required string appModuleId,
- 2: required applicationDeploymentModel.ApplicationModule applicationModule)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- bool deleteAppicationModule(1: required string appModuleId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- /**
- * Manage application modules
- */
-
- string addApplicationDeployment(1: required string applicationInterfaceId, 2: required applicationDeploymentModel.ApplicationDeploymentDescription applicationDeployment)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- list<string> listApplicationDeploymentIds(1: required string applicationInterfaceId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-
- applicationDeploymentModel.ApplicationDeploymentDescription getApplicationDeployment(1: required string applicationInterfaceId, 2: required string applicationDeploymentId)
- throws (1: airavataErrors.InvalidRequestException ire,
- 2: airavataErrors.AiravataClientException ace,
- 3: airavataErrors.AiravataSystemException ase)
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/c09963aa/samples/php-cli-samples/GetAPIVersion.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/GetAPIVersion.php b/samples/php-cli-samples/GetAPIVersion.php
new file mode 100644
index 0000000..7a2e82e
--- /dev/null
+++ b/samples/php-cli-samples/GetAPIVersion.php
@@ -0,0 +1,58 @@
+<?php
+namespace Airavata\Client\Samples;
+
+$airavataconfig = parse_ini_file("airavata-client-properties.ini");
+
+$GLOBALS['THRIFT_ROOT'] = $airavataconfig['THRIFT_LIB_DIR'];
+require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.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'] . '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'] = $airavataconfig['AIRAVATA_PHP_STUBS_DIR'];
+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';
+
+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;
+
+$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
+{
+ $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/c09963aa/samples/php-cli-samples/README
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/README b/samples/php-cli-samples/README
new file mode 100644
index 0000000..8684750
--- /dev/null
+++ b/samples/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/c09963aa/samples/php-cli-samples/add-compute-resources.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/add-compute-resources.php b/samples/php-cli-samples/add-compute-resources.php
new file mode 100644
index 0000000..0413903
--- /dev/null
+++ b/samples/php-cli-samples/add-compute-resources.php
@@ -0,0 +1,78 @@
+<?php
+namespace Airavata\Client\Samples;
+
+$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.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'] . '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'] . 'API/AppCatalog/ApplicationCatalogAPI.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Experiment/Types.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/AppCatalog/Types.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php';
+
+use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
+use Airavata\Model\Workspace\Experiment\DataObjectType;
+use Airavata\Model\Workspace\Experiment\UserConfigurationData;
+use Airavata\Model\AppCatalog\ComputeResourceDescription;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\TSocket;
+use Airavata\API\AiravataClient;
+use Airavata\API\AppCatalog\ApplicationCatalogAPIClient;
+use Airavata\Model\Workspace\Experiment\Experiment;
+use Airavata\Model\AppCatalog\JobSubmissionProtocol;
+use Airavata\Model\AppCatalog\DataMovementProtocol;
+use Airavata\Model\AppCatalog\GSISSHJobSubmission;
+use Airavata\Model\AppCatalog\ResourceJobManager;
+
+$airavataconfig = parse_ini_file("airavata-client-properties.ini");
+
+$transport = new TSocket($airavataconfig['APP_CATALOG_SERVER'], $airavataconfig['APP_CATALOG_PORT']);
+$transport->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/c09963aa/samples/php-cli-samples/airavata-client-api-tester.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/airavata-client-api-tester.php b/samples/php-cli-samples/airavata-client-api-tester.php
new file mode 100755
index 0000000..06c0429
--- /dev/null
+++ b/samples/php-cli-samples/airavata-client-api-tester.php
@@ -0,0 +1,233 @@
+<?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'] . '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\API\Error\ExperimentNotFoundException;
+use Airavata\Client\AiravataClientFactory;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\TBufferedTransport;
+use Thrift\Transport\TSocket;
+use Airavata\API\AiravataClient;
+
+use Airavata\Model\Workspace\Project;
+use Airavata\Model\Workspace\Experiment\Experiment;
+use Airavata\Model\Workspace\Experiment\DataObjectType;
+use Airavata\Model\Workspace\Experiment\UserConfigurationData;
+use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
+use Airavata\Model\Workspace\Experiment\DataType;
+use Airavata\Model\Workspace\Experiment\ExperimentState;
+
+$airavataconfig = parse_ini_file("airavata-client-properties.ini");
+
+/* this is the same as the factory */
+/* - Temporarity overriding to connect to test server.
+$transport = new TSocket($airavataconfig['AIRAVATA_SERVER'], $airavataconfig['AIRAVATA_PORT']);
+$transport->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 <username>';
+ }
+ 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/c09963aa/samples/php-cli-samples/airavata-client-properties.ini
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/airavata-client-properties.ini b/samples/php-cli-samples/airavata-client-properties.ini
new file mode 100644
index 0000000..87d2f41
--- /dev/null
+++ b/samples/php-cli-samples/airavata-client-properties.ini
@@ -0,0 +1,23 @@
+; 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 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/c09963aa/samples/php-cli-samples/cloneExperiment.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/cloneExperiment.php b/samples/php-cli-samples/cloneExperiment.php
new file mode 100644
index 0000000..42a39d7
--- /dev/null
+++ b/samples/php-cli-samples/cloneExperiment.php
@@ -0,0 +1,156 @@
+<?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);
+
+
+//$expId = 'experiment2_8f9c0ccc-6392-47b3-bcde-f4e82557bc32';
+
+
+if ($argc != 2)
+{
+ echo 'php cloneExperiment.php <experiment_id>';
+}
+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!<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();
+ }
+
+}
+
+/**
+ * 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!<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 clone!<br><br>' . $ase->getMessage();
+ }
+ catch (TTransportException $tte)
+ {
+ echo 'TTransportException!<br><br>' . $tte->getMessage();
+ }
+}
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/c09963aa/samples/php-cli-samples/createExperiment.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/createExperiment.php b/samples/php-cli-samples/createExperiment.php
new file mode 100755
index 0000000..3545a37
--- /dev/null
+++ b/samples/php-cli-samples/createExperiment.php
@@ -0,0 +1,162 @@
+<?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'] . '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;
+
+use Airavata\Model\Workspace\Project;
+use Airavata\Model\Workspace\Experiment\Experiment;
+use Airavata\Model\Workspace\Experiment\DataObjectType;
+use Airavata\Model\Workspace\Experiment\UserConfigurationData;
+use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
+use Airavata\Model\Workspace\Experiment\DataType;
+
+$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 != 4)
+ {
+ echo 'php createExperiment.php <username> <experiment_name> <project_ID>';
+ }
+ 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/c09963aa/samples/php-cli-samples/createProject.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/createProject.php b/samples/php-cli-samples/createProject.php
new file mode 100755
index 0000000..8a75b6f
--- /dev/null
+++ b/samples/php-cli-samples/createProject.php
@@ -0,0 +1,93 @@
+<?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'] . '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;
+use Airavata\Model\Workspace\Project;
+
+$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 createProject.php <owner> <project_name>';
+ }
+ 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/c09963aa/samples/php-cli-samples/getAllExperimentsInProject.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/getAllExperimentsInProject.php b/samples/php-cli-samples/getAllExperimentsInProject.php
new file mode 100644
index 0000000..6b42ecc
--- /dev/null
+++ b/samples/php-cli-samples/getAllExperimentsInProject.php
@@ -0,0 +1,82 @@
+<?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 != 2) {
+ echo 'php getAllExperimentsInProject.php <project_ID>';
+ }
+
+ else {
+ $projectExperiments = $airavataclient->getAllExperimentsInProject($argv[1]);
+ echo '# of project experiments = ' . sizeof($projectExperiments) . ' <br><br>';
+ 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/c09963aa/samples/php-cli-samples/getAllUserExperiments.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/getAllUserExperiments.php b/samples/php-cli-samples/getAllUserExperiments.php
new file mode 100644
index 0000000..81e3685
--- /dev/null
+++ b/samples/php-cli-samples/getAllUserExperiments.php
@@ -0,0 +1,89 @@
+<?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 != 2)
+ {
+ echo 'php getAllUserExperiments.php <username>';
+ }
+ 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/c09963aa/samples/php-cli-samples/getAllUserProjects.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/getAllUserProjects.php b/samples/php-cli-samples/getAllUserProjects.php
new file mode 100644
index 0000000..75d6dd4
--- /dev/null
+++ b/samples/php-cli-samples/getAllUserProjects.php
@@ -0,0 +1,83 @@
+<?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'] . '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 != 2)
+ {
+ echo 'php getAllUserProjects.php <user>';
+ }
+ 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/c09963aa/samples/php-cli-samples/getExperiment.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/getExperiment.php b/samples/php-cli-samples/getExperiment.php
new file mode 100644
index 0000000..48f84ea
--- /dev/null
+++ b/samples/php-cli-samples/getExperiment.php
@@ -0,0 +1,110 @@
+<?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 (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!<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!<br><br>' . $ase->getMessage();
+ }
+ catch (TTransportException $tte)
+ {
+ echo 'TTransportException!<br><br>' . $tte->getMessage();
+ }
+ catch (\Exception $e)
+ {
+ echo 'Exception!<br><br>' . $e->getMessage();
+ }
+
+}
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/c09963aa/samples/php-cli-samples/getExperimentOutputs.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/getExperimentOutputs.php b/samples/php-cli-samples/getExperimentOutputs.php
new file mode 100644
index 0000000..697c3a0
--- /dev/null
+++ b/samples/php-cli-samples/getExperimentOutputs.php
@@ -0,0 +1,116 @@
+<?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)
+{
+ exit("php getExperimentOutputs.php <experiment_id> \n");
+}
+
+$expId = $argv[1];
+
+$outputs = get_experiment_outputs($expId);
+
+foreach ($outputs as $output)
+{
+ echo "$output->type: $output->value <br><br>";
+}
+
+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!<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!<br><br>' . $ase->getMessage();
+ }
+ catch (TTransportException $tte)
+ {
+ echo 'TTransportException!<br><br>' . $tte->getMessage();
+ }
+ catch (\Exception $e)
+ {
+ echo 'Exception!<br><br>' . $e->getMessage();
+ }
+
+}
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/c09963aa/samples/php-cli-samples/getExperimentStatus.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/getExperimentStatus.php b/samples/php-cli-samples/getExperimentStatus.php
new file mode 100644
index 0000000..77b7feb
--- /dev/null
+++ b/samples/php-cli-samples/getExperimentStatus.php
@@ -0,0 +1,100 @@
+<?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\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 (count($argv) < 2) {
+ exit("Please provide an experimentID. \n");
+}
+
+$expId = $argv[1];
+
+$experimentStatusString = get_experiment_status($expId);
+echo "experiment status = " . $experimentStatusString . " \n<br>";
+
+
+$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!<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!<br><br>' . $ase->getMessage();
+ }
+ catch (\Exception $e)
+ {
+ echo 'Exception!<br><br>' . $e->getMessage();
+ }
+
+ return ExperimentState::$__names[$experimentStatus->experimentState];
+}
+
+?>
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/c09963aa/samples/php-cli-samples/launchExperiment.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/launchExperiment.php b/samples/php-cli-samples/launchExperiment.php
new file mode 100755
index 0000000..fecbf2f
--- /dev/null
+++ b/samples/php-cli-samples/launchExperiment.php
@@ -0,0 +1,86 @@
+<?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'] . '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 Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\TBufferedTransport;
+use Thrift\Transport\TSocket;
+use Airavata\API\AiravataClient;
+
+use Airavata\Model\Workspace\Project;
+use Airavata\Model\Workspace\Experiment\Experiment;
+
+$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 (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/c09963aa/samples/php-cli-samples/list-application-interfaces.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/list-application-interfaces.php b/samples/php-cli-samples/list-application-interfaces.php
new file mode 100644
index 0000000..7d7c9ce
--- /dev/null
+++ b/samples/php-cli-samples/list-application-interfaces.php
@@ -0,0 +1,76 @@
+<?php
+namespace Airavata\Client\Samples;
+
+$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.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'] . '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'] . 'API/AppCatalog/ApplicationCatalogAPI.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Experiment/Types.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/AppCatalog/Types.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php';
+
+use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
+use Airavata\Model\Workspace\Experiment\DataObjectType;
+use Airavata\Model\Workspace\Experiment\UserConfigurationData;
+use Airavata\Model\ComputeResourceDescription;
+use Airavata\Model\ApplicationInterface;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\TSocket;
+use Airavata\API\AiravataClient;
+use Airavata\API\AppCatalog\ApplicationCatalogAPIClient;
+use Airavata\Model\Workspace\Experiment\Experiment;
+use Airavata\Model\AppCatalog\JobSubmissionProtocol;
+use Airavata\Model\AppCatalog\DataMovementProtocol;
+
+$airavataconfig = parse_ini_file("airavata-client-properties.ini");
+
+$transport = new TSocket($airavataconfig['APP_CATALOG_SERVER'], $airavataconfig['APP_CATALOG_PORT']);
+$transport->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/c09963aa/samples/php-cli-samples/list-compute-resources.php
----------------------------------------------------------------------
diff --git a/samples/php-cli-samples/list-compute-resources.php b/samples/php-cli-samples/list-compute-resources.php
new file mode 100644
index 0000000..cc5c790
--- /dev/null
+++ b/samples/php-cli-samples/list-compute-resources.php
@@ -0,0 +1,101 @@
+<?php
+namespace Airavata\Client\Samples;
+
+$GLOBALS['THRIFT_ROOT'] = '../lib/Thrift/';
+require_once $GLOBALS['THRIFT_ROOT'] . 'Transport/TTransport.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'] . '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'] . 'API/AppCatalog/ApplicationCatalogAPI.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/Workspace/Experiment/Types.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'Model/AppCatalog/Types.php';
+require_once $GLOBALS['AIRAVATA_ROOT'] . 'API/Error/Types.php';
+
+use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
+use Airavata\Model\Workspace\Experiment\DataObjectType;
+use Airavata\Model\Workspace\Experiment\UserConfigurationData;
+use Airavata\Model\ComputeResourceDescription;
+use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Transport\TSocket;
+use Airavata\API\AiravataClient;
+use Airavata\API\AppCatalog\ApplicationCatalogAPIClient;
+use Airavata\Model\Workspace\Experiment\Experiment;
+use Airavata\Model\AppCatalog\JobSubmissionProtocol;
+use Airavata\Model\AppCatalog\DataMovementProtocol;
+use Airavata\Model\AppCatalog\ResourceJobManager;
+
+$airavataconfig = parse_ini_file("airavata-client-properties.ini");
+
+$transport = new TSocket($airavataconfig['APP_CATALOG_SERVER'], $airavataconfig['APP_CATALOG_PORT']);
+echo $airavataconfig['AIRAVATA_TIMEOUT']."\n";
+$transport->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();
+
+?>
+
+