X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fsenslab%2FOARrestapi.py;h=a073b67a59215765f5a567269b876b0ace314dcf;hb=03dc21a0ac95b4fbe8c950c8dc052955d281cc44;hp=1769f1fcdeb6a2670452a51e30f7cee55c021bac;hpb=8475bb45b6de453336946885435ff323606c1d47;p=sfa.git diff --git a/sfa/senslab/OARrestapi.py b/sfa/senslab/OARrestapi.py index 1769f1fc..a073b67a 100644 --- a/sfa/senslab/OARrestapi.py +++ b/sfa/senslab/OARrestapi.py @@ -21,6 +21,9 @@ OARrequests_uri_list = ['/oarapi/version.json','/oarapi/timezone.json', '/oarapi OARrequests_get_uri_dict = { 'GET_version': '/oarapi/version.json', 'GET_timezone':'/oarapi/timezone.json' , 'GET_jobs': '/oarapi/jobs.json', + 'GET_jobs': '/oarapi/jobs/id.json', + 'GET_jobs/resources': '/oarapi/jobs/id/resources.json', + 'GET_resources/': '/oarapi/resources/.json', 'GET_jobs_table': '/oarapi/jobs/table.json', 'GET_jobs_details': '/oarapi/jobs/details.json', 'GET_resources_full': '/oarapi/resources/full.json', @@ -44,8 +47,12 @@ class OARrestapi: self.oarserver['uri'] = None self.oarserver['postformat'] = 'json' - def GETRequestToOARRestAPI(self, request ): + def GETRequestToOARRestAPI(self, request, strval=None ): self.oarserver['uri'] = OARrequests_get_uri_dict[request] + if strval: + self.oarserver['uri'] = self.oarserver['uri'].replace("id",strval) + print>>sys.stderr, "\r\n \r\n GETRequestToOARRestAPI replace : self.oarserver['uri'] %s", self.oarserver['uri'] + try : conn = httplib.HTTPConnection(self.oarserver['ip'],self.oarserver['port']) conn.request("GET",self.oarserver['uri'] )