I have specified the Client-Side Limitations of policy as follows.
However, it could not be registered.
After registering Client - Side Limitations on the screen, I can get setting information via API.
Is it impossible to register Client-Side Limitations via API?
curl -s -u 'username:password' -H 'accept: application/xml' -T policy.xml -X PUT https://exampledomain/JSSResource/policies/id/144
<?xml version="1.0" encoding="UTF-8"?> <policy> <general> <id>144</id> ... <date_time_limitations> <activation_date/> <activation_date_epoch>0</activation_date_epoch> <activation_date_utc/> <expiration_date/> <expiration_date_epoch>0</expiration_date_epoch> <expiration_date_utc/> <no_execute_on/> <no_execute_start>4:00 AM</no_execute_start> <no_execute_end>6:00 AM</no_execute_end> </date_time_limitations> ... </policy>
@Yamashiro The response you posted is what you get back when the XML is successfully uploaded. Meaning, it's saying it worked. If that's what you got and the Client Side Limitations were not set in the policy, then it's possible there isn't a way to set them using the API. That would be odd, but not out of the question.
If I can, I will try to run a test on a junk policy to see if I can reproduce the issue. Just out of curiosity, what version of Jamf Pro is this being tested on?
@Yamashiro, I did some quick tests with this, and I'm seeing the same issue. I enabled some basic client side limitations, to just tell it what times not to run the policy. Never touched the dates or anything else. I pulled down an xml of the policy afterwards and see the changes in the relevant section. I then flipped the settings back off in the policy in the UI to blank and saved. I then used the same XML file that I just pulled down with the changes in it to upload back to the server, and it shows it uploading the change after the PUT command, but going back into the UI, I don't see the changes take effect. It's still blank.
Seems like there's either some bug there preventing the changes from taking effect, or we're doing something wrong. If something else needs to be enabled/changed in the XML, then it's not very apparent what it is. You might want to check in with Jamf on this to see if they have a recommendation or can tell you what's going on.