reqmon 2.3.10__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.
Files changed (424) hide show
  1. Utils/CPMetrics.py +270 -0
  2. Utils/CertTools.py +62 -0
  3. Utils/EmailAlert.py +50 -0
  4. Utils/ExtendedUnitTestCase.py +62 -0
  5. Utils/FileTools.py +182 -0
  6. Utils/IteratorTools.py +80 -0
  7. Utils/MathUtils.py +31 -0
  8. Utils/MemoryCache.py +119 -0
  9. Utils/Patterns.py +24 -0
  10. Utils/Pipeline.py +137 -0
  11. Utils/PortForward.py +97 -0
  12. Utils/ProcessStats.py +103 -0
  13. Utils/PythonVersion.py +17 -0
  14. Utils/Signals.py +36 -0
  15. Utils/TemporaryEnvironment.py +27 -0
  16. Utils/Throttled.py +227 -0
  17. Utils/Timers.py +130 -0
  18. Utils/Timestamps.py +86 -0
  19. Utils/TokenManager.py +143 -0
  20. Utils/Tracing.py +60 -0
  21. Utils/TwPrint.py +98 -0
  22. Utils/Utilities.py +308 -0
  23. Utils/__init__.py +11 -0
  24. WMCore/Algorithms/Permissions.py +27 -0
  25. WMCore/Algorithms/__init__.py +7 -0
  26. WMCore/Cache/GenericDataCache.py +98 -0
  27. WMCore/Cache/WMConfigCache.py +572 -0
  28. WMCore/Cache/__init__.py +0 -0
  29. WMCore/Configuration.py +651 -0
  30. WMCore/DataStructs/File.py +177 -0
  31. WMCore/DataStructs/Fileset.py +140 -0
  32. WMCore/DataStructs/Job.py +182 -0
  33. WMCore/DataStructs/JobGroup.py +142 -0
  34. WMCore/DataStructs/JobPackage.py +49 -0
  35. WMCore/DataStructs/LumiList.py +734 -0
  36. WMCore/DataStructs/Mask.py +219 -0
  37. WMCore/DataStructs/Pickleable.py +24 -0
  38. WMCore/DataStructs/Run.py +256 -0
  39. WMCore/DataStructs/Subscription.py +175 -0
  40. WMCore/DataStructs/WMObject.py +47 -0
  41. WMCore/DataStructs/WorkUnit.py +112 -0
  42. WMCore/DataStructs/Workflow.py +60 -0
  43. WMCore/DataStructs/__init__.py +8 -0
  44. WMCore/Database/CMSCouch.py +1349 -0
  45. WMCore/Database/CouchUtils.py +118 -0
  46. WMCore/Database/__init__.py +9 -0
  47. WMCore/Lexicon.py +836 -0
  48. WMCore/REST/Auth.py +202 -0
  49. WMCore/REST/CherryPyPeriodicTask.py +166 -0
  50. WMCore/REST/Error.py +333 -0
  51. WMCore/REST/Format.py +642 -0
  52. WMCore/REST/HeartbeatMonitorBase.py +90 -0
  53. WMCore/REST/Main.py +623 -0
  54. WMCore/REST/Server.py +2435 -0
  55. WMCore/REST/Services.py +24 -0
  56. WMCore/REST/Test.py +120 -0
  57. WMCore/REST/Tools.py +38 -0
  58. WMCore/REST/Validation.py +250 -0
  59. WMCore/REST/__init__.py +1 -0
  60. WMCore/ReqMgr/DataStructs/AuthzByStatus.py +113 -0
  61. WMCore/ReqMgr/DataStructs/DefaultConfig/CAMPAIGN_CONFIG.py +116 -0
  62. WMCore/ReqMgr/DataStructs/DefaultConfig/DAS_RESULT_FILTER.py +3 -0
  63. WMCore/ReqMgr/DataStructs/DefaultConfig/EDITABLE_SPLITTING_PARAM_CONFIG.py +42 -0
  64. WMCore/ReqMgr/DataStructs/DefaultConfig/UNIFIED_CONFIG.py +240 -0
  65. WMCore/ReqMgr/DataStructs/DefaultConfig/__init__.py +0 -0
  66. WMCore/ReqMgr/DataStructs/ReqMgrConfigDataCache.py +65 -0
  67. WMCore/ReqMgr/DataStructs/Request.py +293 -0
  68. WMCore/ReqMgr/DataStructs/RequestError.py +21 -0
  69. WMCore/ReqMgr/DataStructs/RequestStatus.py +209 -0
  70. WMCore/ReqMgr/DataStructs/RequestType.py +13 -0
  71. WMCore/ReqMgr/DataStructs/__init__.py +0 -0
  72. WMCore/ReqMgr/__init__.py +1 -0
  73. WMCore/Services/AlertManager/AlertManagerAPI.py +111 -0
  74. WMCore/Services/AlertManager/__init__.py +0 -0
  75. WMCore/Services/CRIC/CRIC.py +238 -0
  76. WMCore/Services/CRIC/__init__.py +0 -0
  77. WMCore/Services/DBS/DBS3Reader.py +1044 -0
  78. WMCore/Services/DBS/DBSConcurrency.py +44 -0
  79. WMCore/Services/DBS/DBSErrors.py +113 -0
  80. WMCore/Services/DBS/DBSReader.py +23 -0
  81. WMCore/Services/DBS/DBSUtils.py +139 -0
  82. WMCore/Services/DBS/DBSWriterObjects.py +381 -0
  83. WMCore/Services/DBS/ProdException.py +133 -0
  84. WMCore/Services/DBS/__init__.py +8 -0
  85. WMCore/Services/FWJRDB/FWJRDBAPI.py +118 -0
  86. WMCore/Services/FWJRDB/__init__.py +0 -0
  87. WMCore/Services/HTTPS/HTTPSAuthHandler.py +66 -0
  88. WMCore/Services/HTTPS/__init__.py +0 -0
  89. WMCore/Services/LogDB/LogDB.py +201 -0
  90. WMCore/Services/LogDB/LogDBBackend.py +191 -0
  91. WMCore/Services/LogDB/LogDBExceptions.py +11 -0
  92. WMCore/Services/LogDB/LogDBReport.py +85 -0
  93. WMCore/Services/LogDB/__init__.py +0 -0
  94. WMCore/Services/MSPileup/__init__.py +0 -0
  95. WMCore/Services/MSUtils/MSUtils.py +54 -0
  96. WMCore/Services/MSUtils/__init__.py +0 -0
  97. WMCore/Services/McM/McM.py +173 -0
  98. WMCore/Services/McM/__init__.py +8 -0
  99. WMCore/Services/MonIT/Grafana.py +133 -0
  100. WMCore/Services/MonIT/__init__.py +0 -0
  101. WMCore/Services/PyCondor/PyCondorAPI.py +154 -0
  102. WMCore/Services/PyCondor/PyCondorUtils.py +105 -0
  103. WMCore/Services/PyCondor/__init__.py +0 -0
  104. WMCore/Services/ReqMgr/ReqMgr.py +261 -0
  105. WMCore/Services/ReqMgr/__init__.py +0 -0
  106. WMCore/Services/ReqMgrAux/ReqMgrAux.py +419 -0
  107. WMCore/Services/ReqMgrAux/__init__.py +0 -0
  108. WMCore/Services/RequestDB/RequestDBReader.py +267 -0
  109. WMCore/Services/RequestDB/RequestDBWriter.py +39 -0
  110. WMCore/Services/RequestDB/__init__.py +0 -0
  111. WMCore/Services/Requests.py +624 -0
  112. WMCore/Services/Rucio/Rucio.py +1287 -0
  113. WMCore/Services/Rucio/RucioUtils.py +74 -0
  114. WMCore/Services/Rucio/__init__.py +0 -0
  115. WMCore/Services/RucioConMon/RucioConMon.py +128 -0
  116. WMCore/Services/RucioConMon/__init__.py +0 -0
  117. WMCore/Services/Service.py +400 -0
  118. WMCore/Services/StompAMQ/__init__.py +0 -0
  119. WMCore/Services/TagCollector/TagCollector.py +155 -0
  120. WMCore/Services/TagCollector/XMLUtils.py +98 -0
  121. WMCore/Services/TagCollector/__init__.py +0 -0
  122. WMCore/Services/UUIDLib.py +13 -0
  123. WMCore/Services/UserFileCache/UserFileCache.py +160 -0
  124. WMCore/Services/UserFileCache/__init__.py +8 -0
  125. WMCore/Services/WMAgent/WMAgent.py +63 -0
  126. WMCore/Services/WMAgent/__init__.py +0 -0
  127. WMCore/Services/WMArchive/CMSSWMetrics.py +526 -0
  128. WMCore/Services/WMArchive/DataMap.py +463 -0
  129. WMCore/Services/WMArchive/WMArchive.py +33 -0
  130. WMCore/Services/WMArchive/__init__.py +0 -0
  131. WMCore/Services/WMBS/WMBS.py +97 -0
  132. WMCore/Services/WMBS/__init__.py +0 -0
  133. WMCore/Services/WMStats/DataStruct/RequestInfoCollection.py +300 -0
  134. WMCore/Services/WMStats/DataStruct/__init__.py +0 -0
  135. WMCore/Services/WMStats/WMStatsPycurl.py +145 -0
  136. WMCore/Services/WMStats/WMStatsReader.py +445 -0
  137. WMCore/Services/WMStats/WMStatsWriter.py +273 -0
  138. WMCore/Services/WMStats/__init__.py +0 -0
  139. WMCore/Services/WMStatsServer/WMStatsServer.py +134 -0
  140. WMCore/Services/WMStatsServer/__init__.py +0 -0
  141. WMCore/Services/WorkQueue/WorkQueue.py +492 -0
  142. WMCore/Services/WorkQueue/__init__.py +0 -0
  143. WMCore/Services/__init__.py +8 -0
  144. WMCore/Services/pycurl_manager.py +574 -0
  145. WMCore/WMBase.py +50 -0
  146. WMCore/WMException.py +183 -0
  147. WMCore/WMExceptions.py +269 -0
  148. WMCore/WMFactory.py +76 -0
  149. WMCore/WMLogging.py +108 -0
  150. WMCore/WMStats/CherryPyThreads/CleanUpTask.py +46 -0
  151. WMCore/WMStats/CherryPyThreads/DataCacheUpdate.py +45 -0
  152. WMCore/WMStats/CherryPyThreads/HeartbeatMonitor.py +6 -0
  153. WMCore/WMStats/CherryPyThreads/LogDBTasks.py +29 -0
  154. WMCore/WMStats/CherryPyThreads/__init__.py +0 -0
  155. WMCore/WMStats/DataStructs/DataCache.py +92 -0
  156. WMCore/WMStats/DataStructs/__init__.py +0 -0
  157. WMCore/WMStats/Service/ActiveRequestJobInfo.py +123 -0
  158. WMCore/WMStats/Service/MetaDataInfo.py +26 -0
  159. WMCore/WMStats/Service/RequestInfo.py +127 -0
  160. WMCore/WMStats/Service/RestApiHub.py +51 -0
  161. WMCore/WMStats/Service/__init__.py +0 -0
  162. WMCore/WMStats/T0/CherryPyThreads/T0DataCacheUpdate.py +35 -0
  163. WMCore/WMStats/T0/CherryPyThreads/__init__.py +0 -0
  164. WMCore/WMStats/T0/Service/T0RestApiHub.py +37 -0
  165. WMCore/WMStats/T0/Service/__init__.py +0 -0
  166. WMCore/WMStats/T0/__init__.py +0 -0
  167. WMCore/WMStats/WebGui/FrontPage.py +59 -0
  168. WMCore/WMStats/WebGui/__init__.py +0 -0
  169. WMCore/WMStats/__init__.py +1 -0
  170. WMCore/Wrappers/JsonWrapper/JSONThunker.py +342 -0
  171. WMCore/Wrappers/JsonWrapper/__init__.py +7 -0
  172. WMCore/Wrappers/__init__.py +6 -0
  173. WMCore/__init__.py +10 -0
  174. reqmon-2.3.10.data/data/bin/wmc-dist-patch +15 -0
  175. reqmon-2.3.10.data/data/bin/wmc-dist-unpatch +8 -0
  176. reqmon-2.3.10.data/data/bin/wmc-httpd +3 -0
  177. reqmon-2.3.10.data/data/data/couchapps/LogDB/_id +1 -0
  178. reqmon-2.3.10.data/data/data/couchapps/LogDB/couchapp.json +5 -0
  179. reqmon-2.3.10.data/data/data/couchapps/LogDB/filters/filterDeletedDocs.js +3 -0
  180. reqmon-2.3.10.data/data/data/couchapps/LogDB/language +1 -0
  181. reqmon-2.3.10.data/data/data/couchapps/LogDB/validate_doc_update.js +6 -0
  182. reqmon-2.3.10.data/data/data/couchapps/LogDB/views/logByRequest/map.js +9 -0
  183. reqmon-2.3.10.data/data/data/couchapps/LogDB/views/logByRequestAndThread/map.js +3 -0
  184. reqmon-2.3.10.data/data/data/couchapps/LogDB/views/requests/map.js +5 -0
  185. reqmon-2.3.10.data/data/data/couchapps/LogDB/views/requests/reduce.js +1 -0
  186. reqmon-2.3.10.data/data/data/couchapps/LogDB/views/tstamp/map.js +7 -0
  187. reqmon-2.3.10.data/data/data/couchapps/T0Request/_id +1 -0
  188. reqmon-2.3.10.data/data/data/couchapps/T0Request/couchapp.json +5 -0
  189. reqmon-2.3.10.data/data/data/couchapps/T0Request/filters/repfilter.js +3 -0
  190. reqmon-2.3.10.data/data/data/couchapps/T0Request/language +1 -0
  191. reqmon-2.3.10.data/data/data/couchapps/T0Request/updates/updaterequest.js +79 -0
  192. reqmon-2.3.10.data/data/data/couchapps/T0Request/validate_doc_update.js +6 -0
  193. reqmon-2.3.10.data/data/data/couchapps/T0Request/views/byrequest/map.js +3 -0
  194. reqmon-2.3.10.data/data/data/couchapps/T0Request/views/bystatus/map.js +7 -0
  195. reqmon-2.3.10.data/data/data/couchapps/T0Request/views/bystatusandtime/map.js +7 -0
  196. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/ColVis.css +76 -0
  197. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/font-awesome.min.css +4 -0
  198. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-check-16.png +0 -0
  199. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-cross-16.png +0 -0
  200. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-plus-16.png +0 -0
  201. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-square-check-16.png +0 -0
  202. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/cms_logo.gif +0 -0
  203. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/cms_logo.jpeg +0 -0
  204. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  205. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  206. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
  207. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  208. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
  209. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  210. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  211. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_highlight-hard_55_5c9ccc_1x100.png +0 -0
  212. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  213. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_inset-soft_100_fcfdfd_1x100.png +0 -0
  214. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_217bc0_256x240.png +0 -0
  215. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_2694e8_256x240.png +0 -0
  216. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_2e83ff_256x240.png +0 -0
  217. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_469bdd_256x240.png +0 -0
  218. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_6da8d5_256x240.png +0 -0
  219. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  220. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_d8e7f3_256x240.png +0 -0
  221. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_f9bd01_256x240.png +0 -0
  222. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/warning-16.png +0 -0
  223. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/jquery-ui-1.12.0.css +1312 -0
  224. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/jquery.dataTables.css +241 -0
  225. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/logdb.css +60 -0
  226. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/main_layout.css +565 -0
  227. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/FontAwesome.otf +0 -0
  228. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.eot +0 -0
  229. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.svg +565 -0
  230. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.ttf +0 -0
  231. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.woff +0 -0
  232. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.woff2 +0 -0
  233. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/Sorting icons.psd +0 -0
  234. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/back_disabled.jpg +0 -0
  235. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/back_enabled.jpg +0 -0
  236. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/error.png +0 -0
  237. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/favicon.ico +0 -0
  238. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/forward_disabled.jpg +0 -0
  239. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/forward_enabled.jpg +0 -0
  240. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/loader-1.gif +0 -0
  241. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/module.caption.backg.png +0 -0
  242. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/module.caption.backg.rolledup.png +0 -0
  243. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/rollup.gif +0 -0
  244. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_asc.png +0 -0
  245. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_asc_disabled.png +0 -0
  246. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_both.png +0 -0
  247. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_desc.png +0 -0
  248. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_desc_disabled.png +0 -0
  249. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/stable.png +0 -0
  250. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/warning.png +0 -0
  251. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html +105 -0
  252. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html.min +106 -0
  253. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html.org +125 -0
  254. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.ActiveRequestController.js +61 -0
  255. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.GenericController.js +38 -0
  256. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.WorkloadSummaryController.js +12 -0
  257. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/import.js +6 -0
  258. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T0/WMStats.RequestSummary.js +71 -0
  259. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T0/WMStats.RunSummary.js +70 -0
  260. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.AgentRequestSummary.js +28 -0
  261. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.CMSSWSummary.js +28 -0
  262. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.CampaignSummary.js +28 -0
  263. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.ReqMgrRequest.js +10 -0
  264. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.RequestSummary.js +190 -0
  265. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Agents.js +98 -0
  266. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Alerts.js +21 -0
  267. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Campaigns.js +25 -0
  268. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.GenericRequests.js +728 -0
  269. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.History.js +78 -0
  270. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.JobDetails.js +19 -0
  271. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.JobSummary.js +32 -0
  272. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.LogDBData.js +93 -0
  273. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.LogMessage.js +38 -0
  274. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.SiteSummary.js +24 -0
  275. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Sites.js +25 -0
  276. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Tasks.js +107 -0
  277. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.WorkloadSummary.js +20 -0
  278. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats._StructBase.js +37 -0
  279. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/import.js +29 -0
  280. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.ActiveRequestModel.js +9 -0
  281. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestLogDetailModel.js +17 -0
  282. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestLogModel.js +14 -0
  283. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestModel.js +3 -0
  284. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestSearchModel.js +8 -0
  285. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.ActiveRequestModel.js +9 -0
  286. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.ReqMgrRequestModel.js +8 -0
  287. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestLogDetailModel.js +18 -0
  288. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestLogModel.js +14 -0
  289. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestSearchModel.js +8 -0
  290. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.AgentModel.js +3 -0
  291. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.AlertModel.js +6 -0
  292. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.HistoryModel.js +14 -0
  293. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.JobDetailModel.js +22 -0
  294. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.JobSummaryModel.js +18 -0
  295. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.WorkloadSummaryModel.js +8 -0
  296. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._AjaxModelBase.js +55 -0
  297. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._ModelBase.js +77 -0
  298. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._RequestModelBase.js +127 -0
  299. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/import.js +26 -0
  300. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/ViewModels/WMStats.ViewModel.js +511 -0
  301. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/ViewModels/import.js +2 -0
  302. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/T0/WMStats.Controls.js +117 -0
  303. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/T1/WMStats.Controls.js +158 -0
  304. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/WMStats.CommonControls.js +100 -0
  305. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/import.js +10 -0
  306. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Graphs/WMStats.SiteHistoryGraph.js +8 -0
  307. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Graphs/import.js +3 -0
  308. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.CategoryDetailList.js +38 -0
  309. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestAlertGUI.js +128 -0
  310. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestDataList.js +25 -0
  311. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestDetailList.js +68 -0
  312. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestSummaryList.js +31 -0
  313. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.CategoryDetailList.js +54 -0
  314. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestAlertGUI.js +81 -0
  315. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestDataList.js +26 -0
  316. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestDetailList.js +122 -0
  317. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestSummaryList.js +35 -0
  318. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.ResubmissionList.js +64 -0
  319. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.AgentDetailList.js +137 -0
  320. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.CategoryTitle.js +20 -0
  321. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.HTMLList.js +12 -0
  322. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.JobDetailList.js +178 -0
  323. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.RequestLogList.js +88 -0
  324. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.RequestTitle.js +33 -0
  325. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/import.js +25 -0
  326. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.ActiveRequestTable.js +142 -0
  327. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.RunSummaryTable.js +77 -0
  328. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.TaskSummaryTable.js +127 -0
  329. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/addCategoryMap.js +10 -0
  330. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.ActiveRequestTable.js +132 -0
  331. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.ActiveRequestTableWithJob.js +164 -0
  332. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.AgentRequestSummaryTable.js +78 -0
  333. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.CMSSWSummaryTable.js +76 -0
  334. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.CampaignSummaryTable.js +76 -0
  335. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.SiteSummaryTable.js +63 -0
  336. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.TaskSummaryTable.js +124 -0
  337. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/addCategoryMap.js +17 -0
  338. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.JobSummaryTable.js +71 -0
  339. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.Table.js +70 -0
  340. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.TableController.js +130 -0
  341. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.WorkloadSummaryTable.js +62 -0
  342. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/import.js +26 -0
  343. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/WMStats.CategoryMap.js +45 -0
  344. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/WMStats.View.IndexHTML.js +137 -0
  345. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/import.js +3 -0
  346. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Ajax.js +74 -0
  347. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Couch.js +83 -0
  348. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Globals.js +200 -0
  349. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Utils.js +283 -0
  350. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/import-all.min.js +7 -0
  351. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/loader.js +27 -0
  352. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/global.min.js +639 -0
  353. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/import-all-t0.min.js +4317 -0
  354. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/import-all-t1.min.js +4972 -0
  355. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/lib/jquery.dataTables.columnFilter.js +732 -0
  356. reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/lib/namespace.js +23 -0
  357. reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/deleteFatDocFilter.js +3 -0
  358. reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/filterDeletedDocs.js +3 -0
  359. reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/repfilter.js +7 -0
  360. reqmon-2.3.10.data/data/data/couchapps/WMStats/rewrites.json +110 -0
  361. reqmon-2.3.10.data/data/data/couchapps/WMStats/shows/redirect.js +23 -0
  362. reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/agentInfo.js +17 -0
  363. reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/generalFields.js +11 -0
  364. reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/insertRequest.js +13 -0
  365. reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobLogArchiveLocation.js +10 -0
  366. reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobStateTransition.js +17 -0
  367. reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobSummaryState.js +5 -0
  368. reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/totalStats.js +39 -0
  369. reqmon-2.3.10.data/data/data/couchapps/WMStats/validate_doc_update.js +10 -0
  370. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/language +1 -0
  371. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/views/requestAgentUrl/map.erl +11 -0
  372. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/views/requestAgentUrl/reduce.erl +1 -0
  373. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl1/language +1 -0
  374. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl1/views/byAgentURL/map.erl +11 -0
  375. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/language +1 -0
  376. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/views/allWorkflows/map.erl +10 -0
  377. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/views/allWorkflows/reduce.erl +1 -0
  378. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/language +1 -0
  379. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/views/jobsByStatusWorkflow/map.erl +32 -0
  380. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/views/jobsByStatusWorkflow/reduce.erl +1 -0
  381. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/language +1 -0
  382. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/views/cooledoffRequests/map.erl +16 -0
  383. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/views/cooledoffRequests/reduce.erl +1 -0
  384. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl5/language +1 -0
  385. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl5/views/time/map.erl +11 -0
  386. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/language +1 -0
  387. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/views/requestHistory/map.erl +11 -0
  388. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/views/requestHistory/reduce.erl +1 -0
  389. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/language +1 -0
  390. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/views/agentInfo/map.erl +10 -0
  391. reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/views/latestRequest/map.erl +11 -0
  392. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/index.html +44 -0
  393. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/container/histogram.js +141 -0
  394. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/container/tree.js +67 -0
  395. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/dataMap/errorData.js +69 -0
  396. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/htmlFormatter/listFormatter.js +79 -0
  397. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/layout/gridLayout.js +77 -0
  398. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/performanceHistogram.html +46 -0
  399. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/style/main.css +17 -0
  400. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/couchapp.json +4 -0
  401. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/filters/repfilter.js +3 -0
  402. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lib/mustache.js +333 -0
  403. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lib/validate.js +29 -0
  404. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lists/completedWorkflows.js +27 -0
  405. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lists/performanceHistogram.js +15 -0
  406. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/rewrites.json +65 -0
  407. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/shows/histogramByWorkflow.js +75 -0
  408. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/shows/lumiMissingByWorkflow.js +97 -0
  409. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/templates/histogramByWorkflow.html +126 -0
  410. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/templates/performanceData.html +44 -0
  411. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/updates/updateacdc.js +6 -0
  412. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/updates/updatecollection.js +5 -0
  413. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/validate_doc_update.js +8 -0
  414. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/vendor/protovis/_attachments/protovis-r3.2.js +277 -0
  415. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/outputDataByPrimDs/map.js +21 -0
  416. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/performanceDataByCampaign/map.js +19 -0
  417. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/summaryByInputdataset/map.js +7 -0
  418. reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/summaryByOutputdataset/map.js +7 -0
  419. reqmon-2.3.10.dist-info/LICENSE +202 -0
  420. reqmon-2.3.10.dist-info/METADATA +24 -0
  421. reqmon-2.3.10.dist-info/NOTICE +16 -0
  422. reqmon-2.3.10.dist-info/RECORD +424 -0
  423. reqmon-2.3.10.dist-info/WHEEL +5 -0
  424. reqmon-2.3.10.dist-info/top_level.txt +2 -0
