overwatch icon indicating copy to clipboard operation
overwatch copied to clipboard

[FEAT] - Missing job failed details in audit log

Open mohanbaabu1996 opened this issue 3 years ago • 0 comments

The detailed job run failures are not available in the audit data.

To Do: Calling an API with task_run_id or run_id as parameter to get the failure message.

def job_error(self, runid):
        self.run_id = runid
        self.url = f"https://{self.host_name}/api/2.1/jobs/runs/get-output?run_id={self.run_id}"
        response = requests.get(self.url, headers=self.headers)
        try:
            output = response.json()["error"]
            return output
        except KeyError:
            return "No Error message found"
        except Exception as e:
            print(f"An exception occurred : {e}")

mohanbaabu1996 avatar Dec 20 '22 11:12 mohanbaabu1996