Search all running jobs by meta tag/label, how?

I have created a job via docker plugin. I have added the following labels,

"labels": [
                "mode": "normal",
                "username": "brad1",
                "level": "1"

I need a way via the api to return all the jobs that are in “mode: normal” or “level:1”. I can see a way to do it by chaining a bunch of calls, however I am looking to see if there is a native api way of doing this? I can put the the tags in meta data if that is what it takes to make this work.


Hi @bradley.

The Nomad job API doesn’t support native filtering based on elements within a job specification. Therefore whether you want to use Docker labels or metadata blocks, the same process would apply; you would need to firstly list the jobs, and then filter the results.

jrasell and the Nomad team