CMS 3D CMS Logo

Classes | Functions | Variables
query Namespace Reference

Classes

class  DDOptionParser
 

Functions

def sendMessage (host, port, dbsInst, userInput, page, limit, xml=0, case='on', iface='dd', details=0, cff=0, debug=0)
 

Variables

 args
 
string dbsInst = "cms_dbs_prod_global"
 
string host = "cmsweb.cern.ch/dbs_discovery/"
 
 input = open(opts.input,'r').readline()
 
 optManager = DDOptionParser()
 
 opts
 
int port = 443
 
def result = sendMessage(host,port,dbsInst,input,opts.page,opts.limit,opts.xml,opts.case,opts.iface,opts.details,opts.cff,opts.verbose)
 

Function Documentation

◆ sendMessage()

def query.sendMessage (   host,
  port,
  dbsInst,
  userInput,
  page,
  limit,
  xml = 0,
  case = 'on',
  iface = 'dd',
  details = 0,
  cff = 0,
  debug = 0 
)
   Send message to server, message should be an well formed XML document.

Definition at line 52 of file query.py.

52 def sendMessage(host,port,dbsInst,userInput,page,limit,xml=0,case='on',iface='dd',details=0,cff=0,debug=0):
53  """
54  Send message to server, message should be an well formed XML document.
55  """
56  if xml: xml=1
57  else: xml=0
58  if cff: cff=1
59  else: cff=0
60  input=urllib.quote(userInput)
61  if debug:
62  httplib.HTTPConnection.debuglevel = 1
63  print("Contact",host,port)
64  _port=443
65  if host.find("http://")!=-1:
66  _port=80
67  if host.find("https://")!=-1:
68  _port=443
69  host=host.replace("http://","").replace("https://","")
70  if host.find(":")==-1:
71  port=_port
72  prefix_path=""
73  if host.find("/")!=-1:
74  hs=host.split("/")
75  host=hs[0]
76  prefix_path='/'.join(hs[1:])
77  if host.find(":")!=-1:
78  host,port=host.split(":")
79  port=int(port)
80 # print "\n\n+++",host,port
81  if port==443:
82  http_conn = httplib.HTTPS(host,port)
83  else:
84  http_conn = httplib.HTTP(host,port)
85  if details: details=1
86  else: details=0
87  path='/aSearch?dbsInst=%s&html=0&caseSensitive=%s&_idx=%s&pagerStep=%s&userInput=%s&xml=%s&details=%s&cff=%s&method=%s'%(dbsInst,case,page,limit,input,xml,details,cff,iface)
88  if prefix_path:
89  path="/"+prefix_path+path[1:]
90  http_conn.putrequest('POST',path)
91  http_conn.putheader('Host',host)
92  http_conn.putheader('Content-Type','text/html; charset=utf-8')
93  http_conn.putheader('Content-Length',str(len(input)))
94  http_conn.endheaders()
95  http_conn.send(input)
96 
97  (status_code,msg,reply)=http_conn.getreply()
98  data=http_conn.getfile().read()
99  if debug or msg!="OK":
100  print()
101  print(http_conn.headers)
102  print("*** Send message ***")
103  print(input)
104  print("************************************************************************")
105  print("status code:",status_code)
106  print("message:",msg)
107  print("************************************************************************")
108  print(reply)
109  return data
110 
111 #
112 # main
113 #

References createfilelist.int, join(), print(), readEcalDQMStatus.read, python.rootplot.root2matplotlib.replace(), and str.

Variable Documentation

◆ args

query.args

Definition at line 119 of file query.py.

◆ dbsInst

query.dbsInst = "cms_dbs_prod_global"

Definition at line 117 of file query.py.

◆ host

string query.host = "cmsweb.cern.ch/dbs_discovery/"

Definition at line 115 of file query.py.

Referenced by edm::service::SiteLocalConfigService.computeStatisticsDestination(), DTCtcp.Connect(), DQMService.DQMService(), EcalTPGParamReaderFromDB.EcalTPGParamReaderFromDB(), dqm::DQMFileSaverPB.fillJson(), dqmfilesaver.fillJson(), XrdAdaptor::Source.getDomain(), XrdAdaptor::Source.getHostname(), popcon::RpcDataUXC.getNewObjects(), popcon::RPCObPVSSmapData.getNewObjects(), popcon::RpcDataI.getNewObjects(), popcon::RpcDataS.getNewObjects(), popcon::RpcObGasData.getNewObjects(), popcon::RpcDataT.getNewObjects(), popcon::RpcDataV.getNewObjects(), popcon::RpcDataFebmap.getNewObjects(), popcon::RpcDataGasMix.getNewObjects(), CSCGeometryESModule.initCSCGeometry_(), DQMNet.listenToCollector(), RPCInverseOMTFLinkMapESProducer.produce(), RPCInverseCPPFLinkMapESProducer.produce(), RPCInverseTwinMuxLinkMapESProducer.produce(), RPCInverseLBLinkMapESProducer.produce(), EcalSeverityLevelESProducer.produce(), EcalNextToDeadChannelESProducer.produce(), EcalLaserCorrectionService.produce(), EcalLaserCorrectionServiceMC.produce(), HcalDbProducer.produce(), HcalTPGCoderULUT.produce(), CastorDbProducer.produce(), CSCGeometryESModule.produce(), DTGeometryESModule.produce(), DTGeometryESProducer.produce(), FFTJetLookupTableESProducer< CT >.produce(), FFTJetCorrectionESProducer< CT >.produce(), HcalDbProducer.serviceSetData(), DTGeometryESModule.setupDBGeometry(), DTGeometryESModule.setupDD4hepGeometry(), DTGeometryESModule.setupDDDGeometry(), DTGeometryESProducer.setupGeometry(), HcalDbProducer::ServiceTokenImpl< ProductType, RecordType, LABEL, EffectiveType >.setupHcalDbService(), HcalDbProducer::TokensForServiceHolder< RecordType, TokenHolders >.setupHcalDbService(), and DQMNet.updateToCollector().

◆ input

query.input = open(opts.input,'r').readline()

Definition at line 132 of file query.py.

◆ optManager

query.optManager = DDOptionParser()

Definition at line 118 of file query.py.

◆ opts

query.opts

Definition at line 119 of file query.py.

◆ port

int query.port = 443

◆ result

def query.result = sendMessage(host,port,dbsInst,input,opts.page,opts.limit,opts.xml,opts.case,opts.iface,opts.details,opts.cff,opts.verbose)

Definition at line 138 of file query.py.

join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
str
#define str(s)
Definition: TestProcessor.cc:52
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
createfilelist.int
int
Definition: createfilelist.py:10
query.sendMessage
def sendMessage(host, port, dbsInst, userInput, page, limit, xml=0, case='on', iface='dd', details=0, cff=0, debug=0)
Definition: query.py:52
readEcalDQMStatus.read
read
Definition: readEcalDQMStatus.py:38
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444