ruby-jss 0.10.2a5 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby-jss might be problematic. Click here for more details.

@@ -51,7 +51,9 @@ module JSS
51
51
  #####################################
52
52
 
53
53
  include JSS::Creatable
54
- include JSS::Sitable
54
+
55
+ # Class Variables
56
+ #####################################
55
57
 
56
58
  # Class Methods
57
59
  #####################################
@@ -86,9 +88,6 @@ module JSS
86
88
  # See {APIObject#add_object_history_entry}
87
89
  OBJECT_HISTORY_OBJECT_TYPE = 84
88
90
 
89
- # Where is site data located in the API JSON?
90
- SITE_SUBSET = :top
91
-
92
91
  # Attributes
93
92
  #####################################
94
93
 
@@ -201,7 +200,6 @@ module JSS
201
200
  obj.add_element('hide_account').text = hide_account
202
201
  obj.add_element('invitation_status').text = invitation_status
203
202
  obj.add_element('multiple_uses_allowed').text = multiple_uses_allowed
204
- add_site_to_xml(doc)
205
203
  doc.to_s
206
204
  end
207
205
 
@@ -6,8 +6,6 @@ module JSS
6
6
  #
7
7
  class EBook < APIObject
8
8
 
9
- include Sitable
10
-
11
9
  ### The base for REST resources of this class
12
10
  RSRC_BASE = 'ebooks'.freeze
13
11
 
@@ -23,9 +21,6 @@ module JSS
23
21
  # See {APIObject#add_object_history_entry}
24
22
  OBJECT_HISTORY_OBJECT_TYPE = 24
25
23
 
26
- # Where is the Site data in the API JSON?
27
- SITE_SUBSET = :general
28
-
29
24
  end
30
25
 
31
26
  end
@@ -56,7 +56,6 @@ module JSS
56
56
  #####################################
57
57
  ### Mix-Ins
58
58
  #####################################
59
- include JSS::MDM
60
59
 
61
60
  #####################################
62
61
  ### Class Methods
@@ -87,9 +86,6 @@ module JSS
87
86
  # See {APIObject#add_object_history_entry}
88
87
  OBJECT_HISTORY_OBJECT_TYPE = 7
89
88
 
90
- # what kind of devices are these WRT MDM
91
- MDM_COMMAND_TARGET = :computergroups
92
-
93
89
  #####################################
94
90
  ### Class Variables
95
91
  #####################################
@@ -56,7 +56,7 @@ module JSS
56
56
  #####################################
57
57
  ### Mix-Ins
58
58
  #####################################
59
- include JSS::MDM
59
+
60
60
 
61
61
  #####################################
62
62
  ### Class Constants
@@ -83,9 +83,6 @@ module JSS
83
83
  # See {APIObject#add_object_history_entry}
84
84
  OBJECT_HISTORY_OBJECT_TYPE = 25
85
85
 
86
- # what kind of devices are these WRT MDM
87
- MDM_COMMAND_TARGET = :mobiledevicegroups
88
-
89
86
  #####################################
90
87
  ### Class Variables
91
88
  #####################################
@@ -67,7 +67,6 @@ module JSS
67
67
  include JSS::Creatable
68
68
  include JSS::Updatable
69
69
  include JSS::Criteriable
70
- include JSS::Sitable
71
70
 
72
71
 
73
72
  #####################################
@@ -77,9 +76,6 @@ module JSS
77
76
  ### the types of groups allowed for creation
78
77
  GROUP_TYPES = [:smart, :static]
79
78
 
80
- # Where is the Site data in the API JSON?
81
- SITE_SUBSET = :top
82
-
83
79
  #####################################
84
80
  ### Class Variables
85
81
  #####################################
@@ -361,6 +357,7 @@ module JSS
361
357
  doc = REXML::Document.new JSS::APIConnection::XML_HEADER
362
358
  group = doc.add_element self.class::RSRC_OBJECT_KEY.to_s
