Skip to content

Commit eafd0ca

Browse files
add job list method
1 parent def8560 commit eafd0ca

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

sdk/diffgram/job/job.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,30 @@ def new(self,
241241
return job
242242

243243

244+
def list(self,
245+
limit=10,
246+
status="All"):
247+
248+
# Example usage print(project.job.list().json())
249+
250+
endpoint = "/api/v1/job/list"
251+
252+
request_json_body = {"metadata":
253+
{
254+
"limit": limit,
255+
"status": status,
256+
"project_string_id": self.client.project_string_id
257+
}
258+
}
259+
260+
response = self.client.session.post(
261+
self.client.host + endpoint,
262+
json=request_json_body)
263+
264+
self.client.handle_errors(response)
265+
266+
return response
267+
244268

245269
def launch(
246270
self

0 commit comments

Comments
 (0)