Mailing List Archives
Public Access
|
|
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Condor-users] Trouble with getJobAds in SOAP interface
- Date: Mon, 29 Aug 2005 09:24:19 -0700
- From: "David E. Konerding" <dekonerding@xxxxxxx>
- Subject: [Condor-users] Trouble with getJobAds in SOAP interface
Hi,
I am trying to use the SOAP interface (Condor-6.7.10) with Python. I've
got everything set up, I can submit jobs, etc, but
when I try to call GetJobsAds with a constraint that contains && it fails.
The docs for GetJobAd and GetJobAds say that GetJobAd(transaction,
clutsterId, jobId) is equivalent
to GetJobAds(transaction, constraint) with a constraint of "(ClusterId
== clusterId && JobId == jobId)"
Note: I have to use ProcId, not JobId because that's what the job's
ClassAd contains
I can submit a GetJobAds with a contrainst of (ClusterId == clusterId)
and it works just fine.
So do a constraint of (ProcId == procId). But when I submit a constraint
of "(ClusterId == clusterId && JobId == jobId)", I get back a None
instead of a class ad, even though the operation was successful.
I can run condor_q -constraint "(ClusterId == clusterId && JobId ==
jobId)" without problems.
My suspicion is that url decoding of the && isn't being done by the
Condor SOAP server, although that does seem unlikely!
Here is the Python program I used to test it;
from getpass import getuser
import sys, string, time
from condorSchedd_services import *
from condorCollector_services import *
class JobWatcher:
def __init__(self, schedd):
self._schedd = schedd
def getJobAdTest(self):
request = getJobAdsRequest()
request._constraint = "ClusterId==156 && ProcId==10"
response = self._schedd.getJobAds(request)
print "Jobs"
clusterId = None
procId = None
if response._response._classAdArray is None:
print "No jobs matched the classAdArray constraint!"
else:
print len(response._response._classAdArray._item)
class collector:
def __init__(self, address):
self._address = address
collectorLocator = condorCollectorLocator()
self._collector =
collectorLocator.getcondorCollectorPortType(self._address)
def queryScheddAds(self):
request = queryScheddAdsRequest()
request._constraint = "HasSOAPInterface=?=TRUE"
response = self._collector.queryScheddAds(request)
for attr in response._result._item[0]._item:
if attr._name == "MyAddress":
address = string.split(string.split(attr._value,
"<")[1], ">")[0]
elif attr._name == "Name":
name = attr._value
return name, address
class schedd:
def __init__(self, address):
self._address = address
location = condorScheddLocator()
self._schedd = location.getcondorScheddPortType("http://" +
self._address)
if __name__ == '__main__':
collector_url = "http://bosshog.lbl.gov:9618"
c = collector(collector_url)
name, address = c.queryScheddAds()
schedd = schedd(address)
jw = JobWatcher(schedd._schedd)
print "getting job ads"
jw.getJobAdTest()
Dave