def __init__(self): '''Constructor''' Object.__init__(self) self._apitype = 'saga.base' AttributeInterface.__init__(self) self._type = None self._userid = None self._userpass = None self._usercert = None self._userkey = None self._userproxy = None # register properties with the attribute interface self._register_rw_attribute(name="Type", accessor=self.__class__.type) self._register_rw_attribute(name="UserID", accessor=self.__class__.userid) self._register_rw_attribute(name="UserPass", accessor=self.__class__.userpass) self._register_rw_attribute(name="UserCert", accessor=self.__class__.usercert) self._register_rw_attribute(name="UserKey", accessor=self.__class__.userkey) self._register_rw_attribute(name="UserProxy", accessor=self.__class__.userproxy) self.__logger = logging.getLogger('bliss.'+self.__class__.__name__)
def __init__(self): '''Constructor''' Object.__init__(self) self._apitype = 'saga.base' AttributeInterface.__init__(self) self._type = None self._userid = None self._userpass = None self._usercert = None self._userkey = None self._userproxy = None # register properties with the attribute interface self._register_rw_attribute(name="Type", accessor=self.__class__.type) self._register_rw_attribute(name="UserID", accessor=self.__class__.userid) self._register_rw_attribute(name="UserPass", accessor=self.__class__.userpass) self._register_rw_attribute(name="UserCert", accessor=self.__class__.usercert) self._register_rw_attribute(name="UserKey", accessor=self.__class__.userkey) self._register_rw_attribute(name="UserProxy", accessor=self.__class__.userproxy) self.__logger = logging.getLogger('bliss.' + self.__class__.__name__)
def __init__(self, url, session=None): '''Construct a new job service object @param url: Url of the (remote) job manager. @type url: L{Url} ''' Object.__init__(self, session=session) self._apitype = 'saga.job' if type(url) == str: self._url = Url(str(url)) elif type(url) == Url: self._url = url elif type(url) == Compute: self._url = url._url else: raise bliss.saga.Exception( bliss.saga.Error.BadParameter, "A job.Service object must either be initialized with a URL or a resource.Compute object." ) self._from_compute = False self._compute_obj = None self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_service_object(self) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self): '''Create a new (empty) storage resource description.''' Object.__init__(self, Object.Type.ResourceStorageDescription, apitype=Object.Type.ResourceAPI) AttributeInterface.__init__(self) self._dynamic = False self._start = None self._end = None self._duration = None self._register_rw_attribute (name="Dynamic", accessor=self.__class__.dynamic) self._register_rw_attribute (name="Start", accessor=self.__class__.start) self._register_rw_attribute (name="End", accessor=self.__class__.end) self._register_rw_attribute (name="Duration", accessor=self.__class__.duration) self._size = '' self._mountpoint = None self._register_rw_attribute (name="Size", accessor=self.__class__.size) self._register_rw_attribute (name="Mountpoint", accessor=self.__class__.mountpoint)
def __init__(self): '''Constructor''' Object.__init__(self, objtype=Object.Type.Context, apitype=Object.Type.BaseAPI) AttributeInterface.__init__(self) self._type = None self._userid = None self._userpass = None self._usercert = None self._userkey = None self._userproxy = None # register properties with the attribute interface self._register_rw_attribute (name="Type", accessor=self.__class__.type) self._register_rw_attribute (name="UserID", accessor=self.__class__.userid) self._register_rw_attribute (name="UserPass", accessor=self.__class__.userpass) self._register_rw_attribute (name="UserCert", accessor=self.__class__.usercert) self._register_rw_attribute (name="UserKey", accessor=self.__class__.userkey) self._register_rw_attribute (name="UserProxy", accessor=self.__class__.userproxy) self.__logger = logging.getLogger(self.__class__.__name__+'('+str(hex(id(self)))+')')
def __init__(self, url, session=None): '''Construct a new job service object @param url: Url of the (remote) job manager. @type url: L{Url} ''' Object.__init__(self, session=session) self._apitype = 'saga.job' if type(url) == str: self._url = Url(str(url)) elif type(url) == Url: self._url = url elif type(url) == Compute: self._url = url._url else: raise bliss.saga.Exception(bliss.saga.Error.BadParameter, "A job.Service object must either be initialized with a URL or a resource.Compute object.") self._from_compute = False self._compute_obj = None self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_service_object(self) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, urlstring=''): '''Construct a new Url from a string''' Object.__init__(self, objtype=Object.Type.Url, apitype=Object.Type.BaseAPI) self._urlobj = furl(urlstring) self.scheme = self._urlobj.scheme '''The scheme part of the Url.''' self.host = self._urlobj.host #host '''The host part of the Url.''' if self._urlobj.port is not None: self.port = int(self._urlobj.port) # int(port) '''The port part of the Url.''' else: self.port = None '''The port part of the Url.''' self.username = self._urlobj.username '''The username part of the Url.''' self.password = self._urlobj.password '''The password part of the Url.''' self.path = self._urlobj.path '''The path part of the Url.''' self.query = self._urlobj.query '''The query part of the Url.''' self.fragment = self._urlobj.fragment '''The fragment part of the Url.''' self.url = str(self._urlobj) '''The Url as string (same as __str__).'''
def __init__(self): '''Create a new (empty) storage resource description.''' Object.__init__(self) self._apitype = 'saga.resource' AttributeInterface.__init__(self) self._dynamic = False self._start = None self._end = None self._duration = None self._template = None self._register_rw_attribute(name="Dynamic", accessor=self.__class__.dynamic) self._register_rw_attribute(name="Start", accessor=self.__class__.start) self._register_rw_attribute(name="End", accessor=self.__class__.end) self._register_rw_attribute(name="Duration", accessor=self.__class__.duration) self._register_rw_attribute(name="Template", accessor=self.__class__.template) self._size = '' self._register_rw_attribute(name="Size", accessor=self.__class__.size)
def __init__(self, url, session=None): '''Construct a new directory object @param url: Url of the (remote) file system. @type url: L{Url} The specified directory is expected to exist -- otherwise a DoesNotExist exception is raised. Also, the URL must point to a directory (not to a file), otherwise a BadParameter exception is raised. Example:: # open some directory dir = saga.filesystem.Directory("sftp://localhost/tmp/") # and list its contents files = dir.list () ''' #Object.__init__(self, Object.Type.LogicalFileDirectory, # apitype=Object.Type.LogicalFileAPI, session=session) Object.__init__(self, session=session) self._apitype="saga.logicalfile" if(type(url) == str): self._url = Url(str(url)) else: self._url = url self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_logicaldirectory_object(self) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self): '''Create a new, empty job description.''' Object.__init__(self) self._apitype = 'saga.job' AttributeInterface.__init__(self) # properties self._executable = None self._arguments = None self._environment = None self._file_transfer = None self._project = None self._output = None self._error = None self._working_directory = None self._contact = None self._name = None # requirements self._total_cpu_count = None self._wall_time_limit = None self._number_of_processes = None self._spmd_variation = None self._queue = None # register properties with the attribute interface self._register_rw_attribute(name="Executable", accessor=self.__class__.executable) self._register_rw_attribute(name="Output", accessor=self.__class__.output) self._register_rw_attribute(name="Error", accessor=self.__class__.error) self._register_rw_attribute(name="Queue", accessor=self.__class__.queue) self._register_rw_attribute(name="WallTimeLimit", accessor=self.__class__.wall_time_limit) self._register_rw_attribute(name="WorkingDirectory", accessor=self.__class__.working_directory) self._register_rw_attribute(name="Contact", accessor=self.__class__.contact) self._register_rw_attribute(name="Name", accessor=self.__class__.name) self._register_rw_attribute(name="TotalCPUCount", accessor=self.__class__.total_cpu_count) self._register_rw_attribute(name="NumberOfProcesses", accessor=self.__class__.number_of_processes) self._register_rw_attribute(name="SPMDVariation", accessor=self.__class__.spmd_variation) self._register_rw_attribute(name="Project", accessor=self.__class__.project) self._register_rw_vec_attribute(name="Arguments", accessor=self.__class__.arguments) self._register_rw_vec_attribute(name="FileTransfer", accessor=self.__class__.file_transfer) self._register_rw_vec_attribute(name="Environment", accessor=self.__class__.environment)
def __init__(self): '''PRIVATE Constructor (don't call explicitly!)''' Object.__init__(self, Object.Type.Job, apitype=Object.Type.JobAPI) AttributeInterface.__init__(self) # register properties with the attribute interface self._register_ro_attribute (name="Exitcode", accessor=self.__class__.exitcode) self._register_ro_attribute (name="JobID", accessor=self.__class__.jobid) self._register_ro_attribute (name="ServiceURL", accessor=self.__class__.serviceurl)
def __init__(self): '''PRIVATE Constructor (don't call explicitly!)''' Object.__init__(self) self._apitype = 'saga.job' AttributeInterface.__init__(self) # register properties with the attribute interface self._register_ro_attribute(name="Exitcode", accessor=self.__class__.exitcode) self._register_ro_attribute(name="JobID", accessor=self.__class__.jobid) self._register_ro_attribute(name="ServiceURL", accessor=self.__class__.serviceurl)
def __init__(self, url=''): '''Create a new Url object.''' Object.__init__(self) self._apitype = 'saga.base' if type(url) == str: self._urlobj = urlparse.urlparse(url) elif type(url) == Url: self._urlobj = urlparse.urlparse(str(url)) else: raise bliss.saga.Exception(bliss.saga.Error.NoSuccess, "URL constructor expects str or bliss.saga.Url type as parameter")
def __init__(self, url=''): '''Create a new Url object.''' Object.__init__(self) self._apitype = 'saga.base' if type(url) == str: self._urlobj = urlparse.urlparse(url) elif type(url) == Url: self._urlobj = urlparse.urlparse(str(url)) else: raise bliss.saga.Exception( bliss.saga.Error.NoSuccess, "URL constructor expects str or bliss.saga.Url type as parameter" )
def __init__(self, url, session=None): '''Construct a new resource manager object @param url: Url of the (remote) resource manager. @type url: L{Url} ''' Object.__init__(self, Object.Type.ResourceManager, apitype=Object.Type.ResourceAPI, session=session) if(type(url) == str): self._url = Url(str(url)) else: self._url = url self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_manager_object(self, url) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, url, session=None): '''Construct a new file object @param url: Url of the (remote) job manager. @type url: L{Url} ''' Object.__init__(self, Object.Type.FilesystemDirectory, apitype=Object.Type.FilesystemAPI, session=session) if(type(url) == str): self._url = Url(str(url)) else: self._url = url self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_directory_object(self) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init_from_manager(self, manager_obj, storage_description): '''(Hidden) Constructor''' self._manager = manager_obj self._url = manager_obj._url self._storage_description = storage_description self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init_from_service(self, service_obj, job_desc): '''Constructor''' self._service = service_obj self._url = service_obj._url self._job_description = job_desc self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init_from_manager(self, manager_obj, compute_description): '''(Hidden) Constructor''' self._manager = manager_obj self._url = manager_obj._url self._compute_description = compute_description self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, url, flags=None, session=None): '''Construct a new directory object @param url: Url of the (remote) file system. @type url: L{Url} The specified directory is expected to exist -- otherwise a DoesNotExist exception is raised. Also, the URL must point to a directory (not to a file), otherwise a BadParameter exception is raised. Example:: # open some directory dir = saga.filesystem.Directory("sftp://localhost/tmp/") # and list its contents files = dir.list () ''' Object.__init__(self, session=session) self._apitype = 'saga.filesystem' if type(url) == str: self._url = bliss.saga.Url(str(url)) elif type(url) == bliss.saga.Url: self._url = url else: raise bliss.saga.Exception( bliss.saga.Error.NoSuccess, "File constructor expects str or bliss.saga.Url type as 'url' parameter" ) # Directory paths end with "/" by convention if self._url.path.endswith("/") != True: self._url.path = "%s/" % self._url.path if flags is None: _flags = 0 else: _flags = flags self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_directory_object(self, _flags) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, url, flags=None, session=None): '''Construct a new directory object @param url: Url of the (remote) file system. @type url: L{Url} The specified directory is expected to exist -- otherwise a DoesNotExist exception is raised. Also, the URL must point to a directory (not to a file), otherwise a BadParameter exception is raised. Example:: # open some directory dir = saga.filesystem.Directory("sftp://localhost/tmp/") # and list its contents files = dir.list () ''' Object.__init__(self, session=session) self._apitype = 'saga.filesystem' if type(url) == str: self._url = bliss.saga.Url(str(url)) elif type(url) == bliss.saga.Url: self._url = url else: raise bliss.saga.Exception(bliss.saga.Error.NoSuccess, "File constructor expects str or bliss.saga.Url type as 'url' parameter") # Directory paths end with "/" by convention if self._url.path.endswith("/") != True : self._url.path = "%s/" % self._url.path if flags is None: _flags = 0 else: _flags = flags self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_directory_object(self, _flags) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, url, session=None): '''Construct a new job service object @param url: Url of the (remote) job manager. @type url: L{Url} ''' Object.__init__(self, Object.Type.JobService, apitype=Object.Type.JobAPI, session=session) if(type(url) == str): self._url = Url(str(url)) else: self._url = url self._from_compute = False self._compute_obj = None self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_service_object(self) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, url, session=None): """Construct a new file object @param url: Url of the (remote) job manager. @type url: L{Url} """ Object.__init__(self, Object.Type.FilesystemFile, apitype=Object.Type.FilesystemAPI, session=session) if type(url) == str: self._url = bliss.saga.Url(str(url)) elif type(url) == bliss.saga.Url: self._url = url else: raise bliss.saga.Exception( bliss.saga.Error.NoSuccess, "File constructor expects str or bliss.saga.Url type as 'url' parameter" ) self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_file_object(self) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, url, session=None): '''Construct a new resource manager object @param url: Url of the (remote) resource manager. @type url: L{Url} ''' Object.__init__(self, session=session) self._apitype = 'saga.resource' if type(url) == str: self._url = Url(str(url)) elif type(url) == Url: self._url = url else: raise bliss.saga.Exception(bliss.saga.Error.BadParameter, "A resource.Manager object must be initialized with a URL.") self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_manager_object(self, self._url) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, service): '''Create a new job (a.k.a. 'task') container. @param service: Currently, a container needs to be bound to a valid L{saga.job.Service} and can only hold jobs that are known to that service. ''' Object.__init__(self, Object.Type.JobContainer, apitype=Object.Type.JobAPI) # parameter checks if service.get_type() != Object.Type.JobService: raise bliss.saga.Exception(bliss.saga.Error.BadParameter, "Container c'tor expects %s object as parameter" % (Object.Type.JobService)) self._service = service self._url = service._url self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.container_object_register(self) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self): '''Create a new (empty) compute resource description.''' Object.__init__(self) self._apitype = 'saga.resource' AttributeInterface.__init__(self) self._dynamic = False self._start = None self._end = None self._duration = None self._template = None self._register_rw_attribute(name="Dynamic", accessor=self.__class__.dynamic) self._register_rw_attribute(name="Start", accessor=self.__class__.start) self._register_rw_attribute(name="End", accessor=self.__class__.end) self._register_rw_attribute(name="Duration", accessor=self.__class__.duration) self._register_rw_attribute(name="Template", accessor=self.__class__.template) self._slots = 1 self._memory = None self._hostnames = list() self._operating_system = 'Any' self._architecture = 'Any' self._register_rw_vec_attribute(name="OperatingSystem", accessor=self.__class__.operating_system) self._register_rw_vec_attribute(name="Architecture", accessor=self.__class__.architecture) self._register_rw_vec_attribute(name="Hostnames", accessor=self.__class__.hostnames) self._register_rw_attribute(name="Slots", accessor=self.__class__.slots) self._register_rw_attribute(name="Memory", accessor=self.__class__.memory)
def __init__(self, url, flags=None, session=None): '''Construct a new file object @param url: Url of the (remote) file @type url: L{Url} The specified file is expected to exist -- otherwise a DoesNotExist exception is raised. Also, the URL must point to a file (not to a directory), otherwise a BadParameter exception is raised. Example:: # get a file handle file = saga.filesystem.File("sftp://localhost/tmp/data/data.bin") # print the file's size print file.get_size () ''' Object.__init__(self, session=session) self._apitype = 'saga.filesystem' if type(url) == str: self._url = bliss.saga.Url(str(url)) elif type(url) == bliss.saga.Url: self._url = url else: raise bliss.saga.Exception( bliss.saga.Error.NoSuccess, "File constructor expects str or bliss.saga.Url type as 'url' parameter" ) if flags is None: _flags = 0 else: _flags = flags self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_file_object(self, flags) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self, url, flags=None, session=None): '''Construct a new file object @param url: Url of the (remote) file @type url: L{Url} The specified file is expected to exist -- otherwise a DoesNotExist exception is raised. Also, the URL must point to a file (not to a directory), otherwise a BadParameter exception is raised. Example:: # get a file handle file = saga.filesystem.File("sftp://localhost/tmp/data/data.bin") # print the file's size print file.get_size () ''' Object.__init__(self, session=session) self._apitype = 'saga.filesystem' if type(url) == str: self._url = bliss.saga.Url(str(url)) elif type(url) == bliss.saga.Url: self._url = url else: raise bliss.saga.Exception(bliss.saga.Error.NoSuccess, "File constructor expects str or bliss.saga.Url type as 'url' parameter") if flags is None: _flags = 0 else: _flags = flags self._plugin = Object._get_plugin(self) # throws 'NoSuccess' on error self._plugin.register_file_object(self, flags) self._logger.info("Bound to plugin %s" % (repr(self._plugin)))
def __init__(self): '''PRIVATE: Create a new compute resource. ''' Object.__init__(self, Object.Type.ResourceCompute, apitype=Object.Type.ResourceAPI)
def __init__(self): '''PRIVATE: Create a new storage resource. ''' Object.__init__(self) self._apitype = 'saga.resource'
def __init__(self): '''PRIVATE: Create a new storage resource. ''' Object.__init__(self, Object.Type.ResourceStorage, apitype=Object.Type.ResourceAPI)
def __init__(self): '''PRIVATE: Create a new compute resource. ''' Object.__init__(self) self._apitype = 'saga.resource'