Web Service API - good practices
Posted: Wed Jan 27, 2021 10:46 pm
Hi all,
We are using the WebService API on Switch (2020 Fall) to create and track jobs progression and we have some misunderstood behaviours that you can maybe clarify for us.
When we create a new job, we immediately call the "jobs list" API method to retrieve the "job id" to be able to track it later. It works fine.
After some time, we replay the "jobs list" method to follow the job progression and then we can see the original created job has status "completed" and a new job (with a different ID but with same name and same "family") is processing. It seems the original job has been replaced by this new one...
When we try to confirm these behaviour we check the Switch UI and as you can see in the attached screenshots, the Switch UI shows 2 differents jobs with 2 differents prefix : 00IIA and 00IIC.
The API we can also see 2 jobs but with the same "family" 00IIA. The others properties have same values.
Can you please explain the difference between "prefix" in the UI and "family" in the API.
As I explain sooner we try to track the job from the start to the end of our workflow but it seems to be difficult/impossible if the first created job we catch is not the one we have to follow then.
It seems that if we use a linear workflow without any fork then the original job is keeped until the end, but it means very limited possibilities (and no recycle bin).
Last question, is there an elegant way to put a job in error status as we cannot not naturally link the "problem jobs" element ?
Thank you very much for all your help.
BR.
Tristan.


We are using the WebService API on Switch (2020 Fall) to create and track jobs progression and we have some misunderstood behaviours that you can maybe clarify for us.
When we create a new job, we immediately call the "jobs list" API method to retrieve the "job id" to be able to track it later. It works fine.
After some time, we replay the "jobs list" method to follow the job progression and then we can see the original created job has status "completed" and a new job (with a different ID but with same name and same "family") is processing. It seems the original job has been replaced by this new one...
When we try to confirm these behaviour we check the Switch UI and as you can see in the attached screenshots, the Switch UI shows 2 differents jobs with 2 differents prefix : 00IIA and 00IIC.
The API we can also see 2 jobs but with the same "family" 00IIA. The others properties have same values.
Can you please explain the difference between "prefix" in the UI and "family" in the API.
As I explain sooner we try to track the job from the start to the end of our workflow but it seems to be difficult/impossible if the first created job we catch is not the one we have to follow then.
It seems that if we use a linear workflow without any fork then the original job is keeped until the end, but it means very limited possibilities (and no recycle bin).
Last question, is there an elegant way to put a job in error status as we cannot not naturally link the "problem jobs" element ?
Thank you very much for all your help.
BR.
Tristan.

