1.19 failed build API endoint

Foreman 1.19 introduced a new feature: https://projects.theforeman.org/issues/21007

How exactly do I use it in a template? foreman_url(‘fail’)? foreman_url(‘built’,‘fail’,message=>‘sometext’)?

Thank you in advance.

Sorry for bumping this, I got it to work and here’s how if anyone wonders…

Knowledge source:
https://projects.theforeman.org/projects/foreman/repository/revisions/671107663166f18c102eb61f3f865186234e0cf0/diff/config/routes.rb

Sample usage:

failed_endpoint=<%= foreman_url(‘failed’) %>
curl -X POST -H ‘Content-Type: text/plain’ --data “fail report content” $failed_endpoint

cheers

1 Like