OARIP ='194.199.16.161'
+
+OARrequests_get_uri_dict = { 'GET_version': '/oarapi/version.json',
+ 'GET_timezone':'/oarapi/timezone.json' ,
+ 'GET_jobs': '/oarapi/jobs.json',
+ 'GET_jobs_id': '/oarapi/jobs/id.json',
+ 'GET_jobs_id_resources': '/oarapi/jobs/id/resources.json',
+ 'GET_resources_id': '/oarapi/resources/id.json',
+ 'GET_jobs_table': '/oarapi/jobs/table.json',
+ 'GET_jobs_details': '/oarapi/jobs/details.json',
+ 'GET_reserved_nodes': '/oarapi/jobs/details.json?state=Running,Waiting,Launching',
+ 'GET_running_jobs': '/oarapi/jobs/details.json?state=Running',
+ 'GET_resources_full': '/oarapi/resources/full.json',
+ 'GET_resources':'/oarapi/resources.json',
+ 'GET_sites' : '/oarapi/resources/full.json',
+ }
+
++
++
+
OARrequest_post_uri_dict = { 'POST_job':{'uri': '/oarapi/jobs.json'},
'DELETE_jobs_id':{'uri':'/oarapi/jobs/id.json'},
}
def ParseReservedNodes(self):
print>>sys.stderr, " \r\n \t\t\t ParseReservedNodes__________________________ "
#resources are listed inside the 'items' list from the json
- return self.raw_json
+ nodes=[]
+ for job in self.raw_json['items']:
+ for node in job['nodes']:
+ nodes.append(node['network_address'])
+ return nodes
+ def ParseRunningJobs(self):
+ print>>sys.stderr, " \r\n \t\t\t ParseRunningJobs__________________________ "
+ #resources are listed inside the 'items' list from the json
+ return self.raw_json
+
+
def ParseDeleteJobs(self):
return
def GetReservedNodes(self):
# this function returns a list of all the nodes already involved in an oar job
- jobs = self.oar.parser.SendRequest("GET_running_jobs")
- print>>sys.stderr, "\r\n \r\n GetReservedNodes jobs %s" %(jobs)
- #jobs=self.oar.parser.SendRequest("GET_jobs_details")
- nodes = []
- if jobs['total'] == 0:
- return []
++
++
++
++
++
++
++
+
- for j in jobs :
- nodes = j['assigned_network_address']+nodes
- return nodes
++
++
++
++
+ return self.oar.parser.SendRequest("GET_reserved_nodes")
++
def GetNodes(self,node_filter_dict = None, return_fields_list = None):
"""