def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("WMStats entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("WMStats REST hub configuration subset:\n%s" % config) # only allows json format for return value self.formats = [('application/json', JSONFormat())] self._add({ "info": ServerInfo(app, self, config, mount), "teams": TeamInfo(app, self, config, mount), "request": RequestInfo(app, self, config, mount), "isfinished": FinishedStatusInfo(app, self, config, mount), "jobdetail": JobDetailInfo(app, self, config, mount), "requestcache": ActiveRequestJobInfo(app, self, config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("ReqMgr entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("ReqMgr REST hub configuration subset:\n%s" % config) self.db_handler = ReqMgrCouch(config) # Makes raw format as default #self.formats.insert(0, ('application/raw', RawFormat())) self._add({"hello": HelloWorld(self, app, config, mount), "about": Info(app, self, config, mount), "info": Info(app, self, config, mount), "request": Request(app, self, config, mount), "group": Group(app, self, config, mount), "team": Team(app, self, config, mount), "software": Software(app, self, config, mount), "status": RequestStatus(app, self, config, mount), "type": RequestType(app, self, config, mount), "spec_template": RequestSpec(self, app, config, mount), "wmstats_info":WMStatsInfo(self, app, config, mount) })
def __init__(self, app, config, mount): RESTApi.__init__(self, app, config, mount) print("AMR mounting RESTApi app: %s, config: %s, mount: %s" % (app, config, mount)) tasks = [Task() for _ in range(0, 10)] self._add({"status": Status(app, self, config, mount, tasks)}) print("AMR done mounting the 'status' API")
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("ReqMgr entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("ReqMgr REST hub configuration subset:\n%s" % config) self.db_handler = ReqMgrCouch(config) # Makes raw format as default #self.formats.insert(0, ('application/raw', RawFormat())) self._add({"about": Info(app, self, config, mount), "info": Info(app, self, config, mount), "request": Request(app, self, config, mount), "group": Group(app, self, config, mount), "team": Team(app, self, config, mount), "software": Software(app, self, config, mount), "status": RequestStatus(app, self, config, mount), "type": RequestType(app, self, config, mount), "spec_template": RequestSpec(self, app, config, mount), "workload_config": WorkloadConfig(self, app, config, mount), "splitting": WorkloadSplitting(self, app, config, mount), "wmstats_info":WMStatsInfo(self, app, config, mount) })
def __init__(self, app, config, mount): RESTApi.__init__(self, app, config, mount) self._add({ "simple": Simple(app, self, config, mount), "image": Image(app, self, config, mount), "multi": Multi(app, self, config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("ReqMgr entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("ReqMgr REST hub configuration subset:\n%s" % config) # Makes raw format as default # self.formats.insert(0, ('application/raw', RawFormat())) self._add({"about": Info(app, IndividualCouchManager(config), config, mount), "info": Info(app, IndividualCouchManager(config), config, mount), "app_config": ReqMgrConfigData(app, IndividualCouchManager(config), config, mount), "request": Request(app, IndividualCouchManager(config), config, mount), "cmsswversions": CMSSWVersions(app, IndividualCouchManager(config), config, mount), "wmagentconfig": WMAgentConfig(app, IndividualCouchManager(config), config, mount), "permissions": PermissionsConfig(app, IndividualCouchManager(config), config, mount), "campaignconfig": WMAgentConfig(app, IndividualCouchManager(config), config, mount), "unifiedconfig": UnifiedConfig(app, IndividualCouchManager(config), config, mount), "status": RequestStatus(app, IndividualCouchManager(config), config, mount), "type": RequestType(app, IndividualCouchManager(config), config, mount), "spec_template": RequestSpec(app, IndividualCouchManager(config), config, mount), "workload_config": WorkloadConfig(app, IndividualCouchManager(config), config, mount), "splitting": WorkloadSplitting(app, IndividualCouchManager(config), config, mount), "wmstats_info": WMStatsInfo(app, IndividualCouchManager(config), config, mount), "proc_status": ProcessMatrix(app, self, config, mount) })
def __init__(self, app, config, mount): RESTApi.__init__(self, app, config, mount) self._add( { "simple": Simple(app, self, config, mount), "image": Image(app, self, config, mount), "multi": Multi(app, self, config, mount), } )
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("ReqMgr entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("ReqMgr REST hub configuration subset:\n%s" % config) # Makes raw format as default # self.formats.insert(0, ('application/raw', RawFormat())) self._add({ "about": Info(app, IndividualCouchManager(config), config, mount), "info": Info(app, IndividualCouchManager(config), config, mount), "app_config": ReqMgrConfigData(app, IndividualCouchManager(config), config, mount), "request": Request(app, IndividualCouchManager(config), config, mount), "cmsswversions": CMSSWVersions(app, IndividualCouchManager(config), config, mount), "wmagentconfig": WMAgentConfig(app, IndividualCouchManager(config), config, mount), "permissions": PermissionsConfig(app, IndividualCouchManager(config), config, mount), "campaignconfig": CampaignConfig(app, IndividualCouchManager(config), config, mount), "unifiedconfig": UnifiedConfig(app, IndividualCouchManager(config), config, mount), "transferinfo": TransferInfo(app, IndividualCouchManager(config), config, mount), "status": RequestStatus(app, IndividualCouchManager(config), config, mount), "type": RequestType(app, IndividualCouchManager(config), config, mount), "spec_template": RequestSpec(app, IndividualCouchManager(config), config, mount), "workload_config": WorkloadConfig(app, IndividualCouchManager(config), config, mount), "splitting": WorkloadSplitting(app, IndividualCouchManager(config), config, mount), "wmstats_info": WMStatsInfo(app, IndividualCouchManager(config), config, mount), "proc_status": ProcessMatrix(app, self, config, mount), "parentlocks": ParentLocks(app, IndividualCouchManager(config), config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("MicroService entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("MicroService REST configuration subset:\n%s" % config) self._add({"data": Data(app, self, config, mount)})
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("WMArchive entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("WMArchive REST configuration subset:\n%s" % config) self._add({"data": WMAData(app, self, config, mount)})
def __init__(self, app, config, mount): RESTApi.__init__(self, app, config, mount) self.formats = [ ('application/json', JSONFormat()) ] if not os.path.exists(config.cachedir) or not os.path.isdir(config.cachedir): raise Exception("Failing to start because of wrong cache directory '%s'" % config.cachedir) if hasattr(config, 'powerusers'): UserFileCache.RESTExtensions.POWER_USERS_LIST = config.powerusers if hasattr(config, 'quota_user_limit'): UserFileCache.RESTExtensions.QUOTA_USER_LIMIT = config.quota_user_limit * 1024 * 1024 self._add( {'logfile': RESTLogFile(app, self, config, mount), 'file': RESTFile(app, self, config, mount), 'info': RESTInfo(app, self, config, mount)} )
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("WMStats entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("WMStats REST hub configuration subset:\n%s" % config) # only allows json format for return value self.formats = [('application/json', JSONFormat())] self._add({"info": ServerInfo(app, self, config, mount), "request": RequestInfo(app, self, config, mount), "requestcache": ActiveRequestJobInfo(app, self, config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) for k, v in app.appconfig.debug.iteritems(): debug[k] = v if not getattr(app, 'contentproxy', None): app.contentproxy = ContentProxy(app.appconfig) if not getattr(app, 'contentscraper', None): app.contentscraper = ContentScraper(app.appconfig) self.proxy = app.contentproxy self.scraper = app.contentscraper self._add({ "caf": CAFData(app, self, config, mount), "phedex": PhEDEx(app, self, config, mount), "host": HostData(app, self, config, mount), "world-map": WorldMapShape(app, self, config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("ReqMgr entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("ReqMgr REST hub configuration subset:\n%s" % config) # Makes raw format as default # self.formats.insert(0, ('application/raw', RawFormat())) self._add({ "about": Info(app, IndividualCouchManager(config), config, mount), "info": Info(app, IndividualCouchManager(config), config, mount), "app_config": ReqMgrConfigData(app, IndividualCouchManager(config), config, mount), "request": Request(app, IndividualCouchManager(config), config, mount), "software": Software(app, IndividualCouchManager(config), config, mount), "status": RequestStatus(app, IndividualCouchManager(config), config, mount), "type": RequestType(app, IndividualCouchManager(config), config, mount), "spec_template": RequestSpec(IndividualCouchManager(config), app, config, mount), "workload_config": WorkloadConfig(IndividualCouchManager(config), app, config, mount), "splitting": WorkloadSplitting(IndividualCouchManager(config), app, config, mount), "wmstats_info": WMStatsInfo(IndividualCouchManager(config), app, config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("WMStats entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("WMStats REST hub configuration subset:\n%s" % config) # only allows json format for return value self.formats = [('application/json', JSONFormat())] self._add({ "info": ServerInfo(app, self, config, mount), "teams": TeamInfo(app, self, config, mount), "request": RequestInfo(app, self, config, mount), "isfinished": FinishedStatusInfo(app, self, config, mount), "jobdetail": JobDetailInfo(app, self, config, mount), "requestcache": ActiveRequestJobInfo(app, self, config, mount), "filtered_requests": FilteredActiveRequestJobInfo(app, self, config, mount), "protectedlfns": ProtectedLFNList(app, self, config, mount), "protectedlfns_final": ProtectedLFNListOnlyFinalOutput(app, self, config, mount), "globallocks": GlobalLockList(app, self, config, mount), "parentlocks": ParentLockList(app, self, config, mount), "proc_status": ProcessMatrix(app, self, config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("ReqMgr entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("ReqMgr REST hub configuration subset:\n%s" % config) db_handler = ReqMgrCouch(config) # Makes raw format as default #self.formats.insert(0, ('application/raw', RawFormat())) self._add({"hello": HelloWorld(self, app, config, mount), "about": Info(app, self, config, mount, db_handler), "info": Info(app, self, config, mount, db_handler), "request": Request(app, self, config, mount, db_handler), "group": Group(app, self, config, mount, db_handler), "team": Team(app, self, config, mount, db_handler), "sw": Software(app, self, config, mount, db_handler), })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" RESTApi.__init__(self, app, config, mount) cherrypy.log("WMStats entire configuration:\n%s" % Configuration.getInstance()) cherrypy.log("WMStats REST hub configuration subset:\n%s" % config) # only allows json format for return value self.formats = [('application/json', JSONFormat())] self._add({"info": ServerInfo(app, self, config, mount), "teams": TeamInfo(app, self, config, mount), "request": RequestInfo(app, self, config, mount), "isfinished": FinishedStatusInfo(app, self, config, mount), "jobdetail": JobDetailInfo(app, self, config, mount), "requestcache": ActiveRequestJobInfo(app, self, config, mount), "filtered_requests": FilteredActiveRequestJobInfo(app, self, config, mount), "protectedlfns": ProtectedLFNList(app, self, config, mount), "protectedlfns_final": ProtectedLFNListOnlyFinalOutput(app, self, config, mount), "globallocks": GlobalLockList(app, self, config, mount) })
def __init__(self, app, config, mount): """ :arg app: reference to application object; passed to all entities. :arg config: reference to configuration; passed to all entities. :arg str mount: API URL mount point; passed to all entities.""" CONTENT = os.path.abspath(__file__).rsplit('/', 5)[0] X = (__file__.find("/xlib/") >= 0 and "x") or "" RESTApi.__init__(self, app, config, mount) self.missing = open("%s/%sdata/web/missing.png" % (CONTENT, X)).read() self.formats = [("image/png", RawFormat())] if not getattr(app, 'contentproxy', None): app.contentproxy = ContentProxy(app.appconfig) if not getattr(app, 'imagescraper', None): app.imagescraper = ImageScraper(app.appconfig) self.proxy = app.contentproxy self.scraper = app.imagescraper self._add({ "eoscms": EOSImage(app, self, config, mount), "c2cms": C2CMSImage(app, self, config, mount), "ddt": DDTImage(app, self, config, mount), "lxbatch": LXBatchImage(app, self, config, mount), "job-queue": JobQueueImage(app, self, config, mount), "world-map": WorldMapTile(app, self, config, mount) })
from WMCore.REST.Server import RESTFrontPage from WMCore.REST.Server import MiniRESTApi from WMCore.REST.Server import RESTApi from WMCore.REST.Server import DBConnectionPool from WMCore.REST.Server import DatabaseRESTApi from WMCore.REST.Server import RESTEntity import os, threading srcfile = os.path.abspath(__file__).rsplit("/", 1)[-1].split(".")[0] dbspec = {} class FakeApp: appname = "app" class FakeConf: db = srcfile + ".dbspec" RESTFrontPage(None, None, "/", "/dev/null", {}) MiniRESTApi(FakeApp(), None, "/") RESTApi(FakeApp(), None, "/") DBConnectionPool("x", {}) if threading.current_thread().name == "MainThread": DatabaseRESTApi(FakeApp(), FakeConf(), "/") RESTEntity(FakeApp(), None, None, "/")
def __init__(self, app, config, mount): RESTApi.__init__(self, app, config, mount) tasks = [Task() for _ in xrange(0, 10)] self._add({ "status": Status(app, self, config, mount, tasks) })
def __init__(self, app, config, mount): RESTApi.__init__(self, app, config, mount) tasks = [Task() for _ in xrange(0, 10)] self._add({"status": Status(app, self, config, mount, tasks)})