You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/11/05 18:53:00 UTC
[airavata] branch develop updated: Regenerate Python Thrift client
stubs
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/develop by this push:
new ae7e230 Regenerate Python Thrift client stubs
ae7e230 is described below
commit ae7e230608ebd0e3250fa7c6296f620a7983f5dd
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Nov 5 13:51:45 2018 -0500
Regenerate Python Thrift client stubs
---
.../iam/admin/services/cpi/IamAdminServices-remote | 14 +
.../iam/admin/services/cpi/IamAdminServices.py | 467 +++++++++++++++++++++
2 files changed, 481 insertions(+)
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices-remote b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices-remote
index 683c411..c164ce1 100755
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices-remote
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices-remote
@@ -30,6 +30,8 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print(' bool registerUser(AuthzToken authzToken, string username, string emailAddress, string firstName, string lastName, string newPassword)')
print(' bool enableUser(AuthzToken authzToken, string username)')
print(' bool isUserEnabled(AuthzToken authzToken, string username)')
+ print(' bool isUserExist(AuthzToken authzToken, string username)')
+ print(' UserProfile getUser(AuthzToken authzToken, string username)')
print(' bool resetUserPassword(AuthzToken authzToken, string username, string newPassword)')
print(' findUsers(AuthzToken authzToken, string email, string userId)')
print(' void updateUserProfile(AuthzToken authzToken, UserProfile userDetails)')
@@ -151,6 +153,18 @@ elif cmd == 'isUserEnabled':
sys.exit(1)
pp.pprint(client.isUserEnabled(eval(args[0]), args[1],))
+elif cmd == 'isUserExist':
+ if len(args) != 2:
+ print('isUserExist requires 2 args')
+ sys.exit(1)
+ pp.pprint(client.isUserExist(eval(args[0]), args[1],))
+
+elif cmd == 'getUser':
+ if len(args) != 2:
+ print('getUser requires 2 args')
+ sys.exit(1)
+ pp.pprint(client.getUser(eval(args[0]), args[1],))
+
elif cmd == 'resetUserPassword':
if len(args) != 3:
print('resetUserPassword requires 3 args')
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices.py
index 58b46fe..dae59b5 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/service/profile/iam/admin/services/cpi/IamAdminServices.py
@@ -67,6 +67,22 @@ class Iface(object):
"""
pass
+ def isUserExist(self, authzToken, username):
+ """
+ Parameters:
+ - authzToken
+ - username
+ """
+ pass
+
+ def getUser(self, authzToken, username):
+ """
+ Parameters:
+ - authzToken
+ - username
+ """
+ pass
+
def resetUserPassword(self, authzToken, username, newPassword):
"""
Parameters:
@@ -355,6 +371,80 @@ class Client(Iface):
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "isUserEnabled failed: unknown result")
+ def isUserExist(self, authzToken, username):
+ """
+ Parameters:
+ - authzToken
+ - username
+ """
+ self.send_isUserExist(authzToken, username)
+ return self.recv_isUserExist()
+
+ def send_isUserExist(self, authzToken, username):
+ self._oprot.writeMessageBegin('isUserExist', TMessageType.CALL, self._seqid)
+ args = isUserExist_args()
+ args.authzToken = authzToken
+ args.username = username
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_isUserExist(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = isUserExist_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.Idse is not None:
+ raise result.Idse
+ if result.ae is not None:
+ raise result.ae
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "isUserExist failed: unknown result")
+
+ def getUser(self, authzToken, username):
+ """
+ Parameters:
+ - authzToken
+ - username
+ """
+ self.send_getUser(authzToken, username)
+ return self.recv_getUser()
+
+ def send_getUser(self, authzToken, username):
+ self._oprot.writeMessageBegin('getUser', TMessageType.CALL, self._seqid)
+ args = getUser_args()
+ args.authzToken = authzToken
+ args.username = username
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_getUser(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = getUser_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.Idse is not None:
+ raise result.Idse
+ if result.ae is not None:
+ raise result.ae
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getUser failed: unknown result")
+
def resetUserPassword(self, authzToken, username, newPassword):
"""
Parameters:
@@ -594,6 +684,8 @@ class Processor(Iface, TProcessor):
self._processMap["registerUser"] = Processor.process_registerUser
self._processMap["enableUser"] = Processor.process_enableUser
self._processMap["isUserEnabled"] = Processor.process_isUserEnabled
+ self._processMap["isUserExist"] = Processor.process_isUserExist
+ self._processMap["getUser"] = Processor.process_getUser
self._processMap["resetUserPassword"] = Processor.process_resetUserPassword
self._processMap["findUsers"] = Processor.process_findUsers
self._processMap["updateUserProfile"] = Processor.process_updateUserProfile
@@ -766,6 +858,56 @@ class Processor(Iface, TProcessor):
oprot.writeMessageEnd()
oprot.trans.flush()
+ def process_isUserExist(self, seqid, iprot, oprot):
+ args = isUserExist_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = isUserExist_result()
+ try:
+ result.success = self._handler.isUserExist(args.authzToken, args.username)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException as Idse:
+ msg_type = TMessageType.REPLY
+ result.Idse = Idse
+ except airavata.api.error.ttypes.AuthorizationException as ae:
+ msg_type = TMessageType.REPLY
+ result.ae = ae
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("isUserExist", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_getUser(self, seqid, iprot, oprot):
+ args = getUser_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = getUser_result()
+ try:
+ result.success = self._handler.getUser(args.authzToken, args.username)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException as Idse:
+ msg_type = TMessageType.REPLY
+ result.Idse = Idse
+ except airavata.api.error.ttypes.AuthorizationException as ae:
+ msg_type = TMessageType.REPLY
+ result.ae = ae
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("getUser", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
def process_resetUserPassword(self, seqid, iprot, oprot):
args = resetUserPassword_args()
args.read(iprot)
@@ -1935,6 +2077,331 @@ class isUserEnabled_result(object):
return not (self == other)
+class isUserExist_args(object):
+ """
+ Attributes:
+ - authzToken
+ - username
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'authzToken', (airavata.model.security.ttypes.AuthzToken, airavata.model.security.ttypes.AuthzToken.thrift_spec), None, ), # 1
+ (2, TType.STRING, 'username', 'UTF8', None, ), # 2
+ )
+
+ def __init__(self, authzToken=None, username=None,):
+ self.authzToken = authzToken
+ self.username = username
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.authzToken = airavata.model.security.ttypes.AuthzToken()
+ self.authzToken.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.username = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('isUserExist_args')
+ if self.authzToken is not None:
+ oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
+ self.authzToken.write(oprot)
+ oprot.writeFieldEnd()
+ if self.username is not None:
+ oprot.writeFieldBegin('username', TType.STRING, 2)
+ oprot.writeString(self.username.encode('utf-8') if sys.version_info[0] == 2 else self.username)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.authzToken is None:
+ raise TProtocolException(message='Required field authzToken is unset!')
+ if self.username is None:
+ raise TProtocolException(message='Required field username is unset!')
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class isUserExist_result(object):
+ """
+ Attributes:
+ - success
+ - Idse
+ - ae
+ """
+
+ thrift_spec = (
+ (0, TType.BOOL, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'Idse', (airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException, airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ae', (airavata.api.error.ttypes.AuthorizationException, airavata.api.error.ttypes.AuthorizationException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, Idse=None, ae=None,):
+ self.success = success
+ self.Idse = Idse
+ self.ae = ae
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.BOOL:
+ self.success = iprot.readBool()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.Idse = airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException()
+ self.Idse.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ae = airavata.api.error.ttypes.AuthorizationException()
+ self.ae.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('isUserExist_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.BOOL, 0)
+ oprot.writeBool(self.success)
+ oprot.writeFieldEnd()
+ if self.Idse is not None:
+ oprot.writeFieldBegin('Idse', TType.STRUCT, 1)
+ self.Idse.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ae is not None:
+ oprot.writeFieldBegin('ae', TType.STRUCT, 2)
+ self.ae.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class getUser_args(object):
+ """
+ Attributes:
+ - authzToken
+ - username
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'authzToken', (airavata.model.security.ttypes.AuthzToken, airavata.model.security.ttypes.AuthzToken.thrift_spec), None, ), # 1
+ (2, TType.STRING, 'username', 'UTF8', None, ), # 2
+ )
+
+ def __init__(self, authzToken=None, username=None,):
+ self.authzToken = authzToken
+ self.username = username
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.authzToken = airavata.model.security.ttypes.AuthzToken()
+ self.authzToken.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.username = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('getUser_args')
+ if self.authzToken is not None:
+ oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
+ self.authzToken.write(oprot)
+ oprot.writeFieldEnd()
+ if self.username is not None:
+ oprot.writeFieldBegin('username', TType.STRING, 2)
+ oprot.writeString(self.username.encode('utf-8') if sys.version_info[0] == 2 else self.username)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.authzToken is None:
+ raise TProtocolException(message='Required field authzToken is unset!')
+ if self.username is None:
+ raise TProtocolException(message='Required field username is unset!')
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class getUser_result(object):
+ """
+ Attributes:
+ - success
+ - Idse
+ - ae
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (airavata.model.user.ttypes.UserProfile, airavata.model.user.ttypes.UserProfile.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'Idse', (airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException, airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ae', (airavata.api.error.ttypes.AuthorizationException, airavata.api.error.ttypes.AuthorizationException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, Idse=None, ae=None,):
+ self.success = success
+ self.Idse = Idse
+ self.ae = ae
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = airavata.model.user.ttypes.UserProfile()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.Idse = airavata.service.profile.iam.admin.services.cpi.error.ttypes.IamAdminServicesException()
+ self.Idse.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ae = airavata.api.error.ttypes.AuthorizationException()
+ self.ae.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('getUser_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.Idse is not None:
+ oprot.writeFieldBegin('Idse', TType.STRUCT, 1)
+ self.Idse.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ae is not None:
+ oprot.writeFieldBegin('ae', TType.STRUCT, 2)
+ self.ae.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
class resetUserPassword_args(object):
"""
Attributes: