Posted on 08-21-2024 06:28 AM
Hello community.
When I create or delete something on my Jamf site through api call (for example, creating a new policy with POST on "/JSSResource/policies/id/-1"), I am getting a successful response with code 200 and the newly created policy's id.
Then, I am trying to fetch all policies from my Jamf site (GET on "/JSSResource/policies"), but the response does not contain the newly created policy.
Should I wait for few seconds before I fetch my policies and check if the creation succeeded? (Since I am running a code that does it I need to know how much sleep time I should add). Are there a different solution than doing busy waiting?
All I wrote I experience for DELETE requests as well.
Thanks in advance
Posted on 08-21-2024 06:41 AM
If you're using Jamf Cloud, it has multiple servers. You're likely changing one and the other hasn't synchronized yet. Usually takes a minute or less.
Posted on 08-24-2024 11:40 PM
@talkingmoose Thanks.
Is there a query I can do to know when the servers are synced?
Is there a way to know if a set of API calls are going to be resolved on different server?
Posted on 08-26-2024 07:17 AM
There's no way to tell other than to refresh the page.
It's usually less than a minute. You could build in a sleep command to wait, if it's becoming a problem for you.