363
359
  group.add_element('name').text = @name
360
+ group.add_element('site').add_element('name').text = @site if @site
364
361
  group.add_element('is_smart').text = @is_smart
365
362
  if @is_smart
366
363
  group << @criteria.rest_xml if @criteria
@@ -368,8 +365,6 @@ module JSS
368
365
  group << self.class::MEMBER_CLASS.xml_list(@members, :id)
369
366
  end
370
367
 
371
- add_site_to_xml(doc)
372
-
373
368
  return doc.to_s
374
369
 
375
370
  end #rest_xml
@@ -6,8 +6,6 @@ module JSS
6
6
  #
7
7
  class MacApplication < APIObject
8
8
 
9
- include Sitable
10
-
11
9
  ### The base for REST resources of this class
12
10
  RSRC_BASE = 'macapplications'.freeze
13
11
 
@@ -23,9 +21,6 @@ module JSS
23
21
  # See {APIObject#add_object_history_entry}
24
22
  OBJECT_HISTORY_OBJECT_TYPE = 350
25
23
 
26
- # Where is the Site data in the API JSON?
27
- SITE_SUBSET = :general
28
-
29
24
  end
30
25
 
31
26
  end
@@ -39,14 +39,14 @@ module JSS
39
39
  # This class represents a Mobile Device stored in the JSS.
40
40
  #
41
41
  # ---
42
- # === Adding devices to the JSS
42
+ # ===Adding devices to the JSS
43
43
  #
44
44
  # This class cannot be used to add new mobile devices to the JSS. That can only be done
45
45
  # via the enrollment process. See JSS::MobileDeviceInvitation for sending
46
46
  # an enrollment invite to a device.
47
47
  #
48
48
  # ---
49
- # === Editing values
49
+ # ===Editing values
50
50
  #
51
51
  # Only a few values can be changed via the API, using these methods, q.v:
52
52
  # - #asset_tag= String
@@ -57,17 +57,24 @@ module JSS
57
57
  # After modfying any values, #save must be called to save changes to the JSS.
58
58
  #
59
59
  # ---
60
- # === MDM Commands
60
+ # ===MDM Commands
61
61
  #
62
- # See the {JSS::MDM} mixin module for Class and Instance methods for
63
- # sending MDM commands to mobiledevices.
62
+ # The following methods can be used to send an APNS command to the device represented by an
63
+ # instance of JSS::MobileDevice, equivalent to clicking one of the buttons on
64
+ # the Management Commands section of the Management tab of the Mobile Device details page in the JSS UI.
64
65
  #
65
- # To send MDM commands without fetching mobiledevice instances, use the class
66
- # methods, which can take multiple identifiers at once.
66
+ # The methods supported are:
67
+ # - blank_push (aliases blank, noop, send_blank_push)
68
+ # - update_inventory (alias recon)
69
+ # - device_lock (aliases lock, lock_device)
70
+ # - erase_device (aliases wipe)
71
+ # - clear_passcode
72
+ # - unmanage_device (alias unmanage)
73
+ #
74
+ # Each returns true if the command as sent.
75
+ #
76
+ # @see JSS::APIObject
67
77
  #
68
- # NOTE: If the {#name=} method is used to change the name of a supervized device,
69
- # the DeviceName MDM command will be sent to the device when
70
- # the changes are sent to the server via {#save} or {#update}
71
78
  #
72
79
  class MobileDevice < JSS::APIObject
73
80
 
@@ -79,8 +86,6 @@ module JSS
79
86
  include JSS::Purchasable
80
87
  include JSS::Uploadable
81
88
  include JSS::Extendable
82
- include JSS::Sitable
83
- include JSS::MDM
84
89
 
85
90
  extend JSS::Matchable
86
91
 
@@ -97,9 +102,6 @@ module JSS
97
102
  # It's also used in various error messages
98
103
  RSRC_OBJECT_KEY = :mobile_device
99
104
 
