Search is not available for this dataset
text
stringlengths
75
104k
def listDataTiers(self, data_tier_name=""): """ List data tier(s) """ if not isinstance(data_tier_name, basestring) : dbsExceptionHandler('dbsException-invalid-input', 'data_tier_name given is not valid : %s' % data_tier_name) else: ...
def execute(self, conn, site_name= "", transaction = False): """ Lists all sites types if site_name is not provided. """ sql = self.sql if site_name == "": result = self.dbi.processData(sql, conn=conn, transaction=transaction) else: sql += "WHERE S...
def execute(self, conn, logical_file_name={}, transaction=False): """ simple execute """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/DeleteFiles. Expects db connection from upper layer.") self.dbi.processData(self.sql, logical_file_name, conn...
def listDataType(self, dataType="", dataset=""): """ List data-type/primary-ds-type """ conn = self.dbi.connection() try: if dataset and dataType: dbsExceptionHandler('dbsException-invalid-input', "DBSDataType/listDataType. Data Ty...
def getBlocks(self): """ Get the blocks that need to be migrated """ try: conn = self.dbi.connection() result = self.buflistblks.execute(conn) return result finally: if conn: conn.close()
def getBufferedFiles(self, block_id): """ Get some files from the insert buffer """ try: conn = self.dbi.connection() result = self.buflist.execute(conn, block_id) return result finally: if conn: conn.cl...
def execute(self, conn, data_tier_name='', transaction = False, cache=None): """ returns id for a given datatier name """ if cache: ret=cache.get("DATA_TIERS") if not ret==None: return ret sql = self.sql binds={} if data_tier_name: o...
def execute(self, conn, migration_url="", migration_input="", create_by="", migration_request_id="", transaction=False): """ Lists the oldest request queued """ binds = {} result = self.dbi.processData(self.sql, binds, conn, transaction) result = self.formatDict(result) if len...
def listProcessingEras(self, processing_version=''): """ Returns all processing eras in dbs """ conn = self.dbi.connection() try: result = self.pelst.execute(conn, processing_version) return result finally: if conn: conn...
def insertProcessingEra(self, businput): """ Input dictionary has to have the following keys: processing_version, creation_date, create_by, description it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = con...
def listPhysicsGroups(self, physics_group_name=""): """ Returns all physics groups if physics group names are not passed. """ if not isinstance(physics_group_name, basestring): dbsExceptionHandler('dbsException-invalid-input', 'physics group name given is not ...
def create_token_generator(input_list): """SQL Generator to select from list of values in Oracle""" ###Generator trick from http://betteratoracle.com/posts/20-how-do-i-bind-a-variable-in-list ###The maximum length of the comma separated list is 4000 characters, therefore we need to split the list ###ORA...
def getServices(self): """ Simple method that returs list of all know DBS instances, instances known to this registry """ try: conn = self.dbi.connection() result = self.serviceslist.execute(conn) return result except Exception as ex: ...
def addService(self): """ Add a service to service registry """ conn = self.dbi.connection() tran = conn.begin() try: body = request.body.read() service = cjson.decode(body) addthis = {} addthis['service_id'] =...
def execute(self, conn, daoinput, transaction = False): """ required keys: migration_status, migration_request_id """ if not conn: dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationRequests/UpdateRequestStatus. Expects db connection from upper layer.", ...
def execute(self, conn, migration_url="", migration_input="", create_by="", migration_request_id="", oldest= False, transaction=False): """ Lists all requests if pattern is not provided. """ sql = self.sql binds = {} if migration_request_id: sql += " WHERE MR.MIGRATION_REQU...
def execute(self, conn, logical_file_name, transaction=False): """ simple execute """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/DeleteDupicates. Expects db connection from upper layer.") print(self.sql) self.dbi.processData(self.sql, logical_fil...
def execute(self, conn, block_name="", transaction = False): """ block: /a/b/c#d """ if not conn: dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/BlockParent/List. Expects db connection from upper layer.", self.logger.exception) sql = self.sql if i...
def execute(self, conn, origin_site_name="", dataset="", block_name="", transaction = False): """ origin_site_name: T1_US_FNAL_Buffer dataset: /a/b/c block_name: /a/b/c#d """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", ...
def listPrimaryDatasets(self, primary_ds_name="", primary_ds_type=""): """ Returns all primary dataset if primary_ds_name or primary_ds_type are not passed. """ conn = self.dbi.connection() try: result = self.primdslist.execute(conn, primary_ds_name, primary_ds_type) ...
def listPrimaryDSTypes(self, primary_ds_type="", dataset=""): """ Returns all primary dataset types if dataset or primary_ds_type are not passed. """ conn = self.dbi.connection() try: result = self.primdstypeList.execute(conn, primary_ds_type, dataset) if ...
def insertPrimaryDataset(self, businput): """ Input dictionary has to have the following keys: primary_ds_name, primary_ds_type, creation_date, create_by. it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = c...
def execute(self, conn, name='', transaction = False): """ returns id for a given physics group name """ binds={} if name: op = ('=', 'like')['%' in name] sql = self.sql + " WHERE pg.physics_group_name %s :physicsgroup" % (op) binds = {"physic...
def insertOutputConfig(self, businput): """ Method to insert the Output Config. app_name, release_version, pset_hash, global_tag and output_module_label are required. args: businput(dic): input dictionary. Updated Oct 12, 2011 """ if not ...
def getHelp(self, call=""): """ API to get a list of supported REST APIs. In the case a particular API is specified, the docstring of that API is displayed. :param call: call to get detailed information about (Optional) :type call: str :return: List of APIs or detailed i...
def listPrimaryDatasets(self, primary_ds_name="", primary_ds_type=""): """ API to list primary datasets :param primary_ds_type: List primary datasets with primary dataset type (Optional) :type primary_ds_type: str :param primary_ds_name: List that primary dataset (Optional) ...
def listPrimaryDsTypes(self, primary_ds_type="", dataset=""): """ API to list primary dataset types :param primary_ds_type: List that primary dataset type (Optional) :type primary_ds_type: str :param dataset: List the primary dataset type for that dataset (Optional) :typ...
def listDatasets(self, dataset="", parent_dataset="", is_dataset_valid=1, release_version="", pset_hash="", app_name="", output_module_label="", global_tag="", processing_version=0, acquisition_era_name="", run_num=-1, physics_group_name="", logical_file_name="", primary_ds_name="", primary_ds_t...
def listDatasetArray(self): """ API to list datasets in DBS. To be called by datasetlist url with post call. :param dataset: list of datasets [dataset1,dataset2,..,dataset n] (must have either a list of dataset or dataset_id), Max length 1000. :type dataset: list :param dataset_id: lis...
def listDataTiers(self, data_tier_name=""): """ API to list data tiers known to DBS. :param data_tier_name: List details on that data tier (Optional) :type data_tier_name: str :returns: List of dictionaries containing the following keys (data_tier_id, data_tier_name, create_by, ...
def listBlocks(self, dataset="", block_name="", data_tier_name="", origin_site_name="", logical_file_name="",run_num=-1, min_cdate='0', max_cdate='0', min_ldate='0', max_ldate='0', cdate='0', ldate='0', open_for_writing=-1, detail=False): """ API to list a block i...
def listBlockOrigin(self, origin_site_name="", dataset="", block_name=""): """ API to list blocks first generated in origin_site_name. :param origin_site_name: Origin Site Name (Optional, No wildcards) :type origin_site_name: str :param dataset: dataset ( No wildcards, either d...
def listBlocksParents(self): """ API to list block parents of multiple blocks. To be called by blockparents url with post call. :param block_names: list of block names [block_name1, block_name2, ...] (Required). Mwx length 1000. :type block_names: list """ try : ...
def listBlockChildren(self, block_name=""): """ API to list block children. :param block_name: name of block who's children needs to be found (Required) :type block_name: str :returns: List of dictionaries containing following keys (block_name) :rtype: list of dicts ...
def listBlockSummaries(self, block_name="", dataset="", detail=False): """ API that returns summary information like total size and total number of events in a dataset or a list of blocks :param block_name: list block summaries for block_name(s) :type block_name: str, list :para...
def listFiles(self, dataset = "", block_name = "", logical_file_name = "", release_version="", pset_hash="", app_name="", output_module_label="", run_num=-1, origin_site_name="", lumi_list="", detail=False, validFileOnly=0, sumOverLumi=0): """ API to list files in DBS. Either non-wildcar...
def listFileArray(self): """ API to list files in DBS. Either non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required. The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported....
def listFileSummaries(self, block_name='', dataset='', run_num=-1, validFileOnly=0, sumOverLumi=0): """ API to list number of files, event counts and number of lumis in a given block or dataset. If the optional run_num, output are: * The number of files which have data (lumis) ...
def listDatasetParents(self, dataset=''): """ API to list A datasets parents in DBS. :param dataset: dataset (Required) :type dataset: str :returns: List of dictionaries containing the following keys (this_dataset, parent_dataset_id, parent_dataset) :rtype: list of dicts...
def listOutputConfigs(self, dataset="", logical_file_name="", release_version="", pset_hash="", app_name="", output_module_label="", block_id=0, global_tag=''): """ API to list OutputConfigs in DBS. * You can use any combination of these param...
def listFileParents(self, logical_file_name='', block_id=0, block_name=''): """ API to list file parents :param logical_file_name: logical_file_name of file (Required) :type logical_file_name: str, list :param block_id: ID of the a block, whose files should be listed :ty...
def listFileParentsByLumi(self): """ IMPORTANT: This is ***WMAgent*** sepcial case API. It is not for others. API to list File Parentage for a given block with or w/o a list of LFN. It is used with the POST method of fileparents call. Using the child_lfn_list will significantly affect ...
def listFileChildren(self, logical_file_name='', block_name='', block_id=0): """ API to list file children. One of the parameters in mandatory. :param logical_file_name: logical_file_name of file (Required) :type logical_file_name: str, list :param block_name: block_name ...
def listFileLumis(self, logical_file_name="", block_name="", run_num=-1, validFileOnly=0): """ API to list Lumi for files. Either logical_file_name or block_name is required. No wild card support in this API :param block_name: Name of the block :type block_name: str :param logic...
def listRuns(self, run_num=-1, logical_file_name="", block_name="", dataset=""): """ API to list all runs in DBS. At least one parameter is mandatory. :param logical_file_name: List all runs in the file :type logical_file_name: str :param block_name: List all runs in the block ...
def listDataTypes(self, datatype="", dataset=""): """ API to list data types known to dbs (when no parameter supplied). :param dataset: Returns data type (of primary dataset) of the dataset (Optional) :type dataset: str :param datatype: List specific data type :type data...
def dumpBlock(self, block_name): """ API the list all information related with the block_name :param block_name: Name of block to be dumped (Required) :type block_name: str """ try: return self.dbsBlock.dumpBlock(block_name) except HTTPError as he: ...
def listAcquisitionEras(self, acquisition_era_name=''): """ API to list all Acquisition Eras in DBS. :param acquisition_era_name: Acquisition era name (Optional, wild cards allowed) :type acquisition_era_name: str :returns: List of dictionaries containing following keys (descrip...
def listProcessingEras(self, processing_version=0): """ API to list all Processing Eras in DBS. :param processing_version: Processing Version (Optional). If provided just this processing_version will be listed :type processing_version: str :returns: List of dictionaries containi...
def listReleaseVersions(self, release_version='', dataset='', logical_file_name=''): """ API to list all release versions in DBS :param release_version: List only that release version :type release_version: str :param dataset: List release version of the specified dataset ...
def listDatasetAccessTypes(self, dataset_access_type=''): """ API to list dataset access types. :param dataset_access_type: List that dataset access type (Optional) :type dataset_access_type: str :returns: List of dictionary containing the following key (dataset_access_type). ...
def listPhysicsGroups(self, physics_group_name=''): """ API to list all physics groups. :param physics_group_name: List that specific physics group (Optional) :type physics_group_name: basestring :returns: List of dictionaries containing the following key (physics_group_name) ...
def listRunSummaries(self, dataset="", run_num=-1): """ API to list run summaries, like the maximal lumisection in a run. :param dataset: dataset name (Optional) :type dataset: str :param run_num: Run number (Required) :type run_num: str, long, int :rtype: list c...
def list(): """ List all events """ entries = lambder.list_events() for e in entries: click.echo(str(e))
def add(name, function_name, cron): """ Create an event """ lambder.add_event(name=name, function_name=function_name, cron=cron)
def load(file): """ Load events from a json file """ with open(file, 'r') as f: contents = f.read() lambder.load_events(contents)
def functions(context): """ Manage AWS Lambda functions """ # find lambder.json in CWD config_file = "./lambder.json" if os.path.isfile(config_file): context.obj = FunctionConfig(config_file) pass
def list(): """ List lambder functions """ functions = lambder.list_functions() output = json.dumps( functions, sort_keys=True, indent=4, separators=(',', ':') ) click.echo(output)
def new( name, bucket, timeout, memory, description, subnet_ids, security_group_ids ): """ Create a new lambda project """ config = {} if timeout: config['timeout'] = timeout if memory: config['memory'] = memory if description: config['description'...
def deploy( config, name, bucket, timeout, memory, description, subnet_ids, security_group_ids ): """ Deploy/Update a function from a project directory """ # options should override config if it is there myname = name or config.name mybucket = bucket or config.bucket ...
def rm(config, name, bucket): """ Delete lambda function, role, and zipfile """ # options should override config if it is there myname = name or config.name mybucket = bucket or config.bucket click.echo('Deleting {} from {}'.format(myname, mybucket)) lambder.delete_function(myname, mybucket)
def invoke(config, name, input): """ Invoke function in AWS """ # options should override config if it is there myname = name or config.name click.echo('Invoking ' + myname) output = lambder.invoke_function(myname, input) click.echo(output)
def putBlock(self, blockcontent, migration=False): """ Insert the data in sereral steps and commit when each step finishes or rollback if there is a problem. """ #YG try: #1 insert configuration self.logger.debug("insert configuration") configL...
def insertOutputModuleConfig(self, remoteConfig, migration=False): """ Insert Release version, application, parameter set hashes and the map(output module config). """ otptIdList = [] missingList = [] conn = self.dbi.connection() try: for c in remoteC...
def insertDataset(self, blockcontent, otptIdList, migration=False): """ This method insert a datsset from a block object into dbs. """ dataset = blockcontent['dataset'] conn = self.dbi.connection() # First, check and see if the dataset exists. try: da...
def insertDatasetWOannex(self, dataset, blockcontent, otptIdList, conn, insertDataset = True, migration = False): """ _insertDatasetOnly_ Insert the dataset and only the dataset Meant to be called after everything else is put into place. The insertD...
def listSites(self, block_name="", site_name=""): """ Returns sites. """ try: conn = self.dbi.connection() if block_name: result = self.blksitelist.execute(conn, block_name) else: result = self.sitelist.execute(conn, sit...
def insertSite(self, businput): """ Input dictionary has to have the following keys: site_name it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = conn.begin() try: siteobj = { # FIXME: un...
def _create_das_mapping(self): """ das_map = {'lookup' : [{params : {'param1' : 'required', 'param2' : 'optional', 'param3' : 'default_value' ...}, url : 'https://cmsweb.cern.ch:8443/dbs/prod/global/DBSReader/acquisitioneras/', das_map : {'...
def slicedIterator(sourceList, sliceSize): """ :param: sourceList: list which need to be sliced :type: list :param: sliceSize: size of the slice :type: int :return: iterator of the sliced list """ start = 0 end = 0 while len(sourceList) > end: end = start + sliceSize ...
def checkInputParameter(method, parameters, validParameters, requiredParameters=None): """ Helper function to check input by using before sending to the server :param method: Name of the API :type method: str :param validParameters: Allow parameters for the API call :type validParameters: list ...
def list_parameter_splitting(data, key, size_limit=8000, method='GET'): """ Helper function split list used as input parameter for requests, since Apache has a limitation to 8190 Bytes for the lenght of an URI. We extended it to also split lfn and dataset list length for POST calls to avoid DB abuse...
def split_calls(func): """ Decorator to split up server calls for methods using url parameters, due to the lenght limitation of the URI in Apache. By default 8190 bytes """ def wrapper(*args, **kwargs): #The size limit is 8190 bytes minus url and api to call #For example (https://cms...
def __callServer(self, method="", params={}, data={}, callmethod='GET', content='application/json'): """ A private method to make HTTP call to the DBS Server :param method: REST API to call, e.g. 'datasets, blocks, files, ...'. :type method: str :param params: Parameters to the ...
def __parseForException(self, http_error): """ An internal method, should not be used by clients :param httperror: Thrown httperror by the server """ data = http_error.body try: if isinstance(data, str): data = cjson.decode(data) excep...
def requestTimingInfo(self): """ Returns the time needed to process the request by the frontend server in microseconds and the EPOC timestamp of the request in microseconds. :rtype: tuple containing processing time and timestamp """ try: return tuple(item.spl...
def insertBulkBlock(self, blockDump): """ API to insert a bulk block :param blockDump: Output of the block dump command, example can be found in https://svnweb.cern.ch/trac/CMSDMWM/browser/DBS/trunk/Client/tests/dbsclient_t/unittests/blockdump.dict :type blockDump: dict """ ...
def insertFiles(self, filesList, qInserts=False): """ API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request. :param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minut...
def listFileParentsByLumi(self, **kwargs): """ API to list file parents using lumi section info. :param block_name: name of block that has files who's parents needs to be found (Required) :type block_name: str :param logical_file_name: if not all the file parentages under the bl...
def listBlockParents(self, **kwargs): """ API to list block parents. :param block_name: name of block who's parents needs to be found (Required) :type block_name: str :returns: List of dictionaries containing following keys (block_name) :rtype: list of dicts ...
def listBlocks(self, **kwargs): """ API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and the difference in time have to be less tha...
def listDatasets(self, **kwargs): """ API to list dataset(s) in DBS * You can use ANY combination of these parameters in this API * In absence of parameters, all valid datasets known to the DBS instance will be returned :param dataset: Full dataset (path) of the dataset ...
def listDatasetArray(self, **kwargs): """ API to list datasets in DBS. :param dataset: list of datasets [dataset1,dataset2,..,dataset n] (Required if dataset_id is not presented), Max length 1000. :type dataset: list :param dataset_id: list of dataset_ids that are the primary ke...
def listFileArray(self, **kwargs): """ API to list files in DBS. Non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required. The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported...
def listPrimaryDSTypes(self, **kwargs): """ API to list primary dataset types :param primary_ds_type: List that primary dataset type (Optional) :type primary_ds_type: str :param dataset: List the primary dataset type for that dataset (Optional) :type dataset: str ...
def listRuns(self, **kwargs): """ API to list all run dictionary, for example: [{'run_num': [160578, 160498, 160447, 160379]}]. At least one parameter is mandatory. :param logical_file_name: List all runs in the file :type logical_file_name: str :param block_name: List ...
def updateAcqEraEndDate(self, **kwargs): """ API to update the end_date of an acquisition era :param acquisition_era_name: acquisition_era_name to update (Required) :type acquisition_era_name: str :param end_date: end_date not zero (Required) :type end_date: int ...
def execute(self, conn, logical_file_name='', block_name='', run_num=-1, validFileOnly=0, migration=False): """ Lists lumi section numbers with in a file, a list of files or a block. """ sql = "" wheresql = "" lfn_generator = "" run_generator = "" if logical_file_name and not isinsta...
def execute(self, conn, child_block_name='', child_lfn_list=[], transaction=False): sql = '' binds = {} child_ds_name = '' child_where = '' if child_block_name: child_ds_name = child_block_name.split('#')[0] parent_where = " where d.dataset = :child_ds_nam...
def execute(self, conn, run_num=-1, logical_file_name="", block_name="", dataset="", trans=False): """ Lists all primary datasets if pattern is not provided. """ sql = self.sql binds = {} if logical_file_name and "%" not in logical_file_name: sql += """ inner join %sFILES F...
def find_devices(): """Return a list of dictionaries. Each dictionary represents one device. The dictionary contains the following keys: port, unique_id and in_use. `port` can be used with :func:`open`. `serial_number` is the serial number of the device (and can also be used with :func:`open`) and `in_...
def open(port=None, serial_number=None): """Open an aardvark device and return an :class:`Aardvark` object. If the device cannot be opened an :class:`IOError` is raised. The `port` can be retrieved by :func:`find_devices`. Usually, the first device is 0, the second 1, etc. If you are using only on...
def enable_i2c(self): """Set this to `True` to enable the hardware I2C interface. If set to `False` the hardware interface will be disabled and its pins (SDA and SCL) can be used as GPIOs. """ config = self._interface_configuration(CONFIG_QUERY) return config == CONFIG_GP...
def enable_spi(self): """Set this to `True` to enable the hardware SPI interface. If set to `False` the hardware interface will be disabled and its pins (MISO, MOSI, SCK and SS) can be used as GPIOs. """ config = self._interface_configuration(CONFIG_QUERY) return config =...
def i2c_bitrate(self): """I2C bitrate in kHz. Not every bitrate is supported by the host adapter. Therefore, the actual bitrate may be less than the value which is set. The power-on default value is 100 kHz. """ ret = api.py_aa_i2c_bitrate(self.handle, 0) _raise...
def i2c_pullups(self): """Setting this to `True` will enable the I2C pullup resistors. If set to `False` the pullup resistors will be disabled. Raises an :exc:`IOError` if the hardware adapter does not support pullup resistors. """ ret = api.py_aa_i2c_pullup(self.handle,...
def target_power(self): """Setting this to `True` will activate the power pins (4 and 6). If set to `False` the power will be deactivated. Raises an :exc:`IOError` if the hardware adapter does not support the switchable power pins. """ ret = api.py_aa_target_power(self.h...
def i2c_bus_timeout(self): """I2C bus lock timeout in ms. Minimum value is 10 ms and the maximum value is 450 ms. Not every value can be set and will be rounded to the next possible number. You can read back the property to get the actual value. The power-on default value is 20...
def i2c_master_write(self, i2c_address, data, flags=I2C_NO_FLAGS): """Make an I2C write access. The given I2C device is addressed and data given as a string is written. The transaction is finished with an I2C stop condition unless I2C_NO_STOP is set in the flags. 10 bit address...
def i2c_master_read(self, addr, length, flags=I2C_NO_FLAGS): """Make an I2C read access. The given I2C device is addressed and clock cycles for `length` bytes are generated. A short read will occur if the device generates an early NAK. The transaction is finished with an I2C st...