xolo-admin 1.0.0

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.
@@ -0,0 +1,75 @@
1
+ # Copyright 2025 Pixar
2
+ #
3
+ # Licensed under the terms set forth in the LICENSE.txt file available at
4
+ # at the root of this project.
5
+ #
6
+ #
7
+
8
+ # frozen_string_literal: true
9
+
10
+ # main module
11
+ module Xolo
12
+
13
+ module Admin
14
+
15
+ # Stuff that works with data from the Jamf Pro server
16
+ # via the Xolo Server
17
+ #
18
+ module JamfPro
19
+
20
+ # Constants
21
+ ##########################
22
+ ##########################
23
+
24
+ JAMF_ROUTE_BASE = '/jamf'
25
+
26
+ # Xolo server route to the list of package names
27
+ PACKAGE_NAME_ROUTE = "#{JAMF_ROUTE_BASE}/package-names"
28
+
29
+ # Xolo server route to the list of computer group names
30
+ COMPUTER_GROUP_NAME_ROUTE = "#{JAMF_ROUTE_BASE}/computer-group-names"
31
+
32
+ # Xolo server route to the list available categories
33
+ CATEGORY_NAME_ROUTE = "#{JAMF_ROUTE_BASE}/category-names"
34
+
35
+ # Module Methods
36
+ ##########################
37
+ ##########################
38
+
39
+ # when this module is included
40
+ def self.included(includer)
41
+ Xolo.verbose_include includer, self
42
+ end
43
+
44
+ # when this module is extended
45
+ def self.extended(extender)
46
+ Xolo.verbose_extend extender, self
47
+ end
48
+
49
+ # Instance Methods
50
+ ##########################
51
+ ##########################
52
+
53
+ # @return [Array<String>] the names of all Package objects in Jamf Pro
54
+ #######################
55
+ def jamf_package_names
56
+ @jamf_package_names ||= server_cnx.get(PACKAGE_NAME_ROUTE).body
57
+ end
58
+
59
+ # @return [Array<String>] the names of all ComputerGroup objects in Jamf Pro
60
+ #######################
61
+ def jamf_computer_group_names
62
+ @jamf_computer_group_names ||= server_cnx.get(COMPUTER_GROUP_NAME_ROUTE).body
63
+ end
64
+
65
+ # @return [Array<String>] the names of all Categories in Jamf Pro.
66
+ #######################
67
+ def jamf_category_names
68
+ @jamf_category_names ||= server_cnx.get(CATEGORY_NAME_ROUTE).body
69
+ end
70
+
71
+ end # module
72
+
73
+ end # module Admin
74
+
75
+ end # module Xolo