100
- # Where is the Site data in the API JSON?
101
- SITE_SUBSET = :general
102
-
103
105
  # these keys, as well as :id and :name, are present in valid API JSON data for this class
104
106
  VALID_DATA_KEYS = %i[device_name capacity tethered].freeze
105
107
 
@@ -118,9 +120,66 @@ module JSS
118
120
  # This is the class for relevant Extension Attributes
119
121
  EXT_ATTRIB_CLASS = JSS::MobileDeviceExtensionAttribute
120
122
 
121
- # What kind of devices are we for MDM purposes?
122
- MDM_COMMAND_TARGET = :mobiledevices
123
+ # the rsrc for mobile dev commands
124
+ MDM_RSRC = 'mobiledevicecommands/command'.freeze
125
+
126
+ # The MDM commands sendable via the api
127
+ # and alternative versions
128
+ #
129
+ MDM_COMMANDS = {
130
+ blank_push: 'BlankPush',
131
+ send_blank_push: 'BlankPush',
132
+ blank: 'BlankPush',
133
+ noop: 'BlankPush',
134
+
135
+ settings: 'Settings',
136
+
137
+ update_inventory: 'UpdateInventory',
138
+ recon: 'UpdateInventory',
139
+
140
+ device_lock: 'DeviceLock',
141
+ lock: 'DeviceLock',
142
+ lock_device: 'DeviceLock',
143
+
144
+ erase_device: 'EraseDevice',
145
+ erase: 'EraseDevice',
146
+ wipe: 'EraseDevice',
147
+
148
+ clear_passcode: 'ClearPasscode',
149
+
150
+ clear_restrictions_password: 'ClearRestrictionsPassword',
151
+
152
+ enable_data_roaming: 'SettingsEnableDataRoaming',
153
+ disable_data_roaming: 'SettingsDisableDataRoaming',
154
+
155
+ enable_voice_roaming: 'SettingsEnableVoiceRoaming',
156
+ disable_voice_roaming: 'SettingsDisableVoiceRoaming',
157
+
158
+ enable_app_analytics: 'SettingsEnableAppAnalytics',
159
+ disable_app_analytics: 'SettingsDisableAppAnalytics',
160
+
161
+ enable_diagnostic_submission: 'SettingsEnableDiagnosticSubmission',
162
+ disable_diagnostic_submission: 'SettingsDisableDiagnosticSubmission',
163
+
164
+ # wallpaper: 'Wallpaper',
165
+
166
+ device_name: 'DeviceName',
123
167
 
168
+ shutdown_device: 'ShutDownDevice',
169
+ shutdown: 'ShutDownDevice',
170
+
171
+ restart_device: 'RestartDevice',
172
+ restart: 'RestartDevice',
173
+
174
+ # passcode_lock_grace_period: 'PasscodeLockGracePeriod',
175
+
176
+ unmanage_device: 'UnmanageDevice',
177
+ unmanage: 'UnmanageDevice'
178
+
179
+ }.freeze
180
+
181
+ # These MDM commands need extra data.
182
+ MDM_COMMANDS_REQUIRING_DATA = %w[DeviceLock DeviceName Wallpaper].freeze
124
183
 
125
184
  # The History resource
126
185
  HISTORY_RSRC = 'mobiledevicehistory'.freeze
@@ -139,62 +198,101 @@ module JSS
139
198
 
140
199
  # @return [Array<String>] all mobiledevice serial_numbers
141
200
  def self.all_serial_numbers(refresh = false, api: JSS.api)
142
- all(refresh, api: api).map { |i| i[:serial_number] }
201
+ all(refresh, api: API).map { |i| i[:serial_number] }
143
202
  end
144
203
 
145
204
  # @return [Array<String>] all mobiledevice phone numbers
146
205
  def self.all_phone_numbers(refresh = false, api: JSS.api)
