示例#1
0
    def __init__(self, config):

        """
        All parameters are provided through DBSConfig module
        """

        DBSReaderModel.__init__(self, config)

        self.addMethod('POST', 'primarydatasets', self.insertPrimaryDataset)
        self.addMethod('POST', 'outputconfigs', self.insertOutputConfig)
	self.addMethod('POST', 'acquisitioneras', self.insertAcquisitionEra)
	self.addMethod('POST', 'processingeras', self.insertProcessingEra)
        self.addMethod('POST', 'datasets', self.insertDataset)
        self.addMethod('POST', 'sites', self.insertSite)
        self.addMethod('POST', 'blocks', self.insertBlock)
        self.addMethod('POST', 'files', self.insertFile)
	self.addMethod('PUT', 'files', self.updateFile)
	self.addMethod('PUT', 'datasets', self.updateDataset)
	self.addMethod('PUT', 'blocks', self.updateBlock)
	self.addMethod('POST', 'datatiers', self.insertDataTier)

#self.dbsFileBuffer = DBSFileBuffer(self.logger, self.dbi, config.dbowner)
    
	#following chunk can be removed at a later point, when we are satisfied with the alternate/wmcore-component
	"""
示例#2
0
    def __init__(self, config):
        """
        All parameters are provided through DBSConfig module
        """

        #Dictionary with reader and writer as keys
        urls = config.database.connectUrl

        #instantiate the page with the writer_config

        if isinstance(urls, type({})):
            config.database.connectUrl = urls['writer']

        DBSReaderModel.__init__(self, config)

        self.sequenceManagerDAO = self.daofactory(classname="SequenceManager")
        self.dbsDataTierInsertDAO = self.daofactory(classname="DataTier.Insert")

        self._addMethod('POST', 'primarydatasets', self.insertPrimaryDataset, secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'outputconfigs', self.insertOutputConfig,  secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'acquisitioneras', self.insertAcquisitionEra, secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('PUT', 'acquisitioneras', self.updateAcqEraEndDate, args=['acquisition_era_name', 'end_date'],
                         secured=True, security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'processingeras', self.insertProcessingEra, secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'datasets', self.insertDataset, secured=True,
                        security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'blocks', self.insertBlock, secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'files', self.insertFile, args=['qInserts'], secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('PUT', 'files', self.updateFile, args=['logical_file_name', 'is_file_valid', 'lost', 'dataset'],
                         secured=True, security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('PUT', 'datasets', self.updateDataset, args=['dataset', 'dataset_access_type'],
                         secured=True, security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('PUT', 'blocks', self.updateBlock, args=['block_name', 'open_for_writing', 'origin_site_name'],
                         secured=True, security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'datatiers', self.insertDataTier, secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'bulkblocks', self.insertBulkBlock, secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
        self._addMethod('POST', 'fileparents', self.insertFileParents, secured=True,
                         security_params={'role':self.security_params, 'authzfunc':authInsert})
示例#3
0
    def __init__(self, config):
        """
        All parameters are provided through DBSConfig module
        """

        #Dictionary with reader and writer as keys
        urls = config.database.connectUrl

        #instantiate the page with the writer_config

        if isinstance(urls, type({})):
            config.database.connectUrl = urls['writer']

        DBSReaderModel.__init__(self, config)

        self.sequenceManagerDAO = self.daofactory(classname="SequenceManager")
        self.dbsDataTierInsertDAO = self.daofactory(
            classname="DataTier.Insert")

        self._addMethod('POST',
                        'primarydatasets',
                        self.insertPrimaryDataset,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('POST',
                        'outputconfigs',
                        self.insertOutputConfig,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('POST',
                        'acquisitioneras',
                        self.insertAcquisitionEra,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('PUT',
                        'acquisitioneras',
                        self.updateAcqEraEndDate,
                        args=['acquisition_era_name', 'end_date'],
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('POST',
                        'processingeras',
                        self.insertProcessingEra,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('POST',
                        'datasets',
                        self.insertDataset,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('POST',
                        'blocks',
                        self.insertBlock,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('POST',
                        'files',
                        self.insertFile,
                        args=['qInserts'],
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod(
            'PUT',
            'files',
            self.updateFile,
            args=['logical_file_name', 'is_file_valid', 'lost', 'dataset'],
            secured=True,
            security_params={
                'role': self.security_params,
                'authzfunc': authInsert
            })
        self._addMethod('PUT',
                        'datasets',
                        self.updateDataset,
                        args=['dataset', 'dataset_access_type'],
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod(
            'PUT',
            'blocks',
            self.updateBlock,
            args=['block_name', 'open_for_writing', 'origin_site_name'],
            secured=True,
            security_params={
                'role': self.security_params,
                'authzfunc': authInsert
            })
        self._addMethod('POST',
                        'datatiers',
                        self.insertDataTier,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
        self._addMethod('POST',
                        'bulkblocks',
                        self.insertBulkBlock,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        })
示例#4
0
    def __init__(self, config):
        """
        All parameters are provided through DBSConfig module
        """

        #Dictionary with reader and writer as keys
        urls = config.database.connectUrl

        #instantiate the page with the writer_config

        if isinstance(urls, type({})):
            config.database.connectUrl = urls['writer']

        DBSReaderModel.__init__(self, config)

        # set proper logger name
        self.logger.name = __name__

        # initialize NATS if requested
        self.nats = None
        if hasattr(config, 'use_nats') and config.use_nats:
            topic = 'cms.dbs'
            topics = config.nats_topics
            if not topics:
                topics = ['%s.topic' % topic]
            self.nats = NATSManager(config.nats_server,
                                    topics=topics,
                                    default_topic=topic)
            msg = "DBS NATS: %s" % self.nats
            self.logger.info(msg)

        self.sequenceManagerDAO = self.daofactory(classname="SequenceManager")
        self.dbsDataTierInsertDAO = self.daofactory(
            classname="DataTier.Insert")

        self._addMethod('POST',
                        'primarydatasets',
                        self.insertPrimaryDataset,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'outputconfigs',
                        self.insertOutputConfig,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'acquisitioneras',
                        self.insertAcquisitionEra,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('PUT',
                        'acquisitioneras',
                        self.updateAcqEraEndDate,
                        args=['acquisition_era_name', 'end_date'],
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'processingeras',
                        self.insertProcessingEra,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'datasets',
                        self.insertDataset,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'blocks',
                        self.insertBlock,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'files',
                        self.insertFile,
                        args=['qInserts'],
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod(
            'PUT',
            'files',
            self.updateFile,
            args=['logical_file_name', 'is_file_valid', 'lost', 'dataset'],
            secured=True,
            security_params={
                'role': self.security_params,
                'authzfunc': authInsert
            },
            dump_request_info=True)
        self._addMethod('PUT',
                        'datasets',
                        self.updateDataset,
                        args=['dataset', 'dataset_access_type'],
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod(
            'PUT',
            'blocks',
            self.updateBlock,
            args=['block_name', 'open_for_writing', 'origin_site_name'],
            secured=True,
            security_params={
                'role': self.security_params,
                'authzfunc': authInsert
            },
            dump_request_info=True)
        self._addMethod('POST',
                        'datatiers',
                        self.insertDataTier,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'bulkblocks',
                        self.insertBulkBlock,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)
        self._addMethod('POST',
                        'fileparents',
                        self.insertFileParents,
                        secured=True,
                        security_params={
                            'role': self.security_params,
                            'authzfunc': authInsert
                        },
                        dump_request_info=True)