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
 
 dbsInst
 
 host
 
 input
 
 optManager
 
 opts
 
 port
 
 result
 

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(), edm.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

Definition at line 117 of file query.py.

◆ host

query.host

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::RPCObPVSSmapData.getNewObjects(), popcon::RpcDataI.getNewObjects(), popcon::RpcDataS.getNewObjects(), popcon::RpcDataUXC.getNewObjects(), popcon::RpcObGasData.getNewObjects(), popcon::RpcDataT.getNewObjects(), popcon::RpcDataV.getNewObjects(), popcon::RpcDataFebmap.getNewObjects(), popcon::RpcDataGasMix.getNewObjects(), CSCGeometryESModule.initCSCGeometry_(), DQMNet.listenToCollector(), RPCInverseCPPFLinkMapESProducer.produce(), RPCInverseLBLinkMapESProducer.produce(), RPCInverseOMTFLinkMapESProducer.produce(), RPCInverseTwinMuxLinkMapESProducer.produce(), EcalSeverityLevelESProducer.produce(), EcalLaserCorrectionService.produce(), EcalNextToDeadChannelESProducer.produce(), EcalLaserCorrectionServiceMC.produce(), HcalDbProducer.produce(), CastorDbProducer.produce(), HcalTPGCoderULUT.produce(), DTGeometryESModule.produce(), CSCGeometryESModule.produce(), DTGeometryESProducer.produce(), FFTJetLookupTableESProducer< CT >.produce(), FFTJetCorrectionESProducer< CT >.produce(), HcalDbProducer.serviceSetData(), DTGeometryESModule.setupDBGeometry(), DTGeometryESModule.setupGeometry(), DTGeometryESProducer.setupGeometry(), HcalDbProducer::ServiceTokenImpl< ProductType, RecordType, LABEL, EffectiveType >.setupHcalDbService(), HcalDbProducer::TokensForServiceHolder< RecordType, TokenHolders >.setupHcalDbService(), and DQMNet.updateToCollector().

◆ input

query.input

Definition at line 132 of file query.py.

◆ optManager

query.optManager

Definition at line 118 of file query.py.

◆ opts

query.opts

Definition at line 119 of file query.py.

◆ port

query.port

◆ result

query.result

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:48
createfilelist.int
int
Definition: createfilelist.py:10
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
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