test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
search.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import datetime
4 import sys
5 
6 if __name__ == "__main__":
7  # this class should extend a framework base class that
8  # provides default implementations of important methods
9  import sys
10  sys.path.append("../")
11  from CondCore.Utilities.CondDBFW import querying_framework_api
12  import CondCore.Utilities.CondDBFW.data_sources, CondCore.Utilities.CondDBFW.data_formats as format
13  from CondCore.Utilities.CondDBFW.querying import connect
14 
15  class query_script():
16 
17  def script(self, connection):
18  everything = connection.search_everything(sys.argv[1])
19  return everything
20 
21  secrets_file = "/afs/cern.ch/cms/DB/conddb/.cms_cond/netrc"
22  secrets_file_1 = "netrc_test"
23 
24  connection_data = {"db_alias" : "orapro", "host" : "oracle", "schema" : "cms_conditions", "secrets" : secrets_file}
25  qf = querying_framework_api(connection_data)
26  data = qf.run_script(query_script())
27 
28  data.get("global_tags").as_table()
29  data.get("tags").as_table()
30  data.get("iovs").as_table()
31  data.get("payloads").as_table()