147
- all(refresh, api: api).map { |i| i[:phone_number] }.reject(&:empty?)
206
+ all(refresh, api: API).map { |i| i[:phone_number] }.reject(&:empty?)
148
207
  end
149
208
 
150
209
  # @return [Array<String>] all mobiledevice wifi mac addrs
151
210
  def self.all_wifi_mac_addresses(refresh = false, api: JSS.api)
152
- all(refresh, api: api).map { |i| i[:wifi_mac_address] }
211
+ all(refresh, api: API).map { |i| i[:wifi_mac_address] }
153
212
  end
154
213
 
155
214
  # @return [Array<String>] all mobiledevice wifi mac addrs
156
215
  def self.all_mac_addresses(refresh = false, api: JSS.api)
157
- all_wifi_mac_addresses(refresh, api: api)
216
+ all_wifi_mac_addresses(refresh, api: API)
158
217
  end
159
218
 
160
219
  # @return [Array<String>] all mobiledevice udids
161
220
  def self.all_udids(refresh = false, api: JSS.api)
162
- all(refresh, api: api).map { |i| i[:udid] }
221
+ all(refresh, api: API).map { |i| i[:udid] }
163
222
  end
164
223
 
165
224
  # @return [Array<Hash>] the list of all managed mobile devices
166
225
  def self.all_managed(refresh = false, api: JSS.api)
167
- all(refresh, api: api).select { |d| d[:managed] }
226
+ all(refresh, api: API).select { |d| d[:managed] }
168
227
  end
169
228
 
170
229
  # @return [Array<Hash>] the list of all unmanaged mobile devices
171
230
  def self.all_unmanaged(refresh = false, api: JSS.api)
172
- all(refresh, api: api).reject { |d| d[:managed] }
173
- end
174
-
175
- # @return [Array<Hash>] the list of all supervised mobile devices
176
- def self.all_supervised(refresh = false, api: JSS.api)
177
- all(refresh, api: api).select { |d| d[:supervised] }
178
- end
179
-
180
- # @return [Array<Hash>] the list of all unsupervised mobile devices
181
- def self.all_unsupervised(refresh = false, api: JSS.api)
182
- all(refresh, api: api).reject { |d| d[:supervised] }
231
+ all(refresh, api: API).reject { |d| d[:managed] }
183
232
  end
184
233
 
185
234
  # @return [Array<Hash>] the list of all iPhones
186
235
  def self.all_iphones(refresh = false, api: JSS.api)
187
- all(refresh, api: api).select { |d| d[:model].start_with? 'iPhone' }
236
+ all(refresh, api: API).select { |d| d[:model].start_with? 'iPhone' }
188
237
  end
189
238
 
190
239
  # @return [Array<Hash>] the list of all iPads
191
240
  def self.all_ipads(refresh = false, api: JSS.api)
192
- all(refresh, api: api).select { |d| d[:model].start_with? 'iPad' }
241
+ all(refresh, api: API).select { |d| d[:model].start_with? 'iPad' }
193
242
  end
194
243
 
195
244
  # @return [Array<Hash>] the list of all iPads
196
245
  def self.all_apple_tvs(refresh = false, api: JSS.api)
