wmglobalqueue 2.4.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Utils/CPMetrics.py +270 -0
- Utils/CertTools.py +100 -0
- Utils/EmailAlert.py +50 -0
- Utils/ExtendedUnitTestCase.py +62 -0
- Utils/FileTools.py +182 -0
- Utils/IteratorTools.py +80 -0
- Utils/MathUtils.py +31 -0
- Utils/MemoryCache.py +119 -0
- Utils/Patterns.py +24 -0
- Utils/Pipeline.py +137 -0
- Utils/PortForward.py +97 -0
- Utils/ProcFS.py +112 -0
- Utils/ProcessStats.py +194 -0
- Utils/PythonVersion.py +17 -0
- Utils/Signals.py +36 -0
- Utils/TemporaryEnvironment.py +27 -0
- Utils/Throttled.py +227 -0
- Utils/Timers.py +130 -0
- Utils/Timestamps.py +86 -0
- Utils/TokenManager.py +143 -0
- Utils/Tracing.py +60 -0
- Utils/TwPrint.py +98 -0
- Utils/Utilities.py +318 -0
- Utils/__init__.py +11 -0
- Utils/wmcoreDTools.py +707 -0
- WMCore/ACDC/Collection.py +57 -0
- WMCore/ACDC/CollectionTypes.py +12 -0
- WMCore/ACDC/CouchCollection.py +67 -0
- WMCore/ACDC/CouchFileset.py +238 -0
- WMCore/ACDC/CouchService.py +73 -0
- WMCore/ACDC/DataCollectionService.py +485 -0
- WMCore/ACDC/Fileset.py +94 -0
- WMCore/ACDC/__init__.py +11 -0
- WMCore/Algorithms/Alarm.py +39 -0
- WMCore/Algorithms/MathAlgos.py +274 -0
- WMCore/Algorithms/MiscAlgos.py +67 -0
- WMCore/Algorithms/ParseXMLFile.py +115 -0
- WMCore/Algorithms/Permissions.py +27 -0
- WMCore/Algorithms/Singleton.py +58 -0
- WMCore/Algorithms/SubprocessAlgos.py +129 -0
- WMCore/Algorithms/__init__.py +7 -0
- WMCore/Cache/GenericDataCache.py +98 -0
- WMCore/Cache/WMConfigCache.py +572 -0
- WMCore/Cache/__init__.py +0 -0
- WMCore/Configuration.py +659 -0
- WMCore/DAOFactory.py +47 -0
- WMCore/DataStructs/File.py +177 -0
- WMCore/DataStructs/Fileset.py +140 -0
- WMCore/DataStructs/Job.py +182 -0
- WMCore/DataStructs/JobGroup.py +142 -0
- WMCore/DataStructs/JobPackage.py +49 -0
- WMCore/DataStructs/LumiList.py +734 -0
- WMCore/DataStructs/Mask.py +219 -0
- WMCore/DataStructs/MathStructs/ContinuousSummaryHistogram.py +197 -0
- WMCore/DataStructs/MathStructs/DiscreteSummaryHistogram.py +92 -0
- WMCore/DataStructs/MathStructs/SummaryHistogram.py +117 -0
- WMCore/DataStructs/MathStructs/__init__.py +0 -0
- WMCore/DataStructs/Pickleable.py +24 -0
- WMCore/DataStructs/Run.py +256 -0
- WMCore/DataStructs/Subscription.py +175 -0
- WMCore/DataStructs/WMObject.py +47 -0
- WMCore/DataStructs/WorkUnit.py +112 -0
- WMCore/DataStructs/Workflow.py +60 -0
- WMCore/DataStructs/__init__.py +8 -0
- WMCore/Database/CMSCouch.py +1430 -0
- WMCore/Database/ConfigDBMap.py +29 -0
- WMCore/Database/CouchMonitoring.py +450 -0
- WMCore/Database/CouchUtils.py +118 -0
- WMCore/Database/DBCore.py +198 -0
- WMCore/Database/DBCreator.py +113 -0
- WMCore/Database/DBExceptionHandler.py +59 -0
- WMCore/Database/DBFactory.py +117 -0
- WMCore/Database/DBFormatter.py +177 -0
- WMCore/Database/Dialects.py +13 -0
- WMCore/Database/ExecuteDAO.py +327 -0
- WMCore/Database/MongoDB.py +241 -0
- WMCore/Database/MySQL/Destroy.py +42 -0
- WMCore/Database/MySQL/ListUserContent.py +20 -0
- WMCore/Database/MySQL/__init__.py +9 -0
- WMCore/Database/MySQLCore.py +132 -0
- WMCore/Database/Oracle/Destroy.py +56 -0
- WMCore/Database/Oracle/ListUserContent.py +19 -0
- WMCore/Database/Oracle/__init__.py +9 -0
- WMCore/Database/ResultSet.py +44 -0
- WMCore/Database/Transaction.py +91 -0
- WMCore/Database/__init__.py +9 -0
- WMCore/Database/ipy_profile_couch.py +438 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/CleanUpTask.py +29 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/HeartbeatMonitor.py +105 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/LocationUpdateTask.py +28 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/ReqMgrInteractionTask.py +35 -0
- WMCore/GlobalWorkQueue/CherryPyThreads/__init__.py +0 -0
- WMCore/GlobalWorkQueue/__init__.py +0 -0
- WMCore/GroupUser/CouchObject.py +127 -0
- WMCore/GroupUser/Decorators.py +51 -0
- WMCore/GroupUser/Group.py +33 -0
- WMCore/GroupUser/Interface.py +73 -0
- WMCore/GroupUser/User.py +96 -0
- WMCore/GroupUser/__init__.py +11 -0
- WMCore/Lexicon.py +836 -0
- WMCore/REST/Auth.py +202 -0
- WMCore/REST/CherryPyPeriodicTask.py +166 -0
- WMCore/REST/Error.py +333 -0
- WMCore/REST/Format.py +642 -0
- WMCore/REST/HeartbeatMonitorBase.py +90 -0
- WMCore/REST/Main.py +636 -0
- WMCore/REST/Server.py +2435 -0
- WMCore/REST/Services.py +24 -0
- WMCore/REST/Test.py +120 -0
- WMCore/REST/Tools.py +38 -0
- WMCore/REST/Validation.py +250 -0
- WMCore/REST/__init__.py +1 -0
- WMCore/ReqMgr/DataStructs/RequestStatus.py +209 -0
- WMCore/ReqMgr/DataStructs/RequestType.py +13 -0
- WMCore/ReqMgr/DataStructs/__init__.py +0 -0
- WMCore/ReqMgr/__init__.py +1 -0
- WMCore/Services/AlertManager/AlertManagerAPI.py +111 -0
- WMCore/Services/AlertManager/__init__.py +0 -0
- WMCore/Services/CRIC/CRIC.py +238 -0
- WMCore/Services/CRIC/__init__.py +0 -0
- WMCore/Services/DBS/DBS3Reader.py +1044 -0
- WMCore/Services/DBS/DBSConcurrency.py +44 -0
- WMCore/Services/DBS/DBSErrors.py +112 -0
- WMCore/Services/DBS/DBSReader.py +23 -0
- WMCore/Services/DBS/DBSUtils.py +166 -0
- WMCore/Services/DBS/DBSWriterObjects.py +381 -0
- WMCore/Services/DBS/ProdException.py +133 -0
- WMCore/Services/DBS/__init__.py +8 -0
- WMCore/Services/FWJRDB/FWJRDBAPI.py +118 -0
- WMCore/Services/FWJRDB/__init__.py +0 -0
- WMCore/Services/HTTPS/HTTPSAuthHandler.py +66 -0
- WMCore/Services/HTTPS/__init__.py +0 -0
- WMCore/Services/LogDB/LogDB.py +201 -0
- WMCore/Services/LogDB/LogDBBackend.py +191 -0
- WMCore/Services/LogDB/LogDBExceptions.py +11 -0
- WMCore/Services/LogDB/LogDBReport.py +85 -0
- WMCore/Services/LogDB/__init__.py +0 -0
- WMCore/Services/MSPileup/__init__.py +0 -0
- WMCore/Services/MSUtils/MSUtils.py +54 -0
- WMCore/Services/MSUtils/__init__.py +0 -0
- WMCore/Services/McM/McM.py +173 -0
- WMCore/Services/McM/__init__.py +8 -0
- WMCore/Services/MonIT/Grafana.py +133 -0
- WMCore/Services/MonIT/__init__.py +0 -0
- WMCore/Services/PyCondor/PyCondorAPI.py +154 -0
- WMCore/Services/PyCondor/__init__.py +0 -0
- WMCore/Services/ReqMgr/ReqMgr.py +261 -0
- WMCore/Services/ReqMgr/__init__.py +0 -0
- WMCore/Services/ReqMgrAux/ReqMgrAux.py +419 -0
- WMCore/Services/ReqMgrAux/__init__.py +0 -0
- WMCore/Services/RequestDB/RequestDBReader.py +267 -0
- WMCore/Services/RequestDB/RequestDBWriter.py +39 -0
- WMCore/Services/RequestDB/__init__.py +0 -0
- WMCore/Services/Requests.py +624 -0
- WMCore/Services/Rucio/Rucio.py +1290 -0
- WMCore/Services/Rucio/RucioUtils.py +74 -0
- WMCore/Services/Rucio/__init__.py +0 -0
- WMCore/Services/RucioConMon/RucioConMon.py +121 -0
- WMCore/Services/RucioConMon/__init__.py +0 -0
- WMCore/Services/Service.py +400 -0
- WMCore/Services/StompAMQ/__init__.py +0 -0
- WMCore/Services/TagCollector/TagCollector.py +155 -0
- WMCore/Services/TagCollector/XMLUtils.py +98 -0
- WMCore/Services/TagCollector/__init__.py +0 -0
- WMCore/Services/UUIDLib.py +13 -0
- WMCore/Services/UserFileCache/UserFileCache.py +160 -0
- WMCore/Services/UserFileCache/__init__.py +8 -0
- WMCore/Services/WMAgent/WMAgent.py +63 -0
- WMCore/Services/WMAgent/__init__.py +0 -0
- WMCore/Services/WMArchive/CMSSWMetrics.py +526 -0
- WMCore/Services/WMArchive/DataMap.py +463 -0
- WMCore/Services/WMArchive/WMArchive.py +33 -0
- WMCore/Services/WMArchive/__init__.py +0 -0
- WMCore/Services/WMBS/WMBS.py +97 -0
- WMCore/Services/WMBS/__init__.py +0 -0
- WMCore/Services/WMStats/DataStruct/RequestInfoCollection.py +300 -0
- WMCore/Services/WMStats/DataStruct/__init__.py +0 -0
- WMCore/Services/WMStats/WMStatsPycurl.py +145 -0
- WMCore/Services/WMStats/WMStatsReader.py +445 -0
- WMCore/Services/WMStats/WMStatsWriter.py +273 -0
- WMCore/Services/WMStats/__init__.py +0 -0
- WMCore/Services/WMStatsServer/WMStatsServer.py +134 -0
- WMCore/Services/WMStatsServer/__init__.py +0 -0
- WMCore/Services/WorkQueue/WorkQueue.py +492 -0
- WMCore/Services/WorkQueue/__init__.py +0 -0
- WMCore/Services/__init__.py +8 -0
- WMCore/Services/pycurl_manager.py +574 -0
- WMCore/WMBase.py +50 -0
- WMCore/WMConnectionBase.py +164 -0
- WMCore/WMException.py +183 -0
- WMCore/WMExceptions.py +269 -0
- WMCore/WMFactory.py +76 -0
- WMCore/WMInit.py +377 -0
- WMCore/WMLogging.py +104 -0
- WMCore/WMSpec/ConfigSectionTree.py +442 -0
- WMCore/WMSpec/Persistency.py +135 -0
- WMCore/WMSpec/Steps/BuildMaster.py +87 -0
- WMCore/WMSpec/Steps/BuildTools.py +201 -0
- WMCore/WMSpec/Steps/Builder.py +97 -0
- WMCore/WMSpec/Steps/Diagnostic.py +89 -0
- WMCore/WMSpec/Steps/Emulator.py +62 -0
- WMCore/WMSpec/Steps/ExecuteMaster.py +208 -0
- WMCore/WMSpec/Steps/Executor.py +210 -0
- WMCore/WMSpec/Steps/StepFactory.py +213 -0
- WMCore/WMSpec/Steps/TaskEmulator.py +75 -0
- WMCore/WMSpec/Steps/Template.py +204 -0
- WMCore/WMSpec/Steps/Templates/AlcaHarvest.py +76 -0
- WMCore/WMSpec/Steps/Templates/CMSSW.py +613 -0
- WMCore/WMSpec/Steps/Templates/DQMUpload.py +59 -0
- WMCore/WMSpec/Steps/Templates/DeleteFiles.py +70 -0
- WMCore/WMSpec/Steps/Templates/LogArchive.py +84 -0
- WMCore/WMSpec/Steps/Templates/LogCollect.py +105 -0
- WMCore/WMSpec/Steps/Templates/StageOut.py +105 -0
- WMCore/WMSpec/Steps/Templates/__init__.py +10 -0
- WMCore/WMSpec/Steps/WMExecutionFailure.py +21 -0
- WMCore/WMSpec/Steps/__init__.py +8 -0
- WMCore/WMSpec/Utilities.py +63 -0
- WMCore/WMSpec/WMSpecErrors.py +12 -0
- WMCore/WMSpec/WMStep.py +347 -0
- WMCore/WMSpec/WMTask.py +1997 -0
- WMCore/WMSpec/WMWorkload.py +2288 -0
- WMCore/WMSpec/WMWorkloadTools.py +382 -0
- WMCore/WMSpec/__init__.py +9 -0
- WMCore/WorkQueue/DataLocationMapper.py +273 -0
- WMCore/WorkQueue/DataStructs/ACDCBlock.py +47 -0
- WMCore/WorkQueue/DataStructs/Block.py +48 -0
- WMCore/WorkQueue/DataStructs/CouchWorkQueueElement.py +148 -0
- WMCore/WorkQueue/DataStructs/WorkQueueElement.py +274 -0
- WMCore/WorkQueue/DataStructs/WorkQueueElementResult.py +152 -0
- WMCore/WorkQueue/DataStructs/WorkQueueElementsSummary.py +185 -0
- WMCore/WorkQueue/DataStructs/__init__.py +0 -0
- WMCore/WorkQueue/Policy/End/EndPolicyInterface.py +44 -0
- WMCore/WorkQueue/Policy/End/SingleShot.py +22 -0
- WMCore/WorkQueue/Policy/End/__init__.py +32 -0
- WMCore/WorkQueue/Policy/PolicyInterface.py +17 -0
- WMCore/WorkQueue/Policy/Start/Block.py +258 -0
- WMCore/WorkQueue/Policy/Start/Dataset.py +180 -0
- WMCore/WorkQueue/Policy/Start/MonteCarlo.py +131 -0
- WMCore/WorkQueue/Policy/Start/ResubmitBlock.py +171 -0
- WMCore/WorkQueue/Policy/Start/StartPolicyInterface.py +316 -0
- WMCore/WorkQueue/Policy/Start/__init__.py +34 -0
- WMCore/WorkQueue/Policy/__init__.py +57 -0
- WMCore/WorkQueue/WMBSHelper.py +772 -0
- WMCore/WorkQueue/WorkQueue.py +1237 -0
- WMCore/WorkQueue/WorkQueueBackend.py +750 -0
- WMCore/WorkQueue/WorkQueueBase.py +39 -0
- WMCore/WorkQueue/WorkQueueExceptions.py +44 -0
- WMCore/WorkQueue/WorkQueueReqMgrInterface.py +278 -0
- WMCore/WorkQueue/WorkQueueUtils.py +130 -0
- WMCore/WorkQueue/__init__.py +13 -0
- WMCore/Wrappers/JsonWrapper/JSONThunker.py +342 -0
- WMCore/Wrappers/JsonWrapper/__init__.py +7 -0
- WMCore/Wrappers/__init__.py +6 -0
- WMCore/__init__.py +10 -0
- wmglobalqueue-2.4.5.1.data/data/bin/wmc-dist-patch +15 -0
- wmglobalqueue-2.4.5.1.data/data/bin/wmc-dist-unpatch +8 -0
- wmglobalqueue-2.4.5.1.data/data/bin/wmc-httpd +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/.couchapprc +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/README.md +40 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/index.html +264 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/ElementInfoByWorkflow.js +96 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/StuckElementInfo.js +57 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/WorkloadInfoTable.js +80 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/dataTable.js +70 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/js/namespace.js +23 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/_attachments/style/main.css +75 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/couchapp.json +4 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/childQueueFilter.js +13 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/filterDeletedDocs.js +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/filters/queueFilter.js +11 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/language +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/mustache.js +333 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/validate.js +27 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lib/workqueue_utils.js +61 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/elementsDetail.js +28 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/filter.js +86 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/stuckElements.js +38 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/workRestrictions.js +153 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/lists/workflowSummary.js +28 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/rewrites.json +73 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/shows/redirect.js +23 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/shows/status.js +40 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/ElementSummaryByWorkflow.html +27 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/StuckElementSummary.html +26 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/TaskStatus.html +23 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/WorkflowSummary.html +27 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/workqueue-common-lib.html +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib-remote.html +16 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/templates/partials/yui-lib.html +18 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/updates/in-place.js +50 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/validate_doc_update.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.couch.app.js +235 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/vendor/couchapp/_attachments/jquery.pathbinder.js +173 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeData/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeParentData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activeParentData/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activePileupData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/activePileupData/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/analyticsData/map.js +11 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/analyticsData/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/availableByPriority/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/conflicts/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elements/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByParent/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByParentData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByPileupData/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByStatus/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsBySubscription/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/map.js +8 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsByWorkflow/reduce.js +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/elementsDetailByWorkflowAndStatus/map.js +26 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/map.js +10 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobInjectStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobStatusByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndPriority/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByChildQueueAndStatus/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatus/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatus/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/jobsByStatusAndPriority/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/openRequests/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/recent-items/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/siteWhitelistByRequest/reduce.js +1 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/specsByWorkflow/map.js +5 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/stuckElements/map.js +38 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/map.js +12 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsInjectStatusByRequest/reduce.js +3 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrl/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrl/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/map.js +6 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/wmbsUrlByRequest/reduce.js +2 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/workflowSummary/map.js +9 -0
- wmglobalqueue-2.4.5.1.data/data/data/couchapps/WorkQueue/views/workflowSummary/reduce.js +10 -0
- wmglobalqueue-2.4.5.1.dist-info/METADATA +26 -0
- wmglobalqueue-2.4.5.1.dist-info/RECORD +347 -0
- wmglobalqueue-2.4.5.1.dist-info/WHEEL +5 -0
- wmglobalqueue-2.4.5.1.dist-info/licenses/LICENSE +202 -0
- wmglobalqueue-2.4.5.1.dist-info/licenses/NOTICE +16 -0
- wmglobalqueue-2.4.5.1.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function(doc, req) {
|
|
2
|
+
if (doc._deleted){
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (doc.type && doc.type === "WMCore.WorkQueue.DataStructs.WorkQueueElement.WorkQueueElement"){
|
|
7
|
+
var ele = doc["WMCore.WorkQueue.DataStructs.WorkQueueElement.WorkQueueElement"];
|
|
8
|
+
return (ele['ChildQueueUrl'] === req.query.childUrl && ele['ParentQueueUrl'] === req.query.parentUrl);
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
javascript
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/*
|
|
2
|
+
mustache.js Logic-less templates in JavaScript
|
|
3
|
+
|
|
4
|
+
See http://mustache.github.com/ for more info.
|
|
5
|
+
|
|
6
|
+
https://github.com/janl/mustache.js/
|
|
7
|
+
Copied from above site
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var Mustache = function() {
|
|
11
|
+
var Renderer = function() {};
|
|
12
|
+
|
|
13
|
+
Renderer.prototype = {
|
|
14
|
+
otag: "{{",
|
|
15
|
+
ctag: "}}",
|
|
16
|
+
pragmas: {},
|
|
17
|
+
buffer: [],
|
|
18
|
+
pragmas_implemented: {
|
|
19
|
+
"IMPLICIT-ITERATOR": true
|
|
20
|
+
},
|
|
21
|
+
context: {},
|
|
22
|
+
|
|
23
|
+
render: function(template, context, partials, in_recursion) {
|
|
24
|
+
// reset buffer & set context
|
|
25
|
+
if(!in_recursion) {
|
|
26
|
+
this.context = context;
|
|
27
|
+
this.buffer = []; // TODO: make this non-lazy
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// fail fast
|
|
31
|
+
if(!this.includes("", template)) {
|
|
32
|
+
if(in_recursion) {
|
|
33
|
+
return template;
|
|
34
|
+
} else {
|
|
35
|
+
this.send(template);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
template = this.render_pragmas(template);
|
|
41
|
+
var html = this.render_section(template, context, partials);
|
|
42
|
+
if(in_recursion) {
|
|
43
|
+
return this.render_tags(html, context, partials, in_recursion);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this.render_tags(html, context, partials, in_recursion);
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
Sends parsed lines
|
|
51
|
+
*/
|
|
52
|
+
send: function(line) {
|
|
53
|
+
if(line != "") {
|
|
54
|
+
this.buffer.push(line);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
Looks for %PRAGMAS
|
|
60
|
+
*/
|
|
61
|
+
render_pragmas: function(template) {
|
|
62
|
+
// no pragmas
|
|
63
|
+
if(!this.includes("%", template)) {
|
|
64
|
+
return template;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var that = this;
|
|
68
|
+
var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
|
|
69
|
+
this.ctag);
|
|
70
|
+
return template.replace(regex, function(match, pragma, options) {
|
|
71
|
+
if(!that.pragmas_implemented[pragma]) {
|
|
72
|
+
throw({message:
|
|
73
|
+
"This implementation of mustache doesn't understand the '" +
|
|
74
|
+
pragma + "' pragma"});
|
|
75
|
+
}
|
|
76
|
+
that.pragmas[pragma] = {};
|
|
77
|
+
if(options) {
|
|
78
|
+
var opts = options.split("=");
|
|
79
|
+
that.pragmas[pragma][opts[0]] = opts[1];
|
|
80
|
+
}
|
|
81
|
+
return "";
|
|
82
|
+
// ignore unknown pragmas silently
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
Tries to find a partial in the curent scope and render it
|
|
88
|
+
*/
|
|
89
|
+
render_partial: function(name, context, partials) {
|
|
90
|
+
name = this.trim(name);
|
|
91
|
+
if(!partials || partials[name] === undefined) {
|
|
92
|
+
throw({message: "unknown_partial '" + name + "'"});
|
|
93
|
+
}
|
|
94
|
+
if(typeof(context[name]) != "object") {
|
|
95
|
+
return this.render(partials[name], context, partials, true);
|
|
96
|
+
}
|
|
97
|
+
return this.render(partials[name], context[name], partials, true);
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
/*
|
|
101
|
+
Renders inverted (^) and normal (#) sections
|
|
102
|
+
*/
|
|
103
|
+
render_section: function(template, context, partials) {
|
|
104
|
+
if(!this.includes("#", template) && !this.includes("^", template)) {
|
|
105
|
+
return template;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var that = this;
|
|
109
|
+
// CSW - Added "+?" so it finds the tighest bound, not the widest
|
|
110
|
+
var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
|
|
111
|
+
"\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag +
|
|
112
|
+
"\\s*", "mg");
|
|
113
|
+
|
|
114
|
+
// for each {{#foo}}{{/foo}} section do...
|
|
115
|
+
return template.replace(regex, function(match, type, name, content) {
|
|
116
|
+
var value = that.find(name, context);
|
|
117
|
+
if(type == "^") { // inverted section
|
|
118
|
+
if(!value || that.is_array(value) && value.length === 0) {
|
|
119
|
+
// false or empty list, render it
|
|
120
|
+
return that.render(content, context, partials, true);
|
|
121
|
+
} else {
|
|
122
|
+
return "";
|
|
123
|
+
}
|
|
124
|
+
} else if(type == "#") { // normal section
|
|
125
|
+
if(that.is_array(value)) { // Enumerable, Let's loop!
|
|
126
|
+
return that.map(value, function(row) {
|
|
127
|
+
return that.render(content, that.create_context(row),
|
|
128
|
+
partials, true);
|
|
129
|
+
}).join("");
|
|
130
|
+
} else if(that.is_object(value)) { // Object, Use it as subcontext!
|
|
131
|
+
return that.render(content, that.create_context(value),
|
|
132
|
+
partials, true);
|
|
133
|
+
} else if(typeof value === "function") {
|
|
134
|
+
// higher order section
|
|
135
|
+
return value.call(context, content, function(text) {
|
|
136
|
+
return that.render(text, context, partials, true);
|
|
137
|
+
});
|
|
138
|
+
} else if(value) { // boolean section
|
|
139
|
+
return that.render(content, context, partials, true);
|
|
140
|
+
} else {
|
|
141
|
+
return "";
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
/*
|
|
148
|
+
Replace {{foo}} and friends with values from our view
|
|
149
|
+
*/
|
|
150
|
+
render_tags: function(template, context, partials, in_recursion) {
|
|
151
|
+
// tit for tat
|
|
152
|
+
var that = this;
|
|
153
|
+
|
|
154
|
+
var new_regex = function() {
|
|
155
|
+
return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" +
|
|
156
|
+
that.ctag + "+", "g");
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
var regex = new_regex();
|
|
160
|
+
var tag_replace_callback = function(match, operator, name) {
|
|
161
|
+
switch(operator) {
|
|
162
|
+
case "!": // ignore comments
|
|
163
|
+
return "";
|
|
164
|
+
case "=": // set new delimiters, rebuild the replace regexp
|
|
165
|
+
that.set_delimiters(name);
|
|
166
|
+
regex = new_regex();
|
|
167
|
+
return "";
|
|
168
|
+
case ">": // render partial
|
|
169
|
+
return that.render_partial(name, context, partials);
|
|
170
|
+
case "{": // the triple mustache is unescaped
|
|
171
|
+
return that.find(name, context);
|
|
172
|
+
default: // escape the value
|
|
173
|
+
return that.escape(that.find(name, context));
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var lines = template.split("\n");
|
|
177
|
+
for(var i = 0; i < lines.length; i++) {
|
|
178
|
+
lines[i] = lines[i].replace(regex, tag_replace_callback, this);
|
|
179
|
+
if(!in_recursion) {
|
|
180
|
+
this.send(lines[i]);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if(in_recursion) {
|
|
185
|
+
return lines.join("\n");
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
set_delimiters: function(delimiters) {
|
|
190
|
+
var dels = delimiters.split(" ");
|
|
191
|
+
this.otag = this.escape_regex(dels[0]);
|
|
192
|
+
this.ctag = this.escape_regex(dels[1]);
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
escape_regex: function(text) {
|
|
196
|
+
// thank you Simon Willison
|
|
197
|
+
if(!arguments.callee.sRE) {
|
|
198
|
+
var specials = [
|
|
199
|
+
'/', '.', '*', '+', '?', '|',
|
|
200
|
+
'(', ')', '[', ']', '{', '}', '\\'
|
|
201
|
+
];
|
|
202
|
+
arguments.callee.sRE = new RegExp(
|
|
203
|
+
'(\\' + specials.join('|\\') + ')', 'g'
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
return text.replace(arguments.callee.sRE, '\\$1');
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
/*
|
|
210
|
+
find `name` in current `context`. That is find me a value
|
|
211
|
+
from the view object
|
|
212
|
+
*/
|
|
213
|
+
find: function(name, context) {
|
|
214
|
+
name = this.trim(name);
|
|
215
|
+
|
|
216
|
+
// Checks whether a value is thruthy or false or 0
|
|
217
|
+
function is_kinda_truthy(bool) {
|
|
218
|
+
return bool === false || bool === 0 || bool;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
var value;
|
|
222
|
+
if(is_kinda_truthy(context[name])) {
|
|
223
|
+
value = context[name];
|
|
224
|
+
} else if(is_kinda_truthy(this.context[name])) {
|
|
225
|
+
value = this.context[name];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if(typeof value === "function") {
|
|
229
|
+
return value.apply(context);
|
|
230
|
+
}
|
|
231
|
+
if(value !== undefined) {
|
|
232
|
+
return value;
|
|
233
|
+
}
|
|
234
|
+
// silently ignore unkown variables
|
|
235
|
+
return "";
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
// Utility methods
|
|
239
|
+
|
|
240
|
+
/* includes tag */
|
|
241
|
+
includes: function(needle, haystack) {
|
|
242
|
+
return haystack.indexOf(this.otag + needle) != -1;
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
/*
|
|
246
|
+
Does away with nasty characters
|
|
247
|
+
*/
|
|
248
|
+
escape: function(s) {
|
|
249
|
+
s = String(s === null ? "" : s);
|
|
250
|
+
return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) {
|
|
251
|
+
switch(s) {
|
|
252
|
+
case "&": return "&";
|
|
253
|
+
case "\\": return "\\\\";
|
|
254
|
+
case '"': return '"';
|
|
255
|
+
case "'": return ''';
|
|
256
|
+
case "<": return "<";
|
|
257
|
+
case ">": return ">";
|
|
258
|
+
default: return s;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
// by @langalex, support for arrays of strings
|
|
264
|
+
create_context: function(_context) {
|
|
265
|
+
if(this.is_object(_context)) {
|
|
266
|
+
return _context;
|
|
267
|
+
} else {
|
|
268
|
+
var iterator = ".";
|
|
269
|
+
if(this.pragmas["IMPLICIT-ITERATOR"]) {
|
|
270
|
+
iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
|
|
271
|
+
}
|
|
272
|
+
var ctx = {};
|
|
273
|
+
ctx[iterator] = _context;
|
|
274
|
+
return ctx;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
is_object: function(a) {
|
|
279
|
+
return a && typeof a == "object";
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
is_array: function(a) {
|
|
283
|
+
return Object.prototype.toString.call(a) === '[object Array]';
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
/*
|
|
287
|
+
Gets rid of leading and trailing whitespace
|
|
288
|
+
*/
|
|
289
|
+
trim: function(s) {
|
|
290
|
+
return s.replace(/^\s*|\s*$/g, "");
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
/*
|
|
294
|
+
Why, why, why? Because IE. Cry, cry cry.
|
|
295
|
+
*/
|
|
296
|
+
map: function(array, fn) {
|
|
297
|
+
if (typeof array.map == "function") {
|
|
298
|
+
return array.map(fn);
|
|
299
|
+
} else {
|
|
300
|
+
var r = [];
|
|
301
|
+
var l = array.length;
|
|
302
|
+
for(var i = 0; i < l; i++) {
|
|
303
|
+
r.push(fn(array[i]));
|
|
304
|
+
}
|
|
305
|
+
return r;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
return({
|
|
311
|
+
name: "mustache.js",
|
|
312
|
+
version: "0.3.1-dev",
|
|
313
|
+
|
|
314
|
+
/*
|
|
315
|
+
Turns a template and view into HTML
|
|
316
|
+
*/
|
|
317
|
+
to_html: function(template, view, partials, send_fun) {
|
|
318
|
+
var renderer = new Renderer();
|
|
319
|
+
if(send_fun) {
|
|
320
|
+
renderer.send = send_fun;
|
|
321
|
+
}
|
|
322
|
+
renderer.render(template, view, partials);
|
|
323
|
+
if(!send_fun) {
|
|
324
|
+
return renderer.buffer.join("\n");
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}();
|
|
329
|
+
// for CommonJS
|
|
330
|
+
if (exports) {
|
|
331
|
+
exports.to_html = Mustache.to_html;
|
|
332
|
+
exports.escape = Mustache.escape;
|
|
333
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Idea from https://github.com/jchris/couchapp.org
|
|
2
|
+
|
|
3
|
+
exports.init = function(newDoc, oldDoc, userCtx) {
|
|
4
|
+
var v = {};
|
|
5
|
+
|
|
6
|
+
// Is this an admin
|
|
7
|
+
v.isAdmin = function() {
|
|
8
|
+
return userCtx.roles.indexOf('_admin') !== -1;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Does person have the required role for the required group
|
|
12
|
+
v.hasGroupRole = function(group, role) {
|
|
13
|
+
for(var i = 0, l = userCtx.roles.length; i < l; i++) {
|
|
14
|
+
var user_role = userCtx.roles[i][0];
|
|
15
|
+
if (user_role === role) {
|
|
16
|
+
var user_groups = userCtx.roles[i][1];
|
|
17
|
+
if (user_groups.indexOf('group:' + group) !== -1) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
return v;
|
|
27
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Useful functions for workqueue couchapp
|
|
2
|
+
|
|
3
|
+
var workqueue_utils = {
|
|
4
|
+
|
|
5
|
+
commonInputDataSites: function(element) {
|
|
6
|
+
// Determine sites which contain all the input data
|
|
7
|
+
if (element["NoInputUpdate"] === true) {
|
|
8
|
+
return element["SiteWhitelist"];
|
|
9
|
+
}
|
|
10
|
+
return this.commonSites(element, "Inputs");
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
commonInputParentDataSites: function(element) {
|
|
14
|
+
// Determine sites which contain all the input parent data
|
|
15
|
+
if (element["NoInputUpdate"] === true) {
|
|
16
|
+
return element["SiteWhitelist"];
|
|
17
|
+
}
|
|
18
|
+
return this.commonSites(element, "ParentData");
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
commonPileupDataSites: function(element) {
|
|
22
|
+
// Determine sites which contain something of the pileup data
|
|
23
|
+
if (element["NoPileupUpdate"] === true) {
|
|
24
|
+
return element["SiteWhitelist"];
|
|
25
|
+
}
|
|
26
|
+
return this.commonSites(element, "PileupData");
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
commonSites: function(element, label) {
|
|
30
|
+
// just need to find ONE common site
|
|
31
|
+
var site_white_list = element["SiteWhitelist"];
|
|
32
|
+
for (var data in element[label]) {
|
|
33
|
+
var common_sites = [];
|
|
34
|
+
if (!element[label][data].length) {
|
|
35
|
+
// input data has no locations
|
|
36
|
+
return common_sites;
|
|
37
|
+
}
|
|
38
|
+
var locations = element[label][data];
|
|
39
|
+
// remove any site that doesnt host a data item
|
|
40
|
+
for (var i = 0; i < locations.length; i++) {
|
|
41
|
+
if (site_white_list.indexOf(locations[i]) > -1) {
|
|
42
|
+
common_sites.push(locations[i]);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!common_sites.length) {
|
|
47
|
+
return common_sites;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// everything is fine then
|
|
51
|
+
return site_white_list;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//CommonJS bindings
|
|
57
|
+
if( typeof(exports) === 'object' ) {
|
|
58
|
+
exports.commonInputDataSites = workqueue_utils.commonInputDataSites;
|
|
59
|
+
exports.commonInputParentDataSites = workqueue_utils.commonInputParentDataSites;
|
|
60
|
+
exports.commonPileupDataSites = workqueue_utils.commonPileupDataSites;
|
|
61
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function(head, req) {
|
|
2
|
+
// this function is used for elementsDetailByWorkflowAndStatus
|
|
3
|
+
var mainDoc = this;
|
|
4
|
+
provides("html", function() {
|
|
5
|
+
var Mustache = require("lib/mustache");
|
|
6
|
+
var requestInfo;
|
|
7
|
+
if (req.query.startkey) {
|
|
8
|
+
requestInfo = {request: req.query.startkey[0]};
|
|
9
|
+
} else {
|
|
10
|
+
requestInfo = {request: ""};
|
|
11
|
+
}
|
|
12
|
+
return Mustache.to_html(mainDoc.templates.ElementSummaryByWorkflow,
|
|
13
|
+
requestInfo, mainDoc.templates.partials, send);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
provides("json", function() {
|
|
17
|
+
send("[");
|
|
18
|
+
var row = getRow();
|
|
19
|
+
if (row) {
|
|
20
|
+
send(toJSON(row.value));
|
|
21
|
+
while (row = getRow()){
|
|
22
|
+
send(",");
|
|
23
|
+
send(toJSON(row.value));
|
|
24
|
+
}
|
|
25
|
+
}// end rows
|
|
26
|
+
send("]");
|
|
27
|
+
});
|
|
28
|
+
}; // end function
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
function(head, req) {
|
|
2
|
+
|
|
3
|
+
// Return elements, in json list, that match given criteria
|
|
4
|
+
// Optionally, return id of matching elements only
|
|
5
|
+
|
|
6
|
+
if (!req.query.filter) {
|
|
7
|
+
send('"Filter parameters required"');
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
var query = JSON.parse(req.query.filter);
|
|
11
|
+
var idOnly = JSON.parse(req.query.idOnly);
|
|
12
|
+
|
|
13
|
+
send("[");
|
|
14
|
+
var first = true;
|
|
15
|
+
while (row = getRow()) {
|
|
16
|
+
|
|
17
|
+
//in case document is already deleted
|
|
18
|
+
if (!row.doc) {
|
|
19
|
+
continue;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
ele = row["doc"]["WMCore.WorkQueue.DataStructs.WorkQueueElement.WorkQueueElement"];
|
|
23
|
+
// is this an element
|
|
24
|
+
if (!ele) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var matched = true;
|
|
29
|
+
for (key in query) {
|
|
30
|
+
|
|
31
|
+
if (key === 'since' && query[key] > row.timestamp) {
|
|
32
|
+
matched = false;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (key === 'after' && query[key] < row.timestamp) {
|
|
37
|
+
matched = false;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (key === 'reqMgrUpdateNeeded' && query[key] === 'true') {
|
|
42
|
+
if (row.updatetime > row.reqmgrupdatetime) {
|
|
43
|
+
matched = false;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// if element doesnt have the key it cant match
|
|
49
|
+
if (!ele.hasOwnProperty(key)) {
|
|
50
|
+
matched = false;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// if array check if inside - can't believe this is the best way...
|
|
55
|
+
if (Object.prototype.toString.call(query[key]) === '[object Array]') {
|
|
56
|
+
if (query[key].indexOf(ele[key]) === -1) {
|
|
57
|
+
matched = false;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// for any other key just do a straight comparison
|
|
62
|
+
} else if (query[key] !== ele[key]) {
|
|
63
|
+
matched = false;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!matched) {
|
|
69
|
+
continue // element doesn't fit requirements
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (first != true) {
|
|
73
|
+
send(",")
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Send element or id depending on what was asked
|
|
77
|
+
if (idOnly) {
|
|
78
|
+
send(toJSON(row['id']));
|
|
79
|
+
} else {
|
|
80
|
+
send(toJSON(row["doc"])); // need whole document, id etc...
|
|
81
|
+
}
|
|
82
|
+
first = false; // from now on prepend "," to output
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
send("]");
|
|
86
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function(head, req) {
|
|
2
|
+
// return elements that cannot be run
|
|
3
|
+
var mainDoc = this
|
|
4
|
+
|
|
5
|
+
provides("html", function() {
|
|
6
|
+
var Mustache = require("lib/mustache");
|
|
7
|
+
return Mustache.to_html(mainDoc.templates.StuckElementSummary,
|
|
8
|
+
{}, mainDoc.templates.partials, send);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
provides("json", function() {
|
|
13
|
+
send("[");
|
|
14
|
+
var row = getRow();
|
|
15
|
+
if (row) {
|
|
16
|
+
var ele = row['doc']['WMCore.WorkQueue.DataStructs.WorkQueueElement.WorkQueueElement'];
|
|
17
|
+
ele.InsertTime = row['doc'].timestamp;
|
|
18
|
+
ele.UpdateTime = row['doc'].updatetime;
|
|
19
|
+
ele.reason = row['key'];
|
|
20
|
+
ele.id = row['id'];
|
|
21
|
+
send(toJSON(ele));
|
|
22
|
+
while (row = getRow()) {
|
|
23
|
+
//in case document is already deleted
|
|
24
|
+
if (!row.doc) {
|
|
25
|
+
continue;
|
|
26
|
+
};
|
|
27
|
+
send(",");
|
|
28
|
+
var ele = row['doc']['WMCore.WorkQueue.DataStructs.WorkQueueElement.WorkQueueElement'];
|
|
29
|
+
ele.InsertTime = row['doc'].timestamp;
|
|
30
|
+
ele.UpdateTime = row['doc'].updatetime;
|
|
31
|
+
ele.reason = row['key'];
|
|
32
|
+
ele.id = row['id'];
|
|
33
|
+
send(toJSON(ele));
|
|
34
|
+
};
|
|
35
|
+
}// end rows
|
|
36
|
+
send("]");
|
|
37
|
+
});
|
|
38
|
+
}; // end function
|