Skip to content
Snippets Groups Projects
Commit ee69c97f authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix rapi job listing

This patch fixes a couple of issues with the job listing:
  - in case of a non-existing job, nicely raise 404 instead of 500
  - in the job detail listing, also list the job log, the job
    timestamps, etc.
  - the opcode migrate instance was missing its description field

Reviewed-by: imsnah
parent 2ed6a7d6
No related branches found
No related tags found
No related merge requests found
......@@ -423,6 +423,7 @@ class OpMigrateInstance(OpCode):
"""
OP_ID = "OP_INSTANCE_MIGRATE"
OP_DSC_FIELD = "instance_name"
__slots__ = ["instance_name", "live", "cleanup"]
......
......@@ -154,9 +154,14 @@ class R_2_jobs_id(baserlib.R_Generic):
- opresult: OpCodes results as a list of lists
"""
fields = ["id", "ops", "status", "opstatus", "opresult"]
fields = ["id", "ops", "status", "summary",
"opstatus", "opresult", "oplog",
"received_ts", "start_ts", "end_ts",
]
job_id = self.items[0]
result = luxi.Client().QueryJobs([job_id, ], fields)[0]
if result is None:
raise http.HttpNotFound()
return baserlib.MapFields(fields, result)
def DELETE(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment