Public REST API?

Are there any plans for making a public, documented REST API for concourse?
I tried out implementing a small python concourse lib for which I used [1] as reference.
Unfortunately it seems like the API is not that stable and also the authentication feels quite hacky…

Background is that we have concourse instances running in multiple landscapes and would like to have a single dashboard to see failed builds etc. . I could you use the fly CLI but I would like to avoid using binaries and instead use a REST API.

[1] https://github.com/concourse/concourse/blob/master/atc/routes.go

2 Likes

This is something that has been on the radar for a while but hasn’t happened yet. That routes.go you linked is the best “documentation” of the API that I’ve ever been able to find. Someone from the Concourse team may be able to give you a better answer on whether this is something that is coming soon. (ping @vito)

It isn’t quite what you’re looking for but I’ve worked with client who use go-concourse-summary to monitor their various Concourses (Concii?).

1 Like

/api/v1/teams/myteam/pipelines/demo-contact-service-test/config - Invoked this api using the Bearer token copied from: https://ci.myconcourse.net/fly_success?fly_port=52233 but I get 401 - Unauthorized. How do we get past this issue now?

How are you passing the token to it?

On Concourse 6 it works for me if I run curl -H "Authorization: Bearer $token" https://my-concourse/api/v1/teams/main/pipelines/pipeline/config using the token for my target from my ~/.flyrc.

If you’re on Concourse 5+ then you can use the fly curl command to handle the auth for you.

I tried login via Postman after copying the token using “Copy to clipboard” button.

@crsimmons: Could you please help me with steps you tried to get this working.

I logged in with fly then copied the token from ~/.flyrc and did the curl command in my previous post.

Hi @crsimmons,

i think the token used to change everytime in ~/.flyrc file, whenever the we use to login with fly again and again. I am trying to automate of triggering the concourse pipeline, based on some other conditions(outside concourse box), so i need to trigger the pipeline with some rest API.
in the mean course, Did you come across any rest API to trigger the builds without juggling of this token(or manual interaction)

Regards,
AG143.

I’m not aware of any way to auth with the API other than the token. I don’t think API-driven workflows is something the Concourse team is working on either.

The canonical way to trigger jobs in Concourse is via resources anyway. You may find it easier to configure something like an S3 bucket or a git repo as resources which are trigger: true for the jobs you want to trigger. Then when you change those resources the jobs will start.