3 |
# |
# |
4 |
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012 |
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012 |
5 |
# |
# |
6 |
# License GPL Version 3 |
# License Apache Software |
7 |
# |
# |
8 |
# The research leading to these results has received funding from |
# The research leading to these results has received funding from |
9 |
# the European Community's Seventh Framework Programme (FP7/2007-2013) |
# the European Community's Seventh Framework Programme (FP7/2007-2013) |
17 |
|
|
18 |
|
|
19 |
class sub: |
class sub: |
20 |
"""Envia trabajos. Input: usr, passwd, json, theurl |
"""Submit request. Input: usr, passwd, json, theurl |
21 |
Output: Lista de trabajos enviados""" |
Output: List of request""" |
22 |
|
|
23 |
def _init_(self, user, passwd): |
def _init_(self, user, passwd): |
24 |
self.user = user |
self.user = user |
26 |
|
|
27 |
|
|
28 |
def submit(self, theurl, exp): |
def submit(self, theurl, exp): |
29 |
"""Envia el trabajo descrito en json. Input: exp, user, passwd""" |
"""Submit JSON. Input: exp, user, passwd""" |
30 |
|
|
31 |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
32 |
h.add_credentials(self.user, self.passwd) |
h.add_credentials(self.user, self.passwd) |
38 |
return content |
return content |
39 |
|
|
40 |
def submit_xml(self, theurl, name, instance, disk, net, loc): |
def submit_xml(self, theurl, name, instance, disk, net, loc): |
41 |
"""Add un compute nuevo al experimento definido en xml. Input: compute_xml, user, passwd""" |
"""Add one compute defined in xml. Input: compute_xml, user, passwd""" |
42 |
|
|
43 |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
44 |
h.add_credentials(self.user, self.passwd) |
h.add_credentials(self.user, self.passwd) |
63 |
|
|
64 |
|
|
65 |
def log(self, url_log): |
def log(self, url_log): |
66 |
"""Obtiene info de la url de log que se obtiene en submit. Input: url_log, user, passwd""" |
"""GET the URL log. Input: url_log, user, passwd""" |
67 |
|
|
68 |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
69 |
h.add_credentials(self.user, self.passwd) |
h.add_credentials(self.user, self.passwd) |
88 |
|
|
89 |
|
|
90 |
def computes(self, url_log): |
def computes(self, url_log): |
91 |
"""Obtiene info de los computes del experimento. Input: url_log""" |
"""Get info of experiment compute nodes. Input: url_log""" |
92 |
|
|
93 |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
94 |
h.add_credentials(self.user, self.passwd) |
h.add_credentials(self.user, self.passwd) |
99 |
|
|
100 |
|
|
101 |
def delete(self, url_del): |
def delete(self, url_del): |
102 |
"""Borra el trabajo descrito en json. Input: url_del, user, passwd""" |
"""Delete experiment. Input: url_del, user, passwd""" |
103 |
|
|
104 |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
h = httplib2.Http(disable_ssl_certificate_validation=True) |
105 |
h.add_credentials(self.user, self.passwd) |
h.add_credentials(self.user, self.passwd) |