-
Notifications
You must be signed in to change notification settings - Fork 28
Description
I used to be able to rename iPads via Ruby-JSS but recently I'm running into errors when I try.
Basically if I do something simple like the following:
`#!/usr/bin/ruby
require 'ruby-jss'
JSS::API.connect(:user => "user", :pw => "password", :server => "jss", :port => "8443")
ipad = JSS::MobileDevice.fetch :serialnumber => "serial#"
ipad.name = "Test name"
ipad.save
`
It fails with the following errors:
/Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/connection/classic_api.rb:267](coderunner:///Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/connection/classic_api.rb#267:0!):in `handle_classic_http_error': Illegal state. Both processManagerUUID and mdmCommand are null. (Jamf::BadRequestError)
from /Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/connection/classic_api.rb:95:in `c_post'
from /Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/classic/api_objects/mdm.rb:352:in `send_mdm_command'
from /Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/classic/api_objects/mdm.rb:821:in `device_name'
from /Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/classic/api_objects/mdm.rb:1263:in `device_name'
from /Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/classic/api_objects/mobile_device.rb:540:in `update'
from /Library/Ruby/Gems/2.6.0/gems/ruby-jss-4.2.4/lib/jamf/api/classic/base_classes/api_object.rb:1305:in `save'
from Untitled 61.rb:12:in `<main>'
I note that it does seem to be calling 'send_mdm_command' routines, and according to JAMF API change documents it looks like as of 11.21.0 they removed both the 'POST /computercommands/command' and 'POST mobiledevicecommands/command' APIs - I suspect this is the heart of the issue.
I can edit and save other attributes such as building and department, it's only when I try to change the name that this issue comes up. I suspect Ruby-JSS is using an mdm command to do the rename.