ruby-jss 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ruby-jss might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGES.md +23 -0
- data/lib/jss/api_connection.rb +20 -13
- data/lib/jss/api_object.rb +105 -1
- data/lib/jss/api_object/extension_attribute.rb +165 -68
- data/lib/jss/api_object/extension_attribute/computer_extension_attribute.rb +176 -282
- data/lib/jss/api_object/extension_attribute/mobile_device_extension_attribute.rb +66 -171
- data/lib/jss/api_object/extension_attribute/user_extension_attribute.rb +51 -92
- data/lib/jss/api_object/management_history.rb +29 -0
- data/lib/jss/db_connection.rb +1 -0
- data/lib/jss/version.rb +1 -1
- metadata +4 -4
@@ -293,6 +293,27 @@ module JSS
|
|
293
293
|
end # completed_mdm_commands
|
294
294
|
alias completed_commands completed_mdm_commands
|
295
295
|
|
296
|
+
# The time of the most recently completed MDM command.
|
297
|
+
#
|
298
|
+
# For Mobile Devices, this seems to be the best indicator of the real
|
299
|
+
# last-contact time, since the last_inventory_update is changed when
|
300
|
+
# changes are made via the API.
|
301
|
+
#
|
302
|
+
# @param ident [Type] The identifier for the object - id, name, sn, udid, etc.
|
303
|
+
#
|
304
|
+
# @param api [JSS::APIConnection] The API connection to use for the query
|
305
|
+
# defaults to the currently active connection
|
306
|
+
#
|
307
|
+
# @return [Time, nil] An array of completed MDMCommands
|
308
|
+
#
|
309
|
+
def last_mdm_contact(ident, api: JSS.api)
|
310
|
+
cmds = completed_mdm_commands(ident, api: api)
|
311
|
+
return nil if cmds.empty?
|
312
|
+
|
313
|
+
JSS.epoch_to_time cmds.map{|cmd| cmd.completed_epoch }.max
|
314
|
+
end
|
315
|
+
|
316
|
+
|
296
317
|
# The history of pending mdm commands for a target
|
297
318
|
#
|
298
319
|
# @param ident [Type] The identifier for the object - id, name, sn, udid, etc.
|
@@ -696,6 +717,14 @@ module JSS
|
|
696
717
|
end # completed_mdm_commands
|
697
718
|
alias completed_commands completed_mdm_commands
|
698
719
|
|
720
|
+
# The time of the last completed mdm command for this object
|
721
|
+
#
|
722
|
+
# @see the matching method in {JSS::ManagementHistory::ClassMethods}
|
723
|
+
#
|
724
|
+
def last_mdm_contact
|
725
|
+
self.class.last_mdm_contact(@id, api: @api)
|
726
|
+
end # completed_mdm_commands
|
727
|
+
|
699
728
|
# The pending_mdm_commands for this object
|
700
729
|
#
|
701
730
|
# @see the matching method in {JSS::ManagementHistory::ClassMethods}
|
data/lib/jss/db_connection.rb
CHANGED
data/lib/jss/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-jss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Lasell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-10-
|
12
|
+
date: 2019-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: plist
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 2.0.0
|
55
55
|
- - "<"
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '2.1'
|
@@ -61,7 +61,7 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
64
|
+
version: 2.0.0
|
65
65
|
- - "<"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '2.1'
|