197
- all(refresh, api: api).select { |d| d[:model_identifier].start_with? 'AppleTV' }
246
+ all(refresh, api: API).select { |d| d[:model_identifier].start_with? 'AppleTV' }
247
+ end
248
+
249
+ # Send an MDM command to one or more mobile devices by id or name
250
+ #
251
+ #
252
+ # @param targets[String,Integer,Array<String,Integer>]
253
+ # the name or id of the mobile devices to receive the command, or
254
+ # an array of such names or ids, or a comma-separated string
255
+ # of them.
256
+ # @param command[Symbol] the command to send, one of the keys
257
+ # of MDM_COMMANDS
258
+ #
259
+ # @param data[String] Some commands require extra data.
260
+ #
261
+ # @param api[JSS::APIConnection] the APi to query. Defaults to the
262
+ # currently active API, see {JSS::APIConnection}
263
+ #
264
+ # @return [String] The uuid of the MDM command sent, if applicable
265
+ # (blank pushes do not generate uuids)
266
+ #
267
+ def self.send_mdm_command(targets, command, data = nil, api: JSS.api)
268
+ raise JSS::NoSuchItemError, "Unknown command '#{command}'" unless MDM_COMMANDS.keys.include? command
269
+
270
+ command = MDM_COMMANDS[command]
271
+ cmd_rsrc = "#{MDM_RSRC}/#{command}"
272
+
273
+ if MDM_COMMANDS_REQUIRING_DATA.include? command
274
+ raise "MDM command '#{command}' requires additional data." unless data
275
+ cmd_rsrc << "/#{data}"
276
+ end
277
+
278
+ targets = JSS.to_s_and_a(targets.to_s)[:arrayform] unless targets.is_a? Array
279
+
280
+ # make sure its an array of ids
281
+ targets.map! do |md|
282
+ if all_ids(api: api).include? md.to_i
283
+ md.to_i
284
+ elsif all_names(api: api).include? md
285
+ map_all_ids_to(:name, api: api.invert[md])
286
+ else
287
+ raise JSS::NoSuchItemError, "No mobile device found matching '#{md}'"
288
+ end # if
289
+ end # map!
290
+
291
+ cmd_rsrc << "/id/#{targets.join ','}"
292
+
293
+ result = api.post_rsrc cmd_rsrc, nil
294
+ result =~ %r{<uuid>(.*)</uuid>}
295
+ Regexp.last_match(1)
198
296
  end
199
297
 
200
298
  def self.management_history(identifier, subset = nil, api: JSS.api)
@@ -202,13 +300,12 @@ module JSS
202
300
  if identifier.is_a? Integer
203
301
  id = identifier
204
302
  else
205
- key =
206
- case identifier
207
- when *all_names(api: api) then :name
208
- when *all_serial_numbers(api: api) then :serial_number
209
- when *all_mac_addresses(api: api) then :mac_address
210
- when *all_udids(api: api) then :udid
211
- end
303
+ key = case identifier
304
+ when *all_names(api: api) then :name
305
+ when *all_serial_numbers(api: api) then :serial_number
306
+ when *all_mac_addresses(api: api) then :mac_address
307
+ when *all_udids(api: api) then :udid
308
+ end
212
309
  id = map_all_ids_to(key, api: api).invert[identifier]
213
310
  end # if identifier.is_a? Integer
214
311
 
@@ -397,9 +494,11 @@ module JSS
397
494
  # - :file_level_encryption_capable=>true
398
495
  attr_reader :security
399
496
 
497
+ #####################################
400
498
  # Instance Methods
401
499
  #####################################
402
500
 
501
+ #
403
502
  # @see APIObject#initialize
404
503
  #
405
504
  def initialize(args = {})
@@ -449,16 +548,188 @@ module JSS
449
548
  @applications = @init_data[:applications]
450
549
  end # initialize
451
550
 
