Hi,
I am exploring the Nomad APIs, specially the ones related to allocations.
In the response payload when requesting the alloc information, I see these fields:
- Job.JobModifyIndex
- Job.ModifyIndex
I was wondering what they mean, what is their purpose and how could I use them?
thank you
Hi, see What is the difference in Job between JobModifyIndex, ModifyIndex and Version? .
As for “how could I use them”, not really much, but you can find job version that started an allocation, by getting allocation evaluation and then matching evaluation JobModifyIndex with job versions JobModifyIndex.
It’s for consistency, you know which anything is newer by comparing ModifyIndex . Anymore, I do not know.
ok, so if I understood correctly, I can use jobModifyIndex
to find the allocations related to a running job assuming the jobModifyIndex for the job and the allocations are the same?
Hi, sorry, I believe I only confused. You can find allocations of a job with GET /v1/job/:job_id/allocations
. You could find the job version that triggered an allocation by following the JobModifyIndex chain. But you can also get the same with just Allocation.JobVersion
field , so… nevermind.