@@ -0,0 +1,209 @@
1
+ """
2
+ Definition of valid status values for a request and valid status transitions.
3
+
4
+ """
5
+
6
+ from future.utils import viewitems
7
+
8
+ # make this list to ensure insertion order here
9
+ REQUEST_START_STATE = "new"
10
+ REQUEST_STATE_TRANSITION = {
11
+ REQUEST_START_STATE: [REQUEST_START_STATE,
12
+ "assignment-approved",
13
+ "rejected"],
14
+
15
+ "assignment-approved": ["assigned", # manual transition
16
+ "rejected"], # manual transition
17
+
18
+ "assigned": ["staging",
19
+ "aborted"], # manual transition
20
+ "staging": ["staged",
21
+ "aborted"], # manual transition
22
+ "staged": ["acquired",
23
+ "aborted", # manual transition
24
+ "failed"],
25
+ "acquired": ["running-open",
26
+ "aborted", # manual transition
27
+ "failed"],
28
+ "running-open": ["running-closed",
29
+ "force-complete", # manual transition
30
+ "aborted"], # manual transition
31
+
32
+ "running-closed": ["force-complete", # manual transition
33
+ "completed",
34
+ "aborted"], # manual transition
35
+
36
+ "force-complete": ["completed"],
37
+
38
+ "failed": ["rejected", # manual transition
39
+ "assigned"], # manual transition
40
+
41
+ "completed": ["closed-out",
42
+ "rejected"], # manual transition
43
+
44
+ "closed-out": ["announced", "rejected"], # manual transition
45
+
46
+ "announced": ["rejected", "normal-archived"],
47
+
48
+ "aborted": ["aborted-completed"],
49
+
50
+ "aborted-completed": ["aborted-archived"],
51
+
52
+ "rejected": ["rejected-archived"],
53
+
54
+ # final status
55
+ "normal-archived": ["rejected-archived"],
56
+
57
+ "aborted-archived": [],
58
+
59
+ "rejected-archived": []
60
+ }
61
+
62
+ # List of requests that a human user can change a request to
63
+ REQUEST_HUMAN_STATES = ["assignment-approved",
64
+ "assigned",
65
+ "force-complete",
66
+ "closed-out",
67
+ "announced",
68
+ "rejected",
69
+ "aborted"]
70
+
71
+ ACTIVE_STATUS = ["new",
72
+ "assignment-approved",
73
+ "assigned",
74
+ "staging",
75
+ "staged",
76
+ "acquired",
77
+ "running-open",
78
+ "running-closed",
79
+ "failed",
80
+ "force-complete",
81
+ "completed",
82
+ "closed-out",
83
+ "announced",
84
+ "aborted",
85
+ "aborted-completed",
86
+ "rejected"]
87
+
88
+ ### WMSTATS_JOB_INFO + WMSTATS_NO_JOB_INFO is meant to be equal to ACTIVE_STATUS
89
+ WMSTATS_JOB_INFO = ["running-open",
90
+ "running-closed",
91
+ "force-complete",
92
+ "completed",
93
+ "closed-out"]
94
+
95
+ WMSTATS_NO_JOB_INFO = ["new",
96
+ "assignment-approved",
97
+ "assigned",
98
+ "staging",
99
+ "staged",
100
+ "acquired",
101
+ "failed",
102
+ "announced",
103
+ "aborted",
104
+ "aborted-completed",
105
+ "rejected"]
106
+
107
+ ### Used for monitoring in T0-WMStats. See: Services/WMStats/WMStatsReader
108
+ T0_ACTIVE_STATUS = ["new",
109
+ "Closed",
110
+ "Merge",
111
+ "Harvesting",
112
+ "Processing Done",
113
+ "AlcaSkim",
114
+ "completed"]
115
+
116
+ # if the state is not defined here (new) allows all the property to get
117
+ # states in the key is the source states (need to define source states instead of destination states for GUI update)
118
+ ALLOWED_ACTIONS_FOR_STATUS = {
119
+ "new": ["RequestPriority"],
120
+ "assignment-approved": ["RequestPriority", "Team", "SiteWhitelist", "SiteBlacklist",
121
+ "AcquisitionEra", "ProcessingString", "ProcessingVersion",
122
+ "Dashboard", "MergedLFNBase", "TrustSitelists",
123
+ "UnmergedLFNBase", "MinMergeSize", "MaxMergeSize",
124
+ "MaxMergeEvents", "BlockCloseMaxWaitTime",
125
+ "BlockCloseMaxFiles", "BlockCloseMaxEvents", "BlockCloseMaxSize",
126
+ "SoftTimeout", "GracePeriod",
127
+ "TrustPUSitelists", "CustodialSites",
128
+ "NonCustodialSites", "Override",
129
+ "SubscriptionPriority"],
130
+ "assigned": ["RequestPriority"],
131
+ "staging": ["RequestPriority", "SiteWhitelist", "SiteBlacklist"],
132
+ "staged": ["RequestPriority"],
133
+ "acquired": ["RequestPriority", "SiteWhitelist", "SiteBlacklist"],
134
+ "running-open": ["RequestPriority", "SiteWhitelist", "SiteBlacklist"],
135
+ "running-closed": ["RequestPriority"],
136
+ "failed": [],
137
+ "force-complete": [],
138
+ "completed": [],
139
+ "closed-out": [],
140
+ "announced": [],
141
+ "aborted": [],
142
+ "aborted-completed": [],
143
+ "rejected": [],
144
+ "normal-archived": [],
145
+ "aborted-archived": [],
146
+ "rejected-archived": [],
147
+ }
148
+
149
+ # NOTE: We need to Explicitly add RequestStatus to reqArgsDiff, since it is
150
+ # missing from the ALLOWED_ACTIONS_FOR_STATUS mapping. The alternative
151
+ # would be to add it as allowed action to every state.
152
+ # The same applies to few more, such as all the keys needed for the
153
+ # workqueue_stat_validation() calls, but we do this only during
154
+ # request parameters validation.
155
+ ALLOWED_ACTIONS_ALL_STATUS = ["RequestStatus"]
156
+
157
+ # NOTE: We need to explicitly add all stat keys during validation
158
+ # They are needed for the workqueue_stat_validation() calls
159
+ ALLOWED_STAT_KEYS = ['total_jobs', 'input_lumis', 'input_events', 'input_num_files']
160
+
161
+ # Workflow state transition automatically controlled by ReqMgr2
162
+ ### NOTE: order of this list matters and it's used for status transition
163
+ AUTO_TRANSITION = {"staged": ["acquired", "running-open", "running-closed", "completed"],
164
+ "acquired": ["running-open", "running-closed", "completed"],
165
+ "running-open": ["running-closed", "completed"],
166
+ "running-closed": ["completed"]}
167
+
168
+ # Workflow state transition automatically controlled by ReqMgr2
169
+ # Specific to workflows either aborted or force-completed
170
+ CANCEL_AUTO_TRANSITION = {"aborted": "aborted-completed",
171
+ "force-complete": "completed"}
172
+
173
+ # list of destination states which doesn't allow any additional argument update
174
+ STATES_ALLOW_ONLY_STATE_TRANSITION = [key for key, val in viewitems(ALLOWED_ACTIONS_FOR_STATUS) if len(val) == 0]
175
+ # each item from STATUS_TRANSITION is a dictionary with 1 item, the key
176
+ # is name of the status
177
+ REQUEST_STATE_LIST = list(REQUEST_STATE_TRANSITION)
178
+
179
+ ACTIVE_STATUS_FILTER = {"RequestStatus": ['assignment-approved', 'assigned', 'staging', 'staged',
180
+ 'failed', 'acquired', 'running-open', 'running-closed',
181
+ 'force-complete', 'completed', 'closed-out']}
182
+
183
+
184
+ def check_allowed_transition(preState, postState):
185
+ stateList = REQUEST_STATE_TRANSITION.get(preState, [])
186
+ if postState in stateList:
187
+ return True
188
+ else:
189
+ return False
190
+
191
+
192
+ def get_modifiable_properties(status=None):
193
+ """
194
+ returns mondifiable property list by status.
195
+ if status is not defined return dictionarly of all the status and property list
196
+ TODO: Currently gets the result from hardcoded list. change to get from configuration or db
197
+ """
198
+ if status:
199
+ allowedKeys = ALLOWED_ACTIONS_FOR_STATUS.get(status, 'all_attributes')
200
+ return allowedKeys
201
+ else:
202
+ return ALLOWED_ACTIONS_FOR_STATUS
203
+
204
+
205
+ def get_protected_properties():
206
+ """
207
+ returns properties never be modified once request is created
208
+ """
209
+ return ["RequestName", "_id"]
@@ -0,0 +1,13 @@
1
+ """
2
+ List of valid request types.
3
+
4
+ """
5
+
6
+ REQUEST_TYPES = [
7
+ "ReReco",
8
+ "StoreResults",
9
+ "Resubmission",
10
+ "TaskChain",
11
+ "DQMHarvest",
12
+ "StepChain"
13
+ ]
File without changes
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,111 @@
1
+ """
2
+
3
+ AlertManagerAPI - send alerts to MONIT AlertManager via API calls
4
+ """
5
+
6
+ from __future__ import division
7
+ from builtins import object
8
+ from datetime import timedelta, datetime
9
+ import socket
10
+ import json
11
+ import logging
12
+
13
+ from WMCore.Services.pycurl_manager import RequestHandler
14
+ from Utils.Timers import LocalTimezone
15
+ from Utils.Utilities import normalize_spaces
16
+ from WMCore.Services.UUIDLib import makeUUID
17
+
18
+
19
+ class AlertManagerAPI(object):
20
+ """
21
+ A class used to send alerts via the MONIT AlertManager API
22
+ """
23
+
24
+ def __init__(self, alertManagerUrl, logger=None):
25
+ self.alertManagerUrl = alertManagerUrl
26
+ # sender's hostname is added as an annotation
27
+ self.hostname = socket.gethostname()
28
+ self.mgr = RequestHandler()
29
+ self.ltz = LocalTimezone()
30
+ self.headers = {"Content-Type": "application/json"}
31
+ self.validSeverity = ["high", "medium", "low"]
32
+ self.logger = logger if logger else logging.getLogger()
33
+
34
+ def sendAlert(self, alertName, severity, summary, description, service, tag="wmcore", endSecs=600, generatorURL=""):
35
+ """
36
+ :param alertName: a unique name for the alert
37
+ :param severity: low, medium, high
38
+ :param summary: a short description of the alert
39
+ :param description: a longer informational message with details about the alert
40
+ :param service: the name of the service firing an alert
41
+ :param tag: a unique tag used to help route the alert
42
+ :param endSecs: how many minutes until the alarm is silenced
43
+ :param generatorURL: this URL will be sent to AlertManager and configured as a clickable "Source" link in the web interface
44
+
45
+ AlertManager JSON format reference: https://www.prometheus.io/docs/alerting/latest/clients/
46
+ [
47
+ {
48
+ "labels": {
49
+ "alertname": "<requiredAlertName>",
50
+ "<labelname>": "<labelvalue>",
51
+ ...
52
+ },
53
+ "annotations": {
54
+ "<labelname>": "<labelvalue>",
55
+ ...
56
+ },
57
+ "startsAt": "<rfc3339>", # optional, will be current time if not present
58
+ "endsAt": "<rfc3339>",
59
+ "generatorURL": "<generator_url>" # optional
60
+ },
61
+ ]
62
+ """
63
+
64
+ if not self._isValidSeverity(severity):
65
+ return False
66
+
67
+ request = []
68
+ alert = {}
69
+ labels = {}
70
+ annotations = {}
71
+
72
+ # add labels
73
+ labels["alertname"] = alertName
74
+ labels["severity"] = severity
75
+ labels["tag"] = tag
76
+ labels["service"] = service
77
+ labels["uuid"] = makeUUID()
78
+ alert["labels"] = labels
79
+
80
+ # add annotations
81
+ annotations["hostname"] = self.hostname
82
+ annotations["summary"] = normalize_spaces(summary)
83
+ annotations["description"] = normalize_spaces(description)
84
+ alert["annotations"] = normalize_spaces(annotations)
85
+
86
+ # In python3 we won't need the LocalTimezone class
87
+ # Will change to d = datetime.now().astimezone() + timedelta(seconds=endSecs)
88
+ d = datetime.now(self.ltz) + timedelta(seconds=endSecs)
89
+ alert["endsAt"] = d.isoformat("T")
90
+ alert["generatorURL"] = generatorURL
91
+
92
+ request.append(alert)
93
+ # need to do this because pycurl_manager only accepts dict and encoded strings type
94
+ params = json.dumps(request)
95
+
96
+ # provide dump of alert send to AM which will allow to match it in WM logs
97
+ header, res = self.mgr.request(self.alertManagerUrl, params=params, headers=self.headers, verb='POST')
98
+ self.logger.info("ALERT: name=%s UUID=%s, HTTP status code=%s", alertName, labels["uuid"], header.status)
99
+
100
+ return res
101
+
102
+ def _isValidSeverity(self, severity):
103
+ """
104
+ Used to check if the severity of the alert matches the valid levels: low, medium, high
105
+ :param severity: severity of the alert
106
+ :return: True or False
107
+ """
108
+ if severity not in self.validSeverity:
109
+ logging.critical("Alert submitted to AlertManagerAPI with invalid severity: %s", severity)
110
+ return False
111
+ return True
File without changes
@@ -0,0 +1,238 @@
1
+ from __future__ import (division, print_function)
2
+
3
+ from builtins import zip, str, bytes
4
+
5
+ from future import standard_library
6
+ standard_library.install_aliases()
7
+
8
+ import json
9
+ import logging
10
+ import re
11
+ from urllib.parse import urlencode
12
+
13
+ from WMCore.Services.Service import Service
14
+
15
+
16
+ def unflattenJSON(data):
17
+ """Tranform input to unflatten JSON format"""
18
+ columns = data['desc']['columns']
19
+ return [row2dict(columns, row) for row in data['result']]
20
+
21
+
22
+ def row2dict(columns, row):
23
+ """Convert rows to dictionaries with column keys from description"""
24
+ robj = {}
25
+ for k, v in zip(columns, row):
26
+ robj.setdefault(k, v)
27
+ return robj
28
+
29
+
30
+ class CRIC(Service):
31
+ """
32
+ Class which provides client APIs to the CRIC service.
33
+ """
34
+
35
+ def __init__(self, url=None, logger=None, configDict=None):
36
+ """
37
+ configDict is a dictionary with parameters that are passed
38
+ to the super class
39
+ """
40
+ url = url or "https://cms-cric.cern.ch/"
41
+ configDict = configDict or {}
42
+ configDict.setdefault('endpoint', url)
43
+ configDict.setdefault('cacheduration', 1) # in hours
44
+ configDict.setdefault('accept_type', 'application/json')
45
+ configDict.setdefault('content_type', 'application/json')
46
+ configDict['logger'] = logger if logger else logging.getLogger()
47
+ super(CRIC, self).__init__(configDict)
48
+ self['logger'].debug("Initializing CRIC with url: %s", self['endpoint'])
49
+
50
+ def _getResult(self, uri, callname="", args=None, unflatJson=True):
51
+ """
52
+ Either fetch data from the cache file or query the data-service
53
+ :param metricNumber: a number corresponding to the SSB metric
54
+ :return: a dictionary
55
+ """
56
+ cachedApi = "%s.json" % callname
57
+ apiUrl = '%s?json&preset=%s' % (uri, callname)
58
+
59
+ self['logger'].debug('Fetching data from %s, with args %s', apiUrl, args)
60
+ # need to make our own encoding, otherwise Requests class screws it up
61
+ if args:
62
+ apiUrl = "%s&%s" % (apiUrl, urlencode(args, doseq=True))
63
+
64
+ data = self.refreshCache(cachedApi, apiUrl)
65
+ results = data.read()
66
+ data.close()
67
+
68
+ results = json.loads(results)
69
+ if unflatJson:
70
+ results = unflattenJSON(results)
71
+ return results
72
+
73
+ def _CRICUserQuery(self, callname, unflatJson=True):
74
+ """
75
+ :param callname: name of the call
76
+ :return: dict of the result
77
+ """
78
+
79
+ uri = "/api/accounts/user/query/"
80
+ userinfo = self._getResult(uri, callname=callname, unflatJson=unflatJson)
81
+ return userinfo
82
+
83
+ def _CRICSiteQuery(self, callname):
84
+ """
85
+ :param callname: name of the call
86
+ :return: dict of the result
87
+ """
88
+
89
+ uri = "/api/cms/site/query/"
90
+ extraArgs = {"rcsite_state": "ANY"}
91
+ sitenames = self._getResult(uri, callname=callname, args=extraArgs)
92
+ return sitenames
93
+
94
+ def whoAmI(self):
95
+ """
96
+ _whoAmI_
97
+
98
+ Given the authentication mechanism used for this request (x509 so far),
99
+ return information about myself, like DN/ roles/groups, etc
100
+ :return: a list of dictionary
101
+ """
102
+ return self._CRICUserQuery('whoami', unflatJson=False)['result']
103
+
104
+ def userNameDn(self, username):
105
+ """
106
+ _userNameDn_
107
+
108
+ Convert CERN Nice username to DN.
109
+ :param username: string with the username
110
+ :return: a string wit the user's DN
111
+ """
112
+ ### TODO: use a different cache file and try again if the user is still not there
113
+ userdn = ""
114
+ userinfo = self._CRICUserQuery('people')
115
+ for x in userinfo:
116
+ if x['username'] == username:
117
+ userdn = x['dn']
118
+ break
119
+ return userdn
120
+
121
+ def getAllPSNs(self):
122
+ """
123
+ _getAllPSNs_
124
+
125
+ Retrieve all PSNs (aka CMSNames) from CRIC
126
+ :return: a flat list of CMS site names
127
+ """
128
+
129
+ sitenames = self._CRICSiteQuery(callname='site-names')
130
+ cmsnames = [x['alias'] for x in sitenames if x['type'] == 'psn']
131
+ return cmsnames
132
+
133
+ def getAllPhEDExNodeNames(self, pattern=None, excludeBuffer=False):
134
+ """
135
+ _getAllPhEDExNodeNames_
136
+ Retrieve all PNNs from CRIC and filter them out if a pattern has been
137
+ provided.
138
+ :param pattern: a regex to be applied to filter the output
139
+ :param excludeBuffer: flag to exclude T1 Buffer endpoints
140
+ :return: a flat list of PNNs
141
+ """
142
+ sitenames = self._CRICSiteQuery(callname='site-names')
143
+
144
+ nodeNames = [x['alias'] for x in sitenames if x['type'] == 'phedex']
145
+ if excludeBuffer:
146
+ nodeNames = [x for x in nodeNames if not x.endswith("_Buffer")]
147
+ if pattern and isinstance(pattern, (str, bytes)):
148
+ pattern = re.compile(pattern)
149
+ nodeNames = [x for x in nodeNames if pattern.match(x)]
150
+ return nodeNames
151
+
152
+ def PNNstoPSNs(self, pnns):
153
+ """
154
+ Given a list of PNNs, return all their PSNs
155
+
156
+ :param pnns: a string or a list of PNNs
157
+ :return: a list with unique PSNs matching those PNNs
158
+ """
159
+ mapping = self._CRICSiteQuery(callname='data-processing')
160
+
161
+ if isinstance(pnns, (str, bytes)):
162
+ pnns = [pnns]
163
+
164
+ psns = set()
165
+ for pnn in pnns:
166
+ psnSet = set()
167
+ for item in mapping:
168
+ if pnn == item['phedex_name']:
169
+ psnSet.add(item['psn_name'])
170
+ if psnSet:
171
+ psns.update(psnSet)
172
+ else:
173
+ self["logger"].debug("No PSNs for PNN: %s" % pnn)
174
+ return list(psns)
175
+
176
+ def PSNstoPNNs(self, psns, allowPNNLess=False):
177
+ """
178
+ Given a list of PSNs, return all their PNNs
179
+
180
+ :param psns: a string or a list of PSNs
181
+ :param allowPNNLess: flag to return the PSN as a PNN if no match
182
+ :return: a list with unique PNNs matching those PSNs
183
+ """
184
+ mapping = self._CRICSiteQuery(callname='data-processing')
185
+
186
+ if isinstance(psns, (str, bytes)):
187
+ psns = [psns]
188
+
189
+ pnns = set()
190
+ for psn in psns:
191
+ pnnSet = set()
192
+ for item in mapping:
193
+ if item['psn_name'] == psn:
194
+ pnnSet.add(item['phedex_name'])
195
+ if pnnSet:
196
+ pnns.update(pnnSet)
197
+ elif allowPNNLess:
198
+ pnns.add(psn)
199
+ self["logger"].debug("PSN %s has no PNNs. PNNLess flag enabled though.", psn)
200
+ else:
201
+ self["logger"].debug("No PNNs for PSN: %s" % psn)
202
+ return list(pnns)
203
+
204
+ def PSNtoPNNMap(self, psnPattern=''):
205
+ """
206
+ Given a PSN regex pattern, return a map of PSN to PNNs
207
+ :param psnPattern: a pattern string
208
+ :return: a dictionary key'ed by PSN names, with sets of PNNs as values
209
+ """
210
+ if not isinstance(psnPattern, (str, bytes)):
211
+ raise TypeError('psnPattern argument must be of type str or bytes')
212
+
213
+ results = self._CRICSiteQuery(callname='data-processing')
214
+ mapping = {}
215
+
216
+ psnPattern = re.compile(psnPattern)
217
+ for entry in results:
218
+ if psnPattern.match(entry['psn_name']):
219
+ mapping.setdefault(entry['psn_name'], set()).add(entry['phedex_name'])
220
+ return mapping
221
+
222
+ def PNNtoPSNMap(self, pnnPattern=''):
223
+ """
224
+ Given a PNN regex pattern, return a map of PNN to PSNs
225
+ :param pnnPattern: a pattern string
226
+ :return: a dictionary key'ed by PNN names, with sets of PSNs as values
227
+ """
228
+ if not isinstance(pnnPattern, (str, bytes)):
229
+ raise TypeError('pnnPattern argument must be of type str or bytes')
230
+
231
+ results = self._CRICSiteQuery(callname='data-processing')
232
+ mapping = {}
233
+
234
+ pnnPattern = re.compile(pnnPattern)
235
+ for entry in results:
236
+ if pnnPattern.match(entry['phedex_name']):
237
+ mapping.setdefault(entry['phedex_name'], set()).add(entry['psn_name'])
238
+ return mapping
File without changes