452
- def name=(new_name)
453
- super
454
- @needs_mdm_name_change = true if managed? && supervised?
551
+ # Send a blank_push MDM command
552
+ #
553
+ # @see MobileDevice.send_mdm_command
554
+ #
555
+ # @return [String] The command uuid
556
+ #
557
+ def blank_push
558
+ self.class.send_mdm_command @id, :blank_push, api: @api
559
+ end #
560
+
561
+ # Send an update_inventory MDM command
562
+ #
563
+ # @see MobileDevice.send_mdm_command
564
+ #
565
+ # @return [String] The command uuid
566
+ #
567
+ def update_inventory
568
+ self.class.send_mdm_command @id, :update_inventory, api: @api
569
+ end
570
+
571
+ # Send a device_lock MDM command
572
+ #
573
+ # @param message[String] The message to display on the lock screen.
574
+ #
575
+ # @see MobileDevice.send_mdm_command
576
+ #
577
+ # @return [String] The command uuid
578
+ #
579
+ def device_lock(message)
580
+ self.class.send_mdm_command @id, :device_lock, message, api: @api
581
+ end
582
+
583
+ # Send an erase_device MDM command
584
+ #
585
+ # @see MobileDevice.send_mdm_command
586
+ #
587
+ # @return [String] The command uuid
588
+ #
589
+ def erase_device
590
+ self.class.send_mdm_command @id, :erase_device, api: @api
591
+ end
592
+
593
+ # Send a clear_passcode MDM command
594
+ #
595
+ # @see MobileDevice.send_mdm_command
596
+ #
597
+ # @return [String] The command uuid
598
+ #
599
+ def clear_passcode
600
+ self.class.send_mdm_command @id, :clear_passcode, api: @api
601
+ end
602
+
603
+ # Send a unmanage_device MDM command
604
+ #
605
+ # @see MobileDevice.send_mdm_command
606
+ #
607
+ # @return [String] The command uuid
608
+ #
609
+ def unmanage_device
610
+ @managed = false if self.class.send_mdm_command(@id, :unmanage_device, api: @api)
611
+ end
612
+
613
+ # Send a ClearRestrictionsPassword MDM command
614
+ #
615
+ # @see MobileDevice.send_mdm_command
616
+ #
617
+ # @return [String] The command uuid
618
+ #
619
+ def clear_restrictions_password
620
+ self.class.send_mdm_command @id, :clear_restrictions_password, api: @api
621
+ end
622
+
623
+ # Send a SettingsEnableDataRoaming MDM command
624
+ #
625
+ # @see MobileDevice.send_mdm_command
626
+ #
627
+ # @return [String] The command uuid
628
+ #
629
+ def enable_data_roaming
630
+ self.class.send_mdm_command @id, :enable_data_roaming, api: @api
631
+ end
632
+
633
+ # Send a disable_data_roaming MDM command
634
+ #
635
+ # @see MobileDevice.send_mdm_command
636
+ #
637
+ # @return [String] The command uuid
638
+ #
639
+ def disable_data_roaming
640
+ self.class.send_mdm_command @id, :disable_data_roaming, api: @api
641
+ end
642
+
643
+ # Send a enable_voice_roaming MDM command
644
+ #
645
+ # @see MobileDevice.send_mdm_command
646
+ #
647
+ # @return [String] The command uuid
648
+ #
649
+ def enable_voice_roaming
650
+ self.class.send_mdm_command @id, :enable_voice_roaming, api: @api
651
+ end
652
+
653
+ # Send a disable_voice_roaming MDM command
654
+ #
655
+ # @see MobileDevice.send_mdm_command
656
+ #
657
+ # @return [String] The command uuid
658
+ #
659
+ def disable_voice_roaming
660
+ self.class.send_mdm_command @id, :disable_voice_roaming, api: @api
661
+ end
662
+
663
+ # Send a enable_app_analytics MDM command
664
+ #
665
+ # @see MobileDevice.send_mdm_command
666
+ #
667
+ # @return [String] The command uuid
668
+ #
669
+ def enable_app_analytics
670
+ self.class.send_mdm_command @id, :enable_app_analytics, api: @api
671
+ end
672
+
673
+ # Send a disable_app_analytics MDM command
674
+ #
675
+ # @see MobileDevice.send_mdm_command
676
+ #
677
+ # @return [String] The command uuid
678
+ #
679
+ def disable_app_analytics
680
+ self.class.send_mdm_command @id, :disable_app_analytics, api: @api
681
+ end
682
+
683
+ # Send a enable_diagnostic_submission MDM command
684
+ #
685
+ # @see MobileDevice.send_mdm_command
686
+ #
687
+ # @return [String] The command uuid
688
+ #
689
+ def enable_diagnostic_submission
690
+ self.class.send_mdm_command @id, :enable_diagnostic_submission, api: @api
691
+ end
692
+
693
+ # Send a disable_diagnostic_submission MDM command
694
+ #
695
+ # @see MobileDevice.send_mdm_command
696
+ #
697
+ # @return [String] The command uuid
698
+ #
699
+ def disable_diagnostic_submission
700
+ self.class.send_mdm_command @id, :disable_diagnostic_submission, api: @api
701
+ end
702
+
703
+ # Send a device_name MDM command
704
+ #
705
+ # @param new_name[String] The name for the device
706
+ #
707
+ # @see MobileDevice.send_mdm_command
708
+ #
709
+ # @return [String] The command uuid
710
+ #
711
+ def device_name(new_name)
712
+ self.class.send_mdm_command @id, :device_name, new_name, api: @api
455
713
  end
