Posted on 12-16-2018 05:10 PM
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>
Posted on 12-17-2018 02:24 PM
The XML looks ok. You might want to try
-H "Content-type: application/xml" rather than
If you try and run the PUT command manually in the terminal you should get some error information back telling you what's wrong.
Posted on 12-17-2018 05:42 PM
As @davidacland mentioned, you should try running the command in Terminal to see what it comes back with, but I suggest removing the
-s flag so you get something back from curl, instead of silencing its output.
Posted on 12-17-2018 09:33 PM
Thank you so much. @davidacland @mm2270
I tried running command with
-H "Content-type: application/xml" option, and the following response was returned.
<?xml version="1.0" encoding="UTF-8"?><policy><id>144</id></policy>
But Client - Side Limitations of policy was not registered.
Posted on 12-18-2018 03:11 AM
What response do you get from:
curl -u 'username:password' -H 'Content-type: application/xml' -T policy.xml -X PUT https://exampledomain/JSSResource/policies/id/144?
Posted on 12-18-2018 07:48 AM
@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?
Posted on 12-18-2018 11:20 AM
@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.
Posted on 12-18-2018 11:00 PM
I ran in to this last week and have an open call with Jamf support that has been passed to engineering, so hopefully is on Jamf’s radar now.
Posted on 12-24-2018 06:21 AM
Thank you very much, @mm2270 @davidacland @psmac
Our jamf Pro version is 10.8.0.
I would like to report this problem.
Posted on 12-24-2018 06:56 AM
@Yamashiro You can reference my case number when you log your support if it helps, the reference i’ve got is #: JAMF-0606575
The more people who mention it, the quicker it might get fixed!