Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CondCore
Utilities
python
CondDBFW
examples
json_test.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
"""
3
4
Example script to show returning data as json.
5
6
"""
7
8
import
sys
9
from
CondCore.Utilities.CondDBFW
import
querying_framework_api
10
11
class
query_script
():
12
def
script
(self, connection):
13
tags = connection.tag().
all
(amount=sys.argv[1])
14
return
tags
15
16
connection_data = {
"db_alias"
:
"orapro"
,
"schema"
:
"cms_conditions"
,
"host"
:
"oracle"
,
"secrets"
:
"/afs/cern.ch/cms/DB/conddb/.cms_cond/netrc"
}
17
qf = querying_framework_api(connection_data)
18
data = qf.run_script(
query_script
()).as_dicts()
19
20
import
pprint
21
pprint.pprint(data)
json_test.query_script
Definition:
json_test.py:11
json_test.query_script.script
def script
Definition:
json_test.py:12
Vispa.Plugins.EdmBrowser.EdmDataAccessor.all
def all
Definition:
EdmDataAccessor.py:18
Generated for CMSSW Reference Manual by
1.8.5