456
714
 
457
- def update
458
- super
459
- return unless @needs_mdm_name_change
460
- self.class.send_mdm_command @id, :device_name, opts: { device_name: @name }, api: @api
461
- @needs_mdm_name_change = false
715
+ # Send a shutdown device MDM command
716
+ #
717
+ # @see MobileDevice.send_mdm_command
718
+ #
719
+ # @return [String] The command uuid
720
+ #
721
+ def shutdown
722
+ self.class.send_mdm_command @id, :shutdown, api: @api
723
+ end
724
+
725
+ # Send a restart device MDM command
726
+ #
727
+ # @see MobileDevice.send_mdm_command
728
+ #
729
+ # @return [String] The command uuid
730
+ #
731
+ def restart
732
+ self.class.send_mdm_command @id, :restart, api: @api
462
733
  end
463
734
 
464
735
  # The full management History data for this Mobile Device
@@ -653,12 +924,18 @@ module JSS
653
924
  # Aliases
654
925
  alias battery_percent battery_level
655
926
  alias managed? managed
656
- alias supervised? supervised
657
927
  alias sn serial_number
658
928
  alias serialnumber serial_number
659
929
 
660
-
661
-
930
+ alias noop blank_push
931
+ alias send_blank_push blank_push
932
+ alias recon update_inventory
933
+ alias lock device_lock
934
+ alias lock_device device_lock
935
+ alias erase erase_device
936
+ alias wipe erase_device
937
+ alias unmanage unmanage_device
938
+ alias make_unmanaged unmanage_device
662
939
 
663
940
  # private methods
664
941
  ##############################
@@ -668,10 +945,12 @@ module JSS
668
945
  def rest_xml
669
946
  doc = REXML::Document.new APIConnection::XML_HEADER
670
947
  md = doc.add_element self.class::RSRC_OBJECT_KEY.to_s
671
- md << ext_attr_xml
948
+
949
+ md << ext_attr_xml if @changed_eas && !@changed_eas.empty?
950
+
672
951
  md << location_xml if has_location?
673
952
  md << purchasing_xml if has_purchasing?
674
- add_site_to_xml doc
953
+
675
954
  doc.to_s
676
955
  end
677
956
 
@@ -48,8 +48,6 @@ module JSS
48
48
  include JSS::Categorizable
49
49
  include JSS::Uploadable
50
50
  include JSS::VPPable
51
- include JSS::Sitable
52
-
53
51
 
54
52
  # Class Methods
55
53
  #####################################
@@ -95,9 +93,6 @@ module JSS
95
93
  # See {APIObject#add_object_history_entry}
96
94
  OBJECT_HISTORY_OBJECT_TYPE = 23
97
95
 
98
- # Where is the Site data in the API JSON?
99
- SITE_SUBSET = :general
100
-
101
96
  # Attributes
102
97
  #####################################
103
98
 
@@ -457,7 +452,6 @@ module JSS
457
452
  obj << @scope.scope_xml
458
453
  add_category_to_xml doc
459
454
  add_self_service_xml doc
460
- add_site_to_xml doc
461
455
  add_vpp_xml doc
462
456
  doc.to_s
463
457
  end