Repository: airavata Updated Branches: refs/heads/master 7ef880044 -> 56efa8e5e
http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp index 121db80..5a6df09 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp @@ -3049,6 +3049,251 @@ uint32_t Airavata_getProject_presult::read(::apache::thrift::protocol::TProtocol return xfer; } +uint32_t Airavata_deleteProject_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_projectId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->projectId); + isset_projectId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_projectId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Airavata_deleteProject_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Airavata_deleteProject_args"); + + xfer += oprot->writeFieldBegin("projectId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->projectId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Airavata_deleteProject_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Airavata_deleteProject_pargs"); + + xfer += oprot->writeFieldBegin("projectId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->projectId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Airavata_deleteProject_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ace.read(iprot); + this->__isset.ace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ase.read(iprot); + this->__isset.ase = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->pnfe.read(iprot); + this->__isset.pnfe = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Airavata_deleteProject_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Airavata_deleteProject_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ace) { + xfer += oprot->writeFieldBegin("ace", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ace.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ase) { + xfer += oprot->writeFieldBegin("ase", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->ase.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.pnfe) { + xfer += oprot->writeFieldBegin("pnfe", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->pnfe.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Airavata_deleteProject_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ace.read(iprot); + this->__isset.ace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ase.read(iprot); + this->__isset.ase = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->pnfe.read(iprot); + this->__isset.pnfe = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + uint32_t Airavata_getAllUserProjects_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; @@ -29080,6 +29325,76 @@ void AiravataClient::recv_getProject( ::apache::airavata::model::workspace::Proj throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getProject failed: unknown result"); } +bool AiravataClient::deleteProject(const std::string& projectId) +{ + send_deleteProject(projectId); + return recv_deleteProject(); +} + +void AiravataClient::send_deleteProject(const std::string& projectId) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("deleteProject", ::apache::thrift::protocol::T_CALL, cseqid); + + Airavata_deleteProject_pargs args; + args.projectId = &projectId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool AiravataClient::recv_deleteProject() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("deleteProject") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + Airavata_deleteProject_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ace) { + throw result.ace; + } + if (result.__isset.ase) { + throw result.ase; + } + if (result.__isset.pnfe) { + throw result.pnfe; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "deleteProject failed: unknown result"); +} + void AiravataClient::getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName) { send_getAllUserProjects(gatewayId, userName); @@ -36812,6 +37127,72 @@ void AiravataProcessor::process_getProject(int32_t seqid, ::apache::thrift::prot } } +void AiravataProcessor::process_deleteProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Airavata.deleteProject", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Airavata.deleteProject"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Airavata.deleteProject"); + } + + Airavata_deleteProject_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Airavata.deleteProject", bytes); + } + + Airavata_deleteProject_result result; + try { + result.success = iface_->deleteProject(args.projectId); + result.__isset.success = true; + } catch ( ::apache::airavata::api::error::InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch ( ::apache::airavata::api::error::AiravataClientException &ace) { + result.ace = ace; + result.__isset.ace = true; + } catch ( ::apache::airavata::api::error::AiravataSystemException &ase) { + result.ase = ase; + result.__isset.ase = true; + } catch ( ::apache::airavata::api::error::ProjectNotFoundException &pnfe) { + result.pnfe = pnfe; + result.__isset.pnfe = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Airavata.deleteProject"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("deleteProject", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Airavata.deleteProject"); + } + + oprot->writeMessageBegin("deleteProject", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Airavata.deleteProject", bytes); + } +} + void AiravataProcessor::process_getAllUserProjects(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { void* ctx = NULL; http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h index 4604bf8..78a7e9c 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h @@ -45,6 +45,7 @@ class AiravataIf { virtual void createProject(std::string& _return, const std::string& gatewayId, const ::apache::airavata::model::workspace::Project& project) = 0; virtual void updateProject(const std::string& projectId, const ::apache::airavata::model::workspace::Project& updatedProject) = 0; virtual void getProject( ::apache::airavata::model::workspace::Project& _return, const std::string& projectId) = 0; + virtual bool deleteProject(const std::string& projectId) = 0; virtual void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName) = 0; virtual void searchProjectsByProjectName(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName, const std::string& projectName) = 0; virtual void searchProjectsByProjectDesc(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName, const std::string& description) = 0; @@ -217,6 +218,10 @@ class AiravataNull : virtual public AiravataIf { void getProject( ::apache::airavata::model::workspace::Project& /* _return */, const std::string& /* projectId */) { return; } + bool deleteProject(const std::string& /* projectId */) { + bool _return = false; + return _return; + } void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & /* _return */, const std::string& /* gatewayId */, const std::string& /* userName */) { return; } @@ -2290,6 +2295,148 @@ class Airavata_getProject_presult { }; +class Airavata_deleteProject_args { + public: + + Airavata_deleteProject_args() : projectId() { + } + + virtual ~Airavata_deleteProject_args() throw() {} + + std::string projectId; + + void __set_projectId(const std::string& val) { + projectId = val; + } + + bool operator == (const Airavata_deleteProject_args & rhs) const + { + if (!(projectId == rhs.projectId)) + return false; + return true; + } + bool operator != (const Airavata_deleteProject_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Airavata_deleteProject_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Airavata_deleteProject_pargs { + public: + + + virtual ~Airavata_deleteProject_pargs() throw() {} + + const std::string* projectId; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Airavata_deleteProject_result__isset { + _Airavata_deleteProject_result__isset() : success(false), ire(false), ace(false), ase(false), pnfe(false) {} + bool success; + bool ire; + bool ace; + bool ase; + bool pnfe; +} _Airavata_deleteProject_result__isset; + +class Airavata_deleteProject_result { + public: + + Airavata_deleteProject_result() : success(0) { + } + + virtual ~Airavata_deleteProject_result() throw() {} + + bool success; + ::apache::airavata::api::error::InvalidRequestException ire; + ::apache::airavata::api::error::AiravataClientException ace; + ::apache::airavata::api::error::AiravataSystemException ase; + ::apache::airavata::api::error::ProjectNotFoundException pnfe; + + _Airavata_deleteProject_result__isset __isset; + + void __set_success(const bool val) { + success = val; + } + + void __set_ire(const ::apache::airavata::api::error::InvalidRequestException& val) { + ire = val; + } + + void __set_ace(const ::apache::airavata::api::error::AiravataClientException& val) { + ace = val; + } + + void __set_ase(const ::apache::airavata::api::error::AiravataSystemException& val) { + ase = val; + } + + void __set_pnfe(const ::apache::airavata::api::error::ProjectNotFoundException& val) { + pnfe = val; + } + + bool operator == (const Airavata_deleteProject_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ace == rhs.ace)) + return false; + if (!(ase == rhs.ase)) + return false; + if (!(pnfe == rhs.pnfe)) + return false; + return true; + } + bool operator != (const Airavata_deleteProject_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Airavata_deleteProject_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Airavata_deleteProject_presult__isset { + _Airavata_deleteProject_presult__isset() : success(false), ire(false), ace(false), ase(false), pnfe(false) {} + bool success; + bool ire; + bool ace; + bool ase; + bool pnfe; +} _Airavata_deleteProject_presult__isset; + +class Airavata_deleteProject_presult { + public: + + + virtual ~Airavata_deleteProject_presult() throw() {} + + bool* success; + ::apache::airavata::api::error::InvalidRequestException ire; + ::apache::airavata::api::error::AiravataClientException ace; + ::apache::airavata::api::error::AiravataSystemException ase; + ::apache::airavata::api::error::ProjectNotFoundException pnfe; + + _Airavata_deleteProject_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + class Airavata_getAllUserProjects_args { public: @@ -16351,6 +16498,9 @@ class AiravataClient : virtual public AiravataIf { void getProject( ::apache::airavata::model::workspace::Project& _return, const std::string& projectId); void send_getProject(const std::string& projectId); void recv_getProject( ::apache::airavata::model::workspace::Project& _return); + bool deleteProject(const std::string& projectId); + void send_deleteProject(const std::string& projectId); + bool recv_deleteProject(); void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName); void send_getAllUserProjects(const std::string& gatewayId, const std::string& userName); void recv_getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return); @@ -16685,6 +16835,7 @@ class AiravataProcessor : public ::apache::thrift::TDispatchProcessor { void process_createProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_updateProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_getProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_deleteProject(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_getAllUserProjects(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_searchProjectsByProjectName(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_searchProjectsByProjectDesc(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); @@ -16803,6 +16954,7 @@ class AiravataProcessor : public ::apache::thrift::TDispatchProcessor { processMap_["createProject"] = &AiravataProcessor::process_createProject; processMap_["updateProject"] = &AiravataProcessor::process_updateProject; processMap_["getProject"] = &AiravataProcessor::process_getProject; + processMap_["deleteProject"] = &AiravataProcessor::process_deleteProject; processMap_["getAllUserProjects"] = &AiravataProcessor::process_getAllUserProjects; processMap_["searchProjectsByProjectName"] = &AiravataProcessor::process_searchProjectsByProjectName; processMap_["searchProjectsByProjectDesc"] = &AiravataProcessor::process_searchProjectsByProjectDesc; @@ -17059,6 +17211,15 @@ class AiravataMultiface : virtual public AiravataIf { return; } + bool deleteProject(const std::string& projectId) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->deleteProject(projectId); + } + return ifaces_[i]->deleteProject(projectId); + } + void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName) { size_t sz = ifaces_.size(); size_t i = 0; http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp index 482119d..96b9e0f 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp @@ -104,6 +104,11 @@ class AiravataHandler : virtual public AiravataIf { printf("getProject\n"); } + bool deleteProject(const std::string& projectId) { + // Your implementation goes here + printf("deleteProject\n"); + } + void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& gatewayId, const std::string& userName) { // Your implementation goes here printf("getAllUserProjects\n"); http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php index 85bf7e6..0865706 100644 --- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php @@ -30,6 +30,7 @@ interface AiravataIf { public function createProject($gatewayId, \Airavata\Model\Workspace\Project $project); public function updateProject($projectId, \Airavata\Model\Workspace\Project $updatedProject); public function getProject($projectId); + public function deleteProject($projectId); public function getAllUserProjects($gatewayId, $userName); public function searchProjectsByProjectName($gatewayId, $userName, $projectName); public function searchProjectsByProjectDesc($gatewayId, $userName, $description); @@ -927,6 +928,69 @@ class AiravataClient implements \Airavata\API\AiravataIf { throw new \Exception("getProject failed: unknown result"); } + public function deleteProject($projectId) + { + $this->send_deleteProject($projectId); + return $this->recv_deleteProject(); + } + + public function send_deleteProject($projectId) + { + $args = new \Airavata\API\Airavata_deleteProject_args(); + $args->projectId = $projectId; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'deleteProject', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('deleteProject', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_deleteProject() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_deleteProject_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \Airavata\API\Airavata_deleteProject_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ire !== null) { + throw $result->ire; + } + if ($result->ace !== null) { + throw $result->ace; + } + if ($result->ase !== null) { + throw $result->ase; + } + if ($result->pnfe !== null) { + throw $result->pnfe; + } + throw new \Exception("deleteProject failed: unknown result"); + } + public function getAllUserProjects($gatewayId, $userName) { $this->send_getAllUserProjects($gatewayId, $userName); @@ -9983,6 +10047,238 @@ class Airavata_getProject_result { } +class Airavata_deleteProject_args { + static $_TSPEC; + + public $projectId = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'projectId', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['projectId'])) { + $this->projectId = $vals['projectId']; + } + } + } + + public function getName() { + return 'Airavata_deleteProject_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->projectId); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Airavata_deleteProject_args'); + if ($this->projectId !== null) { + $xfer += $output->writeFieldBegin('projectId', TType::STRING, 1); + $xfer += $output->writeString($this->projectId); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class Airavata_deleteProject_result { + static $_TSPEC; + + public $success = null; + public $ire = null; + public $ace = null; + public $ase = null; + public $pnfe = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'ire', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\InvalidRequestException', + ), + 2 => array( + 'var' => 'ace', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\AiravataClientException', + ), + 3 => array( + 'var' => 'ase', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\AiravataSystemException', + ), + 4 => array( + 'var' => 'pnfe', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\ProjectNotFoundException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ire'])) { + $this->ire = $vals['ire']; + } + if (isset($vals['ace'])) { + $this->ace = $vals['ace']; + } + if (isset($vals['ase'])) { + $this->ase = $vals['ase']; + } + if (isset($vals['pnfe'])) { + $this->pnfe = $vals['pnfe']; + } + } + } + + public function getName() { + return 'Airavata_deleteProject_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ire = new \Airavata\API\Error\InvalidRequestException(); + $xfer += $this->ire->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->ace = new \Airavata\API\Error\AiravataClientException(); + $xfer += $this->ace->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->ase = new \Airavata\API\Error\AiravataSystemException(); + $xfer += $this->ase->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRUCT) { + $this->pnfe = new \Airavata\API\Error\ProjectNotFoundException(); + $xfer += $this->pnfe->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Airavata_deleteProject_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->ire !== null) { + $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); + $xfer += $this->ire->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ace !== null) { + $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 2); + $xfer += $this->ace->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ase !== null) { + $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 3); + $xfer += $this->ase->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->pnfe !== null) { + $xfer += $output->writeFieldBegin('pnfe', TType::STRUCT, 4); + $xfer += $this->pnfe->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class Airavata_getAllUserProjects_args { static $_TSPEC; http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java index 3d58197..6110f53 100644 --- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java +++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java @@ -61,7 +61,7 @@ public class CreateLaunchExperiment { private static String echoAppId = "Echo_8506337e-ab7a-46b6-9b71-4a461b6c5e35"; private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9"; private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762"; - private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc"; + private static String amberAppId = "Amber_aa083c86-4680-4002-b3ef-fad93c181926"; private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b"; private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1"; private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f"; @@ -85,15 +85,36 @@ public class CreateLaunchExperiment { public static void main(String[] args) throws Exception { airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT); System.out.println("API version is " + airavataClient.getAPIVersion()); + getAvailableAppInterfaceComputeResources("Echo_4fb76cb3-6bf6-409e-aa17-7cc7ee6e41af"); // createGateway(); // getGateway("testGatewayId"); -// registerApplications(); // run this only the first time - createAndLaunchExp(); +// registerApplications(); // run this only the first time +// createAndLaunchExp(); } private static String fsdResourceId; + public static void getAvailableAppInterfaceComputeResources(String appInterfaceId) { + try { + Map<String, String> availableAppInterfaceComputeResources = airavataClient.getAvailableAppInterfaceComputeResources(appInterfaceId); + for (String key : availableAppInterfaceComputeResources.keySet()){ + System.out.println("id : " + key); + System.out.println("name : " + availableAppInterfaceComputeResources.get(key)); + } + } catch (AiravataSystemException e) { + e.printStackTrace(); + } catch (InvalidRequestException e) { + e.printStackTrace(); + } catch (AiravataClientException e) { + e.printStackTrace(); + } catch (TException e) { + e.printStackTrace(); + } + + } + + public static void createGateway(){ try { Gateway gateway = new Gateway(); @@ -154,14 +175,14 @@ public class CreateLaunchExperiment { // final String expId = createExperimentForBR2Amber(airavataClient); // final String expId = createExperimentWRFStampede(airavataClient); // final String expId = createExperimentForStampedeAmber(airavataClient); -// final String expId = createExperimentForTrestlesAmber(airavataClient); + final String expId = createExperimentForTrestlesAmber(airavataClient); // final String expId = createExperimentGROMACSStampede(airavataClient); // final String expId = createExperimentESPRESSOStampede(airavataClient); // final String expId = createExperimentLAMMPSStampede(airavataClient); // final String expId = createExperimentNWCHEMStampede(airavataClient); // final String expId = createExperimentTRINITYStampede(airavataClient); // final String expId = createExperimentAUTODOCKStampede(airavataClient); // this is not working , we need to register AutoDock app on stampede - final String expId = createExperimentForLSF(airavataClient); +// final String expId = createExperimentForLSF(airavataClient); // final String expId = "Ultrascan_ln_eb029947-391a-4ccf-8ace-9bafebe07cc0"; System.out.println("Experiment ID : " + expId); // updateExperiment(airavata, expId); http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java new file mode 100644 index 0000000..762d031 --- /dev/null +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/AuthenticationMode.java @@ -0,0 +1,70 @@ +/** + * 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. + */ + +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.airavata.model.appcatalog.computeresource; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +/** + * AuthenticationMode + * + * SERVER_ISSUED: use CA credentials to generate a certificate based on user name. + * server properties. + * MYPROXY_ISSUED: rely on GSI method implementation already provided + * by Airavata security libs. + */ +@SuppressWarnings("all") public enum AuthenticationMode implements org.apache.thrift.TEnum { + SERVER_ISSUED(0), + MYPROXY_ISSUED(1); + + private final int value; + + private AuthenticationMode(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static AuthenticationMode findByValue(int value) { + switch (value) { + case 0: + return SERVER_ISSUED; + case 1: + return MYPROXY_ISSUED; + default: + return null; + } + } +} http://git-wip-us.apache.org/repos/asf/airavata/blob/56efa8e5/airavata-api/thrift-interface-descriptions/airavataAPI.thrift ---------------------------------------------------------------------- diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift index 95a91e6..b12c3b8 100644 --- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift +++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift @@ -176,6 +176,12 @@ service Airavata { 3: airavataErrors.AiravataSystemException ase, 4: airavataErrors.ProjectNotFoundException pnfe) + bool deleteProject (1: required string projectId) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase, + 4: airavataErrors.ProjectNotFoundException pnfe) + /** * Get all Project by user *
