Reading task details through API

Hi,

I’m trying to query the Octopus API for details about our failed deployments, information that we want to use for both statistical reasons and to “feed” our own dashboard. Most importantly I need to be able to group similar errors together, by their error message, but also taking the deployment step that has raised the error.

So far I’ve been looking at this method: /api/tasks/ServerTasks-520201/details{?verbose,tail}, which gives me most of the information that I need, but in a way that doesn’t allow me to easily process it. It returns data for the GUI, not to be processed for other reasons.

Question is, is there another way to get the information that I need? Based a ServerTaskId, get the a strongly structured description of the process:

  • identifiable nodes, e.g. task, environment, machine, etc.
  • precise status, i.e. which task is waiting for an interruption
  • unprocessed output from that particular point of failure. I know I can read the “raw” version of the log, but AFAIK only for the entire process, which is even harder to process.

Regards,
~Victor

Hi Victor,

Thanks for getting in touch! What we store is in the log file you get back, and that’s all we have. There’s no linkage back to original machines and steps, unfortunately. Maybe an alternative would be to hit the deployments API, something like: /api/deployments?environments=Environments-ID&projects=Projects-ID&taskState=Failed

We have some other resources that you might be interested in. The following doc page has some code samples.

A couple sample scripts that might do something similar to what you’re after.


Probably not what you’re looking for but thought I’d bring up our reporting feature which allows you to consume raw data to build deployment reports in something like excel. You can read about that in the following doc page.

I hope something there helps get you going! Let me know what you think, or if you have any further questions. :slight_smile:

Best regards,

Kenny

Hi Kenny,

I appreciate the effort that you put into your response. I’ll go over the resources that you provided, but it doesn’t seem that it I will find what I need. I might have to go directly to the database for this.

In any case, thanks for the help.

Regards,
~Victor

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.