blob: ecb93e8aadaf6ae0e17586acac0e86b3a2a99b7e [file] [log] [blame]
#
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import apache.airavata.model.appcatalog.computeresource.ttypes
import apache.airavata.model.data.movement.ttypes
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class ComputeResourcePreference:
"""
Gateway specific preferences for a Computer Resource
computeResourceId:
Corelate the preference to a compute resource.
overridebyAiravata:
If turned true, Airavata will override the preferences of better alternatives exist.
loginUserName:
If turned true, Airavata will override the preferences of better alternatives exist.
preferredJobSubmissionProtocol:
For resources with multiple job submission protocols, the gateway can pick a preferred option.
preferredDataMovementProtocol:
For resources with multiple data movement protocols, the gateway can pick a preferred option.
preferredBatchQueue:
Gateways can choose a defualt batch queue based on average job dimention, reservations or other metrics.
scratchLocation:
Path to the local scratch space on a HPC cluster. Typically used to create working directory for job execution.
allocationProjectNumber:
Typically used on HPC machines to charge computing usage to a account number. For instance, on XSEDE once an
allocation is approved, an allocation number is assigned. Before passing this number with job submittions, the
account to be used has to be added to the allocation.
resourceSpecificCredentialStoreToken:
Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
default credential store.
Attributes:
- computeResourceId
- overridebyAiravata
- loginUserName
- preferredJobSubmissionProtocol
- preferredDataMovementProtocol
- preferredBatchQueue
- scratchLocation
- allocationProjectNumber
- resourceSpecificCredentialStoreToken
- usageReportingGatewayId
- qualityOfService
- reservation
- reservationStartTime
- reservationEndTime
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'computeResourceId', None, None, ), # 1
(2, TType.BOOL, 'overridebyAiravata', None, True, ), # 2
(3, TType.STRING, 'loginUserName', None, None, ), # 3
(4, TType.I32, 'preferredJobSubmissionProtocol', None, None, ), # 4
(5, TType.I32, 'preferredDataMovementProtocol', None, None, ), # 5
(6, TType.STRING, 'preferredBatchQueue', None, None, ), # 6
(7, TType.STRING, 'scratchLocation', None, None, ), # 7
(8, TType.STRING, 'allocationProjectNumber', None, None, ), # 8
(9, TType.STRING, 'resourceSpecificCredentialStoreToken', None, None, ), # 9
(10, TType.STRING, 'usageReportingGatewayId', None, None, ), # 10
(11, TType.STRING, 'qualityOfService', None, None, ), # 11
(12, TType.STRING, 'reservation', None, None, ), # 12
(13, TType.I64, 'reservationStartTime', None, None, ), # 13
(14, TType.I64, 'reservationEndTime', None, None, ), # 14
)
def __init__(self, computeResourceId=None, overridebyAiravata=thrift_spec[2][4], loginUserName=None, preferredJobSubmissionProtocol=None, preferredDataMovementProtocol=None, preferredBatchQueue=None, scratchLocation=None, allocationProjectNumber=None, resourceSpecificCredentialStoreToken=None, usageReportingGatewayId=None, qualityOfService=None, reservation=None, reservationStartTime=None, reservationEndTime=None,):
self.computeResourceId = computeResourceId
self.overridebyAiravata = overridebyAiravata
self.loginUserName = loginUserName
self.preferredJobSubmissionProtocol = preferredJobSubmissionProtocol
self.preferredDataMovementProtocol = preferredDataMovementProtocol
self.preferredBatchQueue = preferredBatchQueue
self.scratchLocation = scratchLocation
self.allocationProjectNumber = allocationProjectNumber
self.resourceSpecificCredentialStoreToken = resourceSpecificCredentialStoreToken
self.usageReportingGatewayId = usageReportingGatewayId
self.qualityOfService = qualityOfService
self.reservation = reservation
self.reservationStartTime = reservationStartTime
self.reservationEndTime = reservationEndTime
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (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.STRING:
self.computeResourceId = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.BOOL:
self.overridebyAiravata = iprot.readBool()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.loginUserName = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.I32:
self.preferredJobSubmissionProtocol = iprot.readI32()
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.I32:
self.preferredDataMovementProtocol = iprot.readI32()
else:
iprot.skip(ftype)
elif fid == 6:
if ftype == TType.STRING:
self.preferredBatchQueue = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 7:
if ftype == TType.STRING:
self.scratchLocation = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 8:
if ftype == TType.STRING:
self.allocationProjectNumber = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 9:
if ftype == TType.STRING:
self.resourceSpecificCredentialStoreToken = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 10:
if ftype == TType.STRING:
self.usageReportingGatewayId = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 11:
if ftype == TType.STRING:
self.qualityOfService = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 12:
if ftype == TType.STRING:
self.reservation = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 13:
if ftype == TType.I64:
self.reservationStartTime = iprot.readI64()
else:
iprot.skip(ftype)
elif fid == 14:
if ftype == TType.I64:
self.reservationEndTime = iprot.readI64()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ComputeResourcePreference')
if self.computeResourceId is not None:
oprot.writeFieldBegin('computeResourceId', TType.STRING, 1)
oprot.writeString(self.computeResourceId)
oprot.writeFieldEnd()
if self.overridebyAiravata is not None:
oprot.writeFieldBegin('overridebyAiravata', TType.BOOL, 2)
oprot.writeBool(self.overridebyAiravata)
oprot.writeFieldEnd()
if self.loginUserName is not None:
oprot.writeFieldBegin('loginUserName', TType.STRING, 3)
oprot.writeString(self.loginUserName)
oprot.writeFieldEnd()
if self.preferredJobSubmissionProtocol is not None:
oprot.writeFieldBegin('preferredJobSubmissionProtocol', TType.I32, 4)
oprot.writeI32(self.preferredJobSubmissionProtocol)
oprot.writeFieldEnd()
if self.preferredDataMovementProtocol is not None:
oprot.writeFieldBegin('preferredDataMovementProtocol', TType.I32, 5)
oprot.writeI32(self.preferredDataMovementProtocol)
oprot.writeFieldEnd()
if self.preferredBatchQueue is not None:
oprot.writeFieldBegin('preferredBatchQueue', TType.STRING, 6)
oprot.writeString(self.preferredBatchQueue)
oprot.writeFieldEnd()
if self.scratchLocation is not None:
oprot.writeFieldBegin('scratchLocation', TType.STRING, 7)
oprot.writeString(self.scratchLocation)
oprot.writeFieldEnd()
if self.allocationProjectNumber is not None:
oprot.writeFieldBegin('allocationProjectNumber', TType.STRING, 8)
oprot.writeString(self.allocationProjectNumber)
oprot.writeFieldEnd()
if self.resourceSpecificCredentialStoreToken is not None:
oprot.writeFieldBegin('resourceSpecificCredentialStoreToken', TType.STRING, 9)
oprot.writeString(self.resourceSpecificCredentialStoreToken)
oprot.writeFieldEnd()
if self.usageReportingGatewayId is not None:
oprot.writeFieldBegin('usageReportingGatewayId', TType.STRING, 10)
oprot.writeString(self.usageReportingGatewayId)
oprot.writeFieldEnd()
if self.qualityOfService is not None:
oprot.writeFieldBegin('qualityOfService', TType.STRING, 11)
oprot.writeString(self.qualityOfService)
oprot.writeFieldEnd()
if self.reservation is not None:
oprot.writeFieldBegin('reservation', TType.STRING, 12)
oprot.writeString(self.reservation)
oprot.writeFieldEnd()
if self.reservationStartTime is not None:
oprot.writeFieldBegin('reservationStartTime', TType.I64, 13)
oprot.writeI64(self.reservationStartTime)
oprot.writeFieldEnd()
if self.reservationEndTime is not None:
oprot.writeFieldBegin('reservationEndTime', TType.I64, 14)
oprot.writeI64(self.reservationEndTime)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.computeResourceId is None:
raise TProtocol.TProtocolException(message='Required field computeResourceId is unset!')
if self.overridebyAiravata is None:
raise TProtocol.TProtocolException(message='Required field overridebyAiravata is unset!')
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.computeResourceId)
value = (value * 31) ^ hash(self.overridebyAiravata)
value = (value * 31) ^ hash(self.loginUserName)
value = (value * 31) ^ hash(self.preferredJobSubmissionProtocol)
value = (value * 31) ^ hash(self.preferredDataMovementProtocol)
value = (value * 31) ^ hash(self.preferredBatchQueue)
value = (value * 31) ^ hash(self.scratchLocation)
value = (value * 31) ^ hash(self.allocationProjectNumber)
value = (value * 31) ^ hash(self.resourceSpecificCredentialStoreToken)
value = (value * 31) ^ hash(self.usageReportingGatewayId)
value = (value * 31) ^ hash(self.qualityOfService)
value = (value * 31) ^ hash(self.reservation)
value = (value * 31) ^ hash(self.reservationStartTime)
value = (value * 31) ^ hash(self.reservationEndTime)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
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 StoragePreference:
"""
Attributes:
- storageResourceId
- loginUserName
- fileSystemRootLocation
- resourceSpecificCredentialStoreToken
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'storageResourceId', None, None, ), # 1
(2, TType.STRING, 'loginUserName', None, None, ), # 2
(3, TType.STRING, 'fileSystemRootLocation', None, None, ), # 3
(4, TType.STRING, 'resourceSpecificCredentialStoreToken', None, None, ), # 4
)
def __init__(self, storageResourceId=None, loginUserName=None, fileSystemRootLocation=None, resourceSpecificCredentialStoreToken=None,):
self.storageResourceId = storageResourceId
self.loginUserName = loginUserName
self.fileSystemRootLocation = fileSystemRootLocation
self.resourceSpecificCredentialStoreToken = resourceSpecificCredentialStoreToken
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (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.STRING:
self.storageResourceId = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.loginUserName = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.fileSystemRootLocation = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
self.resourceSpecificCredentialStoreToken = iprot.readString()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('StoragePreference')
if self.storageResourceId is not None:
oprot.writeFieldBegin('storageResourceId', TType.STRING, 1)
oprot.writeString(self.storageResourceId)
oprot.writeFieldEnd()
if self.loginUserName is not None:
oprot.writeFieldBegin('loginUserName', TType.STRING, 2)
oprot.writeString(self.loginUserName)
oprot.writeFieldEnd()
if self.fileSystemRootLocation is not None:
oprot.writeFieldBegin('fileSystemRootLocation', TType.STRING, 3)
oprot.writeString(self.fileSystemRootLocation)
oprot.writeFieldEnd()
if self.resourceSpecificCredentialStoreToken is not None:
oprot.writeFieldBegin('resourceSpecificCredentialStoreToken', TType.STRING, 4)
oprot.writeString(self.resourceSpecificCredentialStoreToken)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.storageResourceId is None:
raise TProtocol.TProtocolException(message='Required field storageResourceId is unset!')
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.storageResourceId)
value = (value * 31) ^ hash(self.loginUserName)
value = (value * 31) ^ hash(self.fileSystemRootLocation)
value = (value * 31) ^ hash(self.resourceSpecificCredentialStoreToken)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
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 GatewayResourceProfile:
"""
Gateway Resource Profile
gatewayID:
Unique identifier for the gateway assigned by Airavata. Corelate this to Airavata Admin API Gateway Registration.
credentialStoreToken:
Gateway's defualt credential store token.
computeResourcePreferences:
List of resource preferences for each of the registered compute resources.
identityServerTenant:
identityServerPwdCredToken:
Attributes:
- gatewayID
- credentialStoreToken
- computeResourcePreferences
- storagePreferences
- identityServerTenant
- identityServerPwdCredToken
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'gatewayID', None, None, ), # 1
(2, TType.STRING, 'credentialStoreToken', None, None, ), # 2
(3, TType.LIST, 'computeResourcePreferences', (TType.STRUCT,(ComputeResourcePreference, ComputeResourcePreference.thrift_spec)), None, ), # 3
(4, TType.LIST, 'storagePreferences', (TType.STRUCT,(StoragePreference, StoragePreference.thrift_spec)), None, ), # 4
(5, TType.STRING, 'identityServerTenant', None, None, ), # 5
(6, TType.STRING, 'identityServerPwdCredToken', None, None, ), # 6
)
def __init__(self, gatewayID=None, credentialStoreToken=None, computeResourcePreferences=None, storagePreferences=None, identityServerTenant=None, identityServerPwdCredToken=None,):
self.gatewayID = gatewayID
self.credentialStoreToken = credentialStoreToken
self.computeResourcePreferences = computeResourcePreferences
self.storagePreferences = storagePreferences
self.identityServerTenant = identityServerTenant
self.identityServerPwdCredToken = identityServerPwdCredToken
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (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.STRING:
self.gatewayID = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.credentialStoreToken = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.LIST:
self.computeResourcePreferences = []
(_etype3, _size0) = iprot.readListBegin()
for _i4 in xrange(_size0):
_elem5 = ComputeResourcePreference()
_elem5.read(iprot)
self.computeResourcePreferences.append(_elem5)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.LIST:
self.storagePreferences = []
(_etype9, _size6) = iprot.readListBegin()
for _i10 in xrange(_size6):
_elem11 = StoragePreference()
_elem11.read(iprot)
self.storagePreferences.append(_elem11)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.STRING:
self.identityServerTenant = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 6:
if ftype == TType.STRING:
self.identityServerPwdCredToken = iprot.readString()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('GatewayResourceProfile')
if self.gatewayID is not None:
oprot.writeFieldBegin('gatewayID', TType.STRING, 1)
oprot.writeString(self.gatewayID)
oprot.writeFieldEnd()
if self.credentialStoreToken is not None:
oprot.writeFieldBegin('credentialStoreToken', TType.STRING, 2)
oprot.writeString(self.credentialStoreToken)
oprot.writeFieldEnd()
if self.computeResourcePreferences is not None:
oprot.writeFieldBegin('computeResourcePreferences', TType.LIST, 3)
oprot.writeListBegin(TType.STRUCT, len(self.computeResourcePreferences))
for iter12 in self.computeResourcePreferences:
iter12.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.storagePreferences is not None:
oprot.writeFieldBegin('storagePreferences', TType.LIST, 4)
oprot.writeListBegin(TType.STRUCT, len(self.storagePreferences))
for iter13 in self.storagePreferences:
iter13.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.identityServerTenant is not None:
oprot.writeFieldBegin('identityServerTenant', TType.STRING, 5)
oprot.writeString(self.identityServerTenant)
oprot.writeFieldEnd()
if self.identityServerPwdCredToken is not None:
oprot.writeFieldBegin('identityServerPwdCredToken', TType.STRING, 6)
oprot.writeString(self.identityServerPwdCredToken)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
if self.gatewayID is None:
raise TProtocol.TProtocolException(message='Required field gatewayID is unset!')
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.gatewayID)
value = (value * 31) ^ hash(self.credentialStoreToken)
value = (value * 31) ^ hash(self.computeResourcePreferences)
value = (value * 31) ^ hash(self.storagePreferences)
value = (value * 31) ^ hash(self.identityServerTenant)
value = (value * 31) ^ hash(self.identityServerPwdCredToken)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
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)