ruby-jss 0.11.0a5 → 0.11.0a6
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.
- checksums.yaml +4 -4
- data/CHANGES.md +35 -29
- data/README.md +36 -48
- data/bin/cgrouper +1 -1
- data/bin/jamfHelperBackgrounder +1 -1
- data/bin/netseg-update +1 -1
- data/lib/jss.rb +1 -1
- data/lib/jss/api_connection.rb +1 -1
- data/lib/jss/api_object.rb +1 -1
- data/lib/jss/api_object/account.rb +1 -1
- data/lib/jss/api_object/advanced_search.rb +1 -1
- data/lib/jss/api_object/advanced_search/advanced_computer_search.rb +1 -1
- data/lib/jss/api_object/advanced_search/advanced_mobile_device_search.rb +1 -1
- data/lib/jss/api_object/advanced_search/advanced_user_search.rb +1 -1
- data/lib/jss/api_object/building.rb +1 -1
- data/lib/jss/api_object/categorizable.rb +1 -1
- data/lib/jss/api_object/category.rb +1 -1
- data/lib/jss/api_object/computer.rb +6 -18
- data/lib/jss/api_object/computer_invitation.rb +1 -1
- data/lib/jss/api_object/creatable.rb +1 -1
- data/lib/jss/api_object/criteriable.rb +1 -1
- data/lib/jss/api_object/criteriable/criteria.rb +1 -1
- data/lib/jss/api_object/criteriable/criterion.rb +1 -1
- data/lib/jss/api_object/department.rb +1 -1
- data/lib/jss/api_object/distribution_point.rb +1 -1
- data/lib/jss/api_object/extendable.rb +1 -1
- data/lib/jss/api_object/extension_attribute.rb +1 -1
- data/lib/jss/api_object/extension_attribute/computer_extension_attribute.rb +1 -1
- data/lib/jss/api_object/extension_attribute/mobile_device_extension_attribute.rb +1 -1
- data/lib/jss/api_object/extension_attribute/user_extension_attribute.rb +1 -1
- data/lib/jss/api_object/group.rb +1 -1
- data/lib/jss/api_object/group/computer_group.rb +1 -1
- data/lib/jss/api_object/group/mobile_device_group.rb +1 -1
- data/lib/jss/api_object/group/user_group.rb +1 -1
- data/lib/jss/api_object/ldap_server.rb +1 -1
- data/lib/jss/api_object/locatable.rb +1 -1
- data/lib/jss/api_object/management_history.rb +29 -17
- data/lib/jss/api_object/management_history/audit_event.rb +1 -0
- data/lib/jss/api_object/management_history/casper_imaging_log.rb +1 -0
- data/lib/jss/api_object/management_history/casper_remote_log.rb +1 -0
- data/lib/jss/api_object/management_history/computer_usage_log.rb +1 -0
- data/lib/jss/api_object/management_history/ebook.rb +1 -0
- data/lib/jss/api_object/management_history/hashlike.rb +24 -0
- data/lib/jss/api_object/management_history/mac_app_store_app.rb +1 -0
- data/lib/jss/api_object/management_history/mdm_command.rb +1 -0
- data/lib/jss/api_object/management_history/mobile_device_app.rb +2 -0
- data/lib/jss/api_object/management_history/policy_log.rb +1 -0
- data/lib/jss/api_object/management_history/screen_sharing_log.rb +1 -0
- data/lib/jss/api_object/management_history/user_location_change.rb +3 -0
- data/lib/jss/api_object/matchable.rb +1 -1
- data/lib/jss/api_object/mdm.rb +1 -1
- data/lib/jss/api_object/mobile_device.rb +10 -12
- data/lib/jss/api_object/mobile_device_application.rb +1 -1
- data/lib/jss/api_object/netboot_server.rb +1 -1
- data/lib/jss/api_object/network_segment.rb +1 -1
- data/lib/jss/api_object/osx_configuration_profile.rb +1 -1
- data/lib/jss/api_object/package.rb +1 -1
- data/lib/jss/api_object/patch.rb +1 -1
- data/lib/jss/api_object/patch_policy.rb +1 -1
- data/lib/jss/api_object/peripheral.rb +1 -1
- data/lib/jss/api_object/peripheral_type.rb +1 -1
- data/lib/jss/api_object/policy.rb +1 -1
- data/lib/jss/api_object/purchasable.rb +1 -1
- data/lib/jss/api_object/removable_macaddr.rb +1 -1
- data/lib/jss/api_object/scopable.rb +1 -1
- data/lib/jss/api_object/scopable/scope.rb +1 -1
- data/lib/jss/api_object/script.rb +1 -1
- data/lib/jss/api_object/self_servable.rb +1 -1
- data/lib/jss/api_object/self_servable/icon.rb +1 -1
- data/lib/jss/api_object/sitable.rb +1 -1
- data/lib/jss/api_object/site.rb +1 -1
- data/lib/jss/api_object/software_update_server.rb +1 -1
- data/lib/jss/api_object/updatable.rb +1 -1
- data/lib/jss/api_object/uploadable.rb +1 -1
- data/lib/jss/api_object/user.rb +1 -1
- data/lib/jss/api_object/vppable.rb +1 -1
- data/lib/jss/api_object/webhook.rb +1 -1
- data/lib/jss/client.rb +1 -1
- data/lib/jss/compatibility.rb +1 -1
- data/lib/jss/composer.rb +1 -1
- data/lib/jss/configuration.rb +1 -1
- data/lib/jss/db_connection.rb +1 -1
- data/lib/jss/exceptions.rb +1 -1
- data/lib/jss/ruby_extensions.rb +1 -1
- data/lib/jss/ruby_extensions/array.rb +1 -1
- data/lib/jss/ruby_extensions/filetest.rb +1 -1
- data/lib/jss/ruby_extensions/hash.rb +1 -1
- data/lib/jss/ruby_extensions/ipaddr.rb +1 -1
- data/lib/jss/ruby_extensions/pathname.rb +1 -1
- data/lib/jss/ruby_extensions/string.rb +1 -1
- data/lib/jss/ruby_extensions/time.rb +1 -1
- data/lib/jss/server.rb +1 -1
- data/lib/jss/utility.rb +1 -1
- data/lib/jss/validate.rb +1 -1
- data/lib/jss/version.rb +2 -2
- metadata +3 -2
data/lib/jss.rb
CHANGED
data/lib/jss/api_connection.rb
CHANGED
data/lib/jss/api_object.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
### Copyright
|
|
1
|
+
### Copyright 2018 Pixar
|
|
2
2
|
|
|
3
3
|
###
|
|
4
4
|
### Licensed under the Apache License, Version 2.0 (the "Apache License")
|
|
@@ -82,24 +82,12 @@ module JSS
|
|
|
82
82
|
# which removes the mdm profile, but also makes the machine unmanged by the
|
|
83
83
|
# JSS, setting the management acct to nil, and requring re-enrollment.
|
|
84
84
|
#
|
|
85
|
-
# ===
|
|
85
|
+
# === Management History & Logs
|
|
86
86
|
#
|
|
87
|
-
# Computer
|
|
88
|
-
#
|
|
89
|
-
#
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
# Subsets of that history have their own methods, which are faster and only retrieve
|
|
93
|
-
# the subset requested. See {#usage_logs}, {#audits}, {#policy_los},
|
|
94
|
-
# {#completed_policies}, {#failed_polices}, {#casper_remote_logs},
|
|
95
|
-
# {#screen_sharing_logs}, {#casper_imaging_logs}, {#commands},
|
|
96
|
-
# {#user_location_history},and {#app_store_app_history}
|
|
97
|
-
#
|
|
98
|
-
# When any of the history methods is used the first time, the data is read
|
|
99
|
-
# from the API and cached internally, and that data is
|
|
100
|
-
# used for all future calls.. To re-read the data from the API and re-cache it,
|
|
101
|
-
# provide any non-false parameter to the subset methods , or `refresh: true`
|
|
102
|
-
# to the main {#history} method.
|
|
87
|
+
# Computer Management History and logs can now be retrieved both from a
|
|
88
|
+
# Computer instance, and directly via class methods without fetching an
|
|
89
|
+
# instance. This is handled by the mixed-in {JSS::ManagementHistory} module,
|
|
90
|
+
# Q.V. for details.
|
|
103
91
|
#
|
|
104
92
|
# === Appication Usage History
|
|
105
93
|
#
|
data/lib/jss/api_object/group.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
### Copyright
|
|
1
|
+
### Copyright 2018 Pixar
|
|
2
2
|
|
|
3
3
|
###
|
|
4
4
|
### Licensed under the Apache License, Version 2.0 (the "Apache License")
|
|
@@ -32,9 +32,9 @@ module JSS
|
|
|
32
32
|
# Objects mixing in this module have 'management history' in the JSS, which at
|
|
33
33
|
# this point is Computers and MobileDevices
|
|
34
34
|
#
|
|
35
|
-
# *Important:* this is 'management history', i.e. the history
|
|
36
|
-
# of mdm commands, locations, apps, and other events that are part
|
|
37
|
-
# management and inventory collection.
|
|
35
|
+
# *Important:* this is 'management history', i.e. the history and logs
|
|
36
|
+
# of mdm commands, locations, apps, policies, and other events that are part
|
|
37
|
+
# of management and inventory collection.
|
|
38
38
|
#
|
|
39
39
|
# When viewing the details page for a computer or mobile device in the
|
|
40
40
|
# Web UI, this is the data visible in the 'History' pane of the page.
|
|
@@ -52,31 +52,42 @@ module JSS
|
|
|
52
52
|
# instance methods that are wrappers around the class methods. The methods
|
|
53
53
|
# have the same names, but of course the class methods require arguments
|
|
54
54
|
# specifying the target for which to retrieve data, and which API connection
|
|
55
|
-
# to use.
|
|
55
|
+
# to use (defaulting to the currently active connection).
|
|
56
56
|
#
|
|
57
57
|
# == Raw data versus processed data & event object classes
|
|
58
58
|
#
|
|
59
59
|
# The primary data-retrieval method for management history data is
|
|
60
60
|
# {JSS::ManagementHistory.management_history}. This method returns the raw
|
|
61
|
-
# JSON data from the API, parsed into a
|
|
61
|
+
# JSON data from the API, parsed into a Ruby Hash. If you don't specify a
|
|
62
|
+
# subset, the data returned can be very large.
|
|
62
63
|
#
|
|
63
|
-
# This data is somewhat inconsistent in
|
|
64
|
-
# different
|
|
64
|
+
# This data is somewhat inconsistent in its structure and content across the
|
|
65
|
+
# different subsets of history events, but you're welcome to use it if needed.
|
|
65
66
|
#
|
|
66
67
|
# To provide a more consistent and ruby-like interface to the history events,
|
|
67
68
|
# the remaining methods, which only return subsets of the full dataset, will
|
|
68
69
|
# return Arrays of instances of the classes defined in this module.
|
|
69
70
|
#
|
|
70
|
-
# For example, the {JSS::
|
|
71
|
-
#
|
|
72
|
-
# {JSS::
|
|
73
|
-
# JSS::ManagementHistory::PolicyLog objects.
|
|
74
|
-
#
|
|
71
|
+
# For example, the {JSS::MobileDevice.audit_history} method returns an Array
|
|
72
|
+
# of JSS::ManagementHistory::AuditEvent instances, and the
|
|
73
|
+
# {JSS::Computer.completed_policies} gives an Array of
|
|
74
|
+
# JSS::ManagementHistory::PolicyLog objects.
|
|
75
|
+
#
|
|
76
|
+
# These objects are read-only and provide access to their values via both
|
|
77
|
+
# attribute-style methods, and hash-like keys, similar to how OpenStruct
|
|
78
|
+
# objects do.
|
|
79
|
+
# This means that
|
|
80
|
+
# `some_log_event.date_time`
|
|
81
|
+
# and
|
|
82
|
+
# `some_log_event[:date_time]`
|
|
83
|
+
# are identical.
|
|
84
|
+
# This *may* help with some backward-compatibility issues.
|
|
85
|
+
#
|
|
75
86
|
#
|
|
76
87
|
# NOTE: History queries from the API are *not* cached in ruby-jss, like the
|
|
77
|
-
# APIObject.all data is - it is queried anew every time. For this reason,
|
|
78
|
-
# are encouraged to store the results of these methods in variables for
|
|
79
|
-
# use if needed.
|
|
88
|
+
# APIObject.all data is - instead it is queried anew every time. For this reason,
|
|
89
|
+
# you are encouraged to store the results of these methods in variables for
|
|
90
|
+
# later use if needed.
|
|
80
91
|
#
|
|
81
92
|
module ManagementHistory
|
|
82
93
|
|
|
@@ -177,7 +188,7 @@ module JSS
|
|
|
177
188
|
#
|
|
178
189
|
def management_history(ident, subset = nil, api: JSS.api)
|
|
179
190
|
id = valid_id ident, api: api
|
|
180
|
-
raise JSS::NoSuchItemError, "No #{RSRC_OBJECT_KEY} matches identifier: #{ident}" unless id
|
|
191
|
+
raise JSS::NoSuchItemError, "No #{self::RSRC_OBJECT_KEY} matches identifier: #{ident}" unless id
|
|
181
192
|
|
|
182
193
|
if self == JSS::Computer
|
|
183
194
|
@hist_subsets ||= HIST_COMPUTER_SUBSETS
|
|
@@ -852,6 +863,7 @@ module JSS
|
|
|
852
863
|
|
|
853
864
|
end # module JSS
|
|
854
865
|
|
|
866
|
+
require 'jss/api_object/management_history/hashlike'
|
|
855
867
|
require 'jss/api_object/management_history/audit_event'
|
|
856
868
|
require 'jss/api_object/management_history/casper_imaging_log'
|
|
857
869
|
require 'jss/api_object/management_history/casper_remote_log'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#
|
|
2
|
+
module JSS
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
module ManagementHistory
|
|
6
|
+
|
|
7
|
+
# This is mixed in to the history event classes to
|
|
8
|
+
# provide hash-like access to their attributes, so that
|
|
9
|
+
# `some_event[:date_time]`
|
|
10
|
+
# works the same as
|
|
11
|
+
# `some_event.date_time`
|
|
12
|
+
# just as with OpenStruct objects
|
|
13
|
+
#
|
|
14
|
+
module HashLike
|
|
15
|
+
|
|
16
|
+
def [](attr)
|
|
17
|
+
self.send attr.to_sym
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end # HashLike
|
|
21
|
+
|
|
22
|
+
end # module ManagementHistory
|
|
23
|
+
|
|
24
|
+
end # module JSS
|