API endpoint to see any pending build

Hi all,

I'm looking for a way to see if there is any pending build.

I was dreaming to see this in :
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/ci/api/builds.md

The doc say "Runs oldest pending build by runner"... but when i try a curl request with :

curl -s --header "PRIVATE-TOKEN: MyGitlabToken_OrRunnerToken" "https://gitlabtest.myorg.com/ci/api/v1/builds/register"

The result is always empty... how can i use this ? My use case is to check if there is any pending build, and only launch a runner in this case (don't want to have "permanent" runners).

Thx in advance :)

Assignee Loading
Time tracking Loading