@@ -25,7 +25,7 @@ class JobEndpoints(EntitySetEndpointsMixin, EntityEndpoint):
25
25
26
26
def __init__ (self , host , port , account_id , auth_token , version = DEFAULT_API_VERSION , secure = SECURE , ** kwargs ):
27
27
super (JobEndpoints , self ).__init__ (host , port , account_id , auth_token , version , secure , ** kwargs )
28
- self .name = ' jobs'
28
+ self .name = " jobs"
29
29
30
30
def submit (self , id_ ):
31
31
"""
@@ -34,7 +34,7 @@ def submit(self, id_):
34
34
Args:
35
35
id_ (str): job ID.
36
36
"""
37
- self .request (' POST' , '/' .join ((self .name , id_ , "submit" )), headers = self .headers )
37
+ self .request (" POST" , "/" .join ((self .name , id_ , "submit" )), headers = self .headers )
38
38
39
39
def purge (self , id_ ):
40
40
"""
@@ -43,7 +43,7 @@ def purge(self, id_):
43
43
Args:
44
44
id_ (str): job ID.
45
45
"""
46
- self .request (' POST' , '/' .join ((self .name , id_ , "submit" )), headers = self .headers )
46
+ self .request (" POST" , "/" .join ((self .name , id_ , "submit" )), headers = self .headers )
47
47
48
48
def terminate (self , id_ ):
49
49
"""
@@ -52,7 +52,7 @@ def terminate(self, id_):
52
52
Args:
53
53
id_ (str): job ID.
54
54
"""
55
- self .request (' POST' , '/' .join ((self .name , id_ , "submit" )), headers = self .headers )
55
+ self .request (" POST" , "/" .join ((self .name , id_ , "submit" )), headers = self .headers )
56
56
57
57
def get_config (self , material_ids , workflow_id , project_id , owner_id , name , compute = None , is_multi_material = False ):
58
58
"""
@@ -71,16 +71,10 @@ def get_config(self, material_ids, workflow_id, project_id, owner_id, name, comp
71
71
dict
72
72
"""
73
73
config = {
74
- "_project" : {
75
- "_id" : project_id
76
- },
77
- "workflow" : {
78
- "_id" : workflow_id
79
- },
80
- "owner" : {
81
- "_id" : owner_id
82
- },
83
- "name" : name
74
+ "_project" : {"_id" : project_id },
75
+ "workflow" : {"_id" : workflow_id },
76
+ "owner" : {"_id" : owner_id },
77
+ "name" : name ,
84
78
}
85
79
86
80
if compute :
@@ -112,10 +106,8 @@ def get_compute(self, cluster, ppn=1, nodes=1, queue="D", time_limit="01:00:00",
112
106
"queue" : queue ,
113
107
"timeLimit" : time_limit ,
114
108
"notify" : notify ,
115
- "cluster" : {
116
- "fqdn" : cluster
117
- },
118
- "arguments" : {}
109
+ "cluster" : {"fqdn" : cluster },
110
+ "arguments" : {},
119
111
}
120
112
121
113
def create_by_ids (self , materials , workflow_id , project_id , owner_id , prefix , compute = None ):
@@ -152,7 +144,7 @@ def get_presigned_urls(self, id_, files):
152
144
list: [{"file": "", "URL": ""}]
153
145
"""
154
146
data = json .dumps ({"files" : files })
155
- response = self .request (' POST' , '/' .join ((self .name , id_ , "presigned-urls" )), data = data , headers = self .headers )
147
+ response = self .request (" POST" , "/" .join ((self .name , id_ , "presigned-urls" )), data = data , headers = self .headers )
156
148
return response ["presignedURLs" ]
157
149
158
150
def list_files (self , id_ ):
@@ -166,7 +158,7 @@ def list_files(self, id_):
166
158
list: [{ "key" : str, "size" : int, "bucket" : str, "region" : str,
167
159
"provider" : str, "lastModified" : int, "name" : str, "signedURL" : str }]
168
160
"""
169
- response = self .request (' GET' , '/' .join ((' jobs' , id_ , ' files' )), headers = self .headers )
161
+ response = self .request (" GET" , "/" .join ((" jobs" , id_ , " files" )), headers = self .headers )
170
162
return response
171
163
172
164
def insert_output_files (self , id_ , data ):
0 commit comments