ruby-jss 0.6.3

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.

Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +7 -0
  3. data/CHANGES.md +112 -0
  4. data/LICENSE.txt +174 -0
  5. data/README.md +426 -0
  6. data/THANKS.md +6 -0
  7. data/bin/cgrouper +485 -0
  8. data/bin/subnet-update +400 -0
  9. data/lib/jss-api.rb +2 -0
  10. data/lib/jss.rb +190 -0
  11. data/lib/jss/api_connection.rb +410 -0
  12. data/lib/jss/api_object.rb +616 -0
  13. data/lib/jss/api_object/advanced_search.rb +389 -0
  14. data/lib/jss/api_object/advanced_search/advanced_computer_search.rb +95 -0
  15. data/lib/jss/api_object/advanced_search/advanced_mobile_device_search.rb +96 -0
  16. data/lib/jss/api_object/advanced_search/advanced_user_search.rb +95 -0
  17. data/lib/jss/api_object/building.rb +92 -0
  18. data/lib/jss/api_object/category.rb +147 -0
  19. data/lib/jss/api_object/computer.rb +852 -0
  20. data/lib/jss/api_object/creatable.rb +98 -0
  21. data/lib/jss/api_object/criteriable.rb +189 -0
  22. data/lib/jss/api_object/criteriable/criteria.rb +231 -0
  23. data/lib/jss/api_object/criteriable/criterion.rb +228 -0
  24. data/lib/jss/api_object/department.rb +93 -0
  25. data/lib/jss/api_object/distribution_point.rb +560 -0
  26. data/lib/jss/api_object/extendable.rb +221 -0
  27. data/lib/jss/api_object/extension_attribute.rb +466 -0
  28. data/lib/jss/api_object/extension_attribute/computer_extension_attribute.rb +362 -0
  29. data/lib/jss/api_object/extension_attribute/mobile_device_extension_attribute.rb +189 -0
  30. data/lib/jss/api_object/extension_attribute/user_extension_attribute.rb +117 -0
  31. data/lib/jss/api_object/group.rb +380 -0
  32. data/lib/jss/api_object/group/computer_group.rb +124 -0
  33. data/lib/jss/api_object/group/mobile_device_group.rb +139 -0
  34. data/lib/jss/api_object/group/user_group.rb +139 -0
  35. data/lib/jss/api_object/ldap_server.rb +535 -0
  36. data/lib/jss/api_object/locatable.rb +286 -0
  37. data/lib/jss/api_object/matchable.rb +97 -0
  38. data/lib/jss/api_object/mobile_device.rb +556 -0
  39. data/lib/jss/api_object/netboot_server.rb +148 -0
  40. data/lib/jss/api_object/network_segment.rb +414 -0
  41. data/lib/jss/api_object/osx_configuration_profile.rb +262 -0
  42. data/lib/jss/api_object/package.rb +839 -0
  43. data/lib/jss/api_object/peripheral.rb +335 -0
  44. data/lib/jss/api_object/peripheral_type.rb +295 -0
  45. data/lib/jss/api_object/policy.rb +898 -0
  46. data/lib/jss/api_object/purchasable.rb +316 -0
  47. data/lib/jss/api_object/removable_macaddr.rb +98 -0
  48. data/lib/jss/api_object/scopable.rb +136 -0
  49. data/lib/jss/api_object/scopable/scope.rb +621 -0
  50. data/lib/jss/api_object/script.rb +631 -0
  51. data/lib/jss/api_object/self_servable.rb +356 -0
  52. data/lib/jss/api_object/site.rb +93 -0
  53. data/lib/jss/api_object/software_update_server.rb +109 -0
  54. data/lib/jss/api_object/updatable.rb +117 -0
  55. data/lib/jss/api_object/uploadable.rb +138 -0
  56. data/lib/jss/api_object/user.rb +272 -0
  57. data/lib/jss/client.rb +504 -0
  58. data/lib/jss/compatibility.rb +66 -0
  59. data/lib/jss/composer.rb +185 -0
  60. data/lib/jss/configuration.rb +306 -0
  61. data/lib/jss/db_connection.rb +298 -0
  62. data/lib/jss/exceptions.rb +95 -0
  63. data/lib/jss/ruby_extensions.rb +35 -0
  64. data/lib/jss/ruby_extensions/filetest.rb +43 -0
  65. data/lib/jss/ruby_extensions/hash.rb +79 -0
  66. data/lib/jss/ruby_extensions/ipaddr.rb +91 -0
  67. data/lib/jss/ruby_extensions/pathname.rb +77 -0
  68. data/lib/jss/ruby_extensions/string.rb +59 -0
  69. data/lib/jss/ruby_extensions/time.rb +63 -0
  70. data/lib/jss/server.rb +108 -0
  71. data/lib/jss/utility.rb +478 -0
  72. data/lib/jss/version.rb +31 -0
  73. metadata +187 -0
@@ -0,0 +1,356 @@
1
+ ### Copyright 2016 Pixar
2
+ ###
3
+ ### Licensed under the Apache License, Version 2.0 (the "Apache License")
4
+ ### with the following modification; you may not use this file except in
5
+ ### compliance with the Apache License and the following modification to it:
6
+ ### Section 6. Trademarks. is deleted and replaced with:
7
+ ###
8
+ ### 6. Trademarks. This License does not grant permission to use the trade
9
+ ### names, trademarks, service marks, or product names of the Licensor
10
+ ### and its affiliates, except as required to comply with Section 4(c) of
11
+ ### the License and to reproduce the content of the NOTICE file.
12
+ ###
13
+ ### You may obtain a copy of the Apache License at
14
+ ###
15
+ ### http://www.apache.org/licenses/LICENSE-2.0
16
+ ###
17
+ ### Unless required by applicable law or agreed to in writing, software
18
+ ### distributed under the Apache License with the above modification is
19
+ ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20
+ ### KIND, either express or implied. See the Apache License for the specific
21
+ ### language governing permissions and limitations under the Apache License.
22
+ ###
23
+ ###
24
+
25
+ ###
26
+ module JSS
27
+
28
+ #####################################
29
+ ### Module Variables
30
+ #####################################
31
+
32
+ #####################################
33
+ ### Module Methods
34
+ #####################################
35
+
36
+ #####################################
37
+ ### Sub-Modules
38
+ #####################################
39
+
40
+ ### A mix-in module for handling Self Service data for objects in the JSS.
41
+ ###
42
+ ### The JSS objects that have Self Service data return it in a :self_service subset,
43
+ ### which all have similar data, a hash with at least these keys:
44
+ ### - :self_service_description
45
+ ### - :self_service_icon
46
+ ###
47
+ ### Most also have:
48
+ ### - :feature_on_main_page
49
+ ### - :self_service_categories
50
+ ###
51
+ ### iOS Profiles in self service have this key:
52
+ ### - :security
53
+ ###
54
+ ### Additionally, items that apper in OS X SlfSvc have these keys:
55
+ ### - :install_button_text
56
+ ### - :force_users_to_view_description
57
+ ###
58
+ ### See the attribute definitions for details of these values and structures.
59
+ ###
60
+ ### Including this module in an {APIObject} subclass and calling {#parse_self_service} in the
61
+ ### subclass's constructor will give it matching attributes with 'self_service_'
62
+ ### appended if needed, e.g. {#self_service_feature_on_main_page}
63
+ ###
64
+ ### If the subclass is creatable or updatable, calling {#self_service_xml} returns
65
+ ### a REXML element representing the Self Service subset, to be included with the
66
+ ### #rest_xml output of the subclass.
67
+ ###
68
+ ### Classes including this module *must*:
69
+ ###
70
+ ### - Define the constant SELF_SERVICE_TARGET which contains either :osx or :ios
71
+ ### - Define the constant SELF_SERVICE_PAYLOAD which contains one of :policy, :profile, or :app
72
+ ### - Call {#parse_self_service} in the subclass's constructor after calling super
73
+ ### - Include the result of {#self_service_xml} in their #rest_xml output
74
+ ### - Define the method #in_self_service? which returns a Boolean indicating that the item is
75
+ ### available in self service. Different API objects indicate this in different ways.
76
+ ### - Define the method #user_removable? which returns Boolean indicating that the item (a profile)
77
+ ### can be removed by the user in SSvc. OS X profiles store this in the :user_removable key of the
78
+ ### :general subset as a boolean, whereas iOS profiles stor it in :security as one of 3 strings
79
+ ###
80
+ ###
81
+ ### Notes:
82
+ ### - Self service icons cannot be modified via this code. Use the Web UI.
83
+ ### - There an API bug in handling categories, and all but the last one are ommitted. Until this is fixed, categories
84
+ ### cannot be saved via this code since that would cause data-loss when more than one category is applied.
85
+ ###
86
+ module SelfServable
87
+
88
+ #####################################
89
+ ### Constants
90
+ #####################################
91
+
92
+ SELF_SERVABLE = true
93
+
94
+ IOS_PROFILE_REMOVAL_OPTIONS = ["Always", "With Authorization", "Never"]
95
+
96
+ #####################################
97
+ ### Variables
98
+ #####################################
99
+
100
+
101
+ #####################################
102
+ ### Attribtues
103
+ #####################################
104
+
105
+
106
+ ### @return [String] The verbage that appears in SelfSvc for this item
107
+ attr_reader :self_service_description
108
+
109
+ ### @return [Hash] The icon that appears in SelfSvc for this item
110
+ ###
111
+ ### The Hash contains these keys with info about the icon:
112
+ ### - :filename => [String] The name of the image file uploaded to the JSS
113
+ ### - :uri => [String] the URI for retriving the icon
114
+ ### - :id => [Integer] the JSS id number for the icon (not all SSvc items have this)
115
+ ### - :data => [String] the icon image encoded as Base64 (not all SSvc items have this)
116
+ ###
117
+ attr_reader :self_service_icon
118
+
119
+ ### @return [Boolean] Should this item feature on the main page of SSvc?
120
+ attr_reader :self_service_feature_on_main_page
121
+
122
+ ### @return [Array<Hash>] The categories in which this item should appear in SSvc
123
+ ###
124
+ ### Each Hash has these keys about the category
125
+ ### - :id => [Integer] the JSS id of the category
126
+ ### - :name => [String] the name of the category
127
+ ### - :display_in => [Boolean] should the item be displayed in this category in SSvc? (OSX SSvc only)
128
+ ### - :feature_in => [Boolean] should the item be featured in this category in SSVC? (OSX SSvc only)
129
+ ###
130
+ ### NOTE: as of Casper 9.61 there's a bug in the JSON output from the API, and only the last
131
+ ### category is returned, if more than one are set.
132
+ ###
133
+ attr_reader :self_service_categories
134
+
135
+ ### @return [Hash] The security settings for iOS profiles in SSvc
136
+ ###
137
+ ### The keys are
138
+ ### - :removal_disallowed => [String] one of the items in IOS_PROFILE_REMOVAL_OPTIONS
139
+ ### - :password => [String] if :removal_disallowed is "With Authorization", this contains the passwd (in plaintext)
140
+ ### needed to remove the profile.
141
+ ###
142
+ ### NOTE that the key should be called :removal_allowed, since 'Never' means it can't be removed.
143
+ ###
144
+ attr_reader :self_service_security
145
+
146
+ ### @return [String] The text label on the install button in SSvc (OSX SSvc only)
147
+ attr_reader :self_service_install_button_text
148
+
149
+ ### @return [Boolean] Should an extra window appear before the user can install the item? (OSX SSvc only)
150
+ attr_reader :self_service_force_users_to_view_description
151
+
152
+
153
+ #####################################
154
+ ### Mixed-in Instance Methods
155
+ #####################################
156
+
157
+ ###
158
+ ### Call this during initialization of
159
+ ### objects that have a self_service subset
160
+ ### and the self_service attributes will be populated
161
+ ### (as primary attributes) from @init_data
162
+ ###
163
+ ### @return [void]
164
+ ###
165
+ def parse_self_service
166
+ @init_data[:self_service] ||= {}
167
+ ss_data = @init_data[:self_service]
168
+
169
+ @self_service_description = ss_data[:self_service_description]
170
+ @self_service_icon = ss_data[:self_service_icon]
171
+
172
+ @self_service_feature_on_main_page = ss_data[:feature_on_main_page]
173
+
174
+ # TEMPORARY - until JAMF fixes the category data in JSON
175
+ @self_service_categories = [
176
+ ss_data[:self_service_categories][:category]
177
+ ]
178
+
179
+ # make this an empty hash if needed
180
+ @self_service_security = ss_data[:security] || {}
181
+
182
+ # if this is an osx profile, set @self_service_security[:removal_disallowed] to "Always" or "Never"
183
+ # to indicate the boolean :user_removable
184
+ if @init_data[:general].keys.include? :user_removable
185
+ @self_service_security[:removal_disallowed] = @init_data[:general][:user_removable] ? "Always" : "Never"
186
+ end
187
+
188
+ @self_service_install_button_text = ss_data[:install_button_text]
189
+ @self_service_force_users_to_view_description = ss_data[:force_users_to_view_description]
190
+
191
+ end
192
+
193
+
194
+ ###
195
+ ###
196
+ ### Setters
197
+ ###
198
+
199
+ ###
200
+ ### @param new_val[String] the new discription
201
+ ###
202
+ ### @return [void]
203
+ ###
204
+ def self_service_description= (new_val)
205
+ return nil if @self_service_description == new_val
206
+ @self_service_description = new_val.strip!
207
+ @need_to_update = true
208
+ end
209
+
210
+ ###
211
+ ### @param new_val[String] the new install button text
212
+ ###
213
+ ### @return [void]
214
+ ###
215
+ def self_service_install_button_text= (new_val)
216
+ return nil if @self_service_install_button_text == new_val
217
+ raise JSS::InvalidDataError, "Only OS X Self Service Items can have custom button text" unless self.class::SELF_SERVICE_TARGET == :osx
218
+ @self_service_install_button_text = new_val.strip
219
+ @need_to_update = true
220
+ end
221
+
222
+ ###
223
+ ### @param new_val[Boolean] should this appear on the main SelfSvc page?
224
+ ###
225
+ ### @return [void]
226
+ ###
227
+ def self_service_feature_on_main_page= (new_val)
228
+ return nil if @self_service_feature_on_main_page == new_val
229
+ raise JSS::InvalidDataError, "New value must be true or false" unless JSS::TRUE_FALSE.include? new_val
230
+ @self_service_feature_on_main_page = new_val
231
+ @need_to_update = true
232
+ end
233
+
234
+ ###
235
+ ### @param new_val[Boolean] should this appear on the main SelfSvc page?
236
+ ###
237
+ ### @return [void]
238
+ ###
239
+ def self_service_force_users_to_view_description= (new_val)
240
+ return nil if @self_service_force_users_to_view_description == new_val
241
+ raise JSS::InvalidDataError, "Only OS X Self Service Items can force users to view description" unless self.class::SELF_SERVICE_TARGET == :osx
242
+ raise JSS::InvalidDataError, "New value must be true or false" unless JSS::TRUE_FALSE.include? new_val
243
+ @self_service_force_users_to_view_description = new_val
244
+ @need_to_update = true
245
+ end
246
+
247
+ ###
248
+ ### Add or change one of the categories for this item in SSvc.
249
+ ###
250
+ ### @param new_cat[String] the name of a category for this item in SelfSvc
251
+ ###
252
+ ### @param display_in[Boolean] should this item appear in the SelfSvc page for the new category?
253
+ ###
254
+ ### @param feature_in[Boolean] should this item be featured in the SelfSvc page for the new category?
255
+ ###
256
+ ### @return [void]
257
+ ###
258
+ def add_self_service_category (new_cat, display_in = true, feature_in = false)
259
+ new_cat.strip!
260
+ raise JSS::NoSuchItemError, "No category '#{new_cat}' in the JSS" unless JSS::Category.all_names(:refresh).include? new_cat
261
+ raise JSS::InvalidDataError, "display_in must be true or false" unless JSS::TRUE_FALSE.include? display_in
262
+ raise JSS::InvalidDataError, "feature_in must be true or false" unless JSS::TRUE_FALSE.include? feature_in
263
+
264
+ new_data = {:name => new_cat, :display_in => display_in, :feature_in => feature_in }
265
+
266
+ # see if this category is already among our categories.
267
+ idx = @self_service_categories.index{|c| c[new_cat]}
268
+
269
+ if idx
270
+ @self_service_categories[idx] = new_data
271
+ else
272
+ @self_service_categories << new_data
273
+ end
274
+
275
+ @need_to_update = true
276
+ end
277
+
278
+ ###
279
+ ### Remove a category from those for this item in SSvc
280
+ ###
281
+ ### @param cat[String] the name of the category to remove
282
+ ###
283
+ ### @return [void]
284
+ ###
285
+ def remove_self_service_category= (cat)
286
+ return nil unless @self_service_categories.map{|c| c[:name]}.include? cat
287
+ @self_service_categories.reject!{|c| c[:name]}
288
+ @need_to_update = true
289
+ end
290
+
291
+ ###
292
+ ### Set whether or when the user can remove a profile installed with SSvc
293
+ ###
294
+ ### @param new_val[String] one of the values in PROFILE_REMOVAL_OPTIONS, or true or false
295
+ ###
296
+ ### @return [void]
297
+ ###
298
+ def profile_can_be_removed (new_val)
299
+
300
+ new_val = "Always" if new_val === true
301
+ new_val = "Never" if new_val === false
302
+
303
+ return nil if new_val == @self_service_security[:removal_disallowed]
304
+ raise JSS::InvalidDataError, "" unless IOS_PROFILE_REMOVAL_OPTIONS.include? new_val
305
+
306
+ @self_service_security[:removal_disallowed] = new_val
307
+ end
308
+
309
+
310
+
311
+ ###
312
+ ### @api private
313
+ ###
314
+ ### Return a REXML <location> element to be
315
+ ### included in the rest_xml of
316
+ ### objects that have a Location subset
317
+ ###
318
+ ### @return [REXML::Element]
319
+ ###
320
+ def self_service_xml
321
+
322
+ ssvc = REXML::Element.new('self_service')
323
+
324
+ return ssvc unless self.in_self_service?
325
+
326
+ ssvc.add_element('self_service_description').text = @self_service_description
327
+ ssvc.add_element('feature_on_main_page').text = @self_service_feature_on_main_page
328
+
329
+ ### TEMPORARY - re-enable this when the category bug is fixed.
330
+
331
+ # cats = ssvc.add_element('self_service_categories')
332
+ # @self_service_categories.each do |cat|
333
+ # catelem = cats.add_element('category')
334
+ # catelem.add_element('name').text = cat[:name]
335
+ # catelem.add_element('display_in').text = cat[:display_in] if cat.keys.include? :display_in
336
+ # catelem.add_element('feature_in').text = cat[:feature_in] if cat.keys.include? :feature_in
337
+ # end
338
+
339
+ unless @self_service_security.empty?
340
+ sec = ssvc.add_element('security')
341
+ sec.add_element('removal_disallowed').text = @self_service_security[:removal_disallowed] if @self_service_security[:removal_disallowed]
342
+ sec.add_element('password').text = @self_service_security[:password] if @self_service_security[:password]
343
+ end
344
+
345
+ ssvc.add_element('install_button_text').text = @self_service_install_button_text if @self_service_install_button_text
346
+ ssvc.add_element('force_users_to_view_description').text = @self_service_force_users_to_view_description unless @self_service_force_users_to_view_description.nil?
347
+
348
+ return ssvc
349
+ end
350
+
351
+ ### aliases
352
+ alias change_self_service_category add_self_service_category
353
+
354
+ end # module SelfServable
355
+
356
+ end # module JSS
@@ -0,0 +1,93 @@
1
+ ### Copyright 2016 Pixar
2
+ ###
3
+ ### Licensed under the Apache License, Version 2.0 (the "Apache License")
4
+ ### with the following modification; you may not use this file except in
5
+ ### compliance with the Apache License and the following modification to it:
6
+ ### Section 6. Trademarks. is deleted and replaced with:
7
+ ###
8
+ ### 6. Trademarks. This License does not grant permission to use the trade
9
+ ### names, trademarks, service marks, or product names of the Licensor
10
+ ### and its affiliates, except as required to comply with Section 4(c) of
11
+ ### the License and to reproduce the content of the NOTICE file.
12
+ ###
13
+ ### You may obtain a copy of the Apache License at
14
+ ###
15
+ ### http://www.apache.org/licenses/LICENSE-2.0
16
+ ###
17
+ ### Unless required by applicable law or agreed to in writing, software
18
+ ### distributed under the Apache License with the above modification is
19
+ ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20
+ ### KIND, either express or implied. See the Apache License for the specific
21
+ ### language governing permissions and limitations under the Apache License.
22
+ ###
23
+ ###
24
+
25
+ ###
26
+ module JSS
27
+
28
+ #####################################
29
+ ### Module Variables
30
+ #####################################
31
+
32
+ #####################################
33
+ ### Module Methods
34
+ #####################################
35
+
36
+
37
+ #####################################
38
+ ### Classes
39
+ #####################################
40
+
41
+ ###
42
+ ### A Site in the JSS.
43
+ ###
44
+ ### These are simple, in that they only have an ID and a name.
45
+ ###
46
+ ### @see JSS::APIObject
47
+ ###
48
+ class Site < JSS::APIObject
49
+
50
+ #####################################
51
+ ### Mix-Ins
52
+ #####################################
53
+ include JSS::Creatable
54
+ include JSS::Updatable
55
+
56
+ #####################################
57
+ ### Class Methods
58
+ #####################################
59
+
60
+ #####################################
61
+ ### Class Constants
62
+ #####################################
63
+
64
+ ### The base for REST resources of this class
65
+ RSRC_BASE = "sites"
66
+
67
+ ### the hash key used for the JSON list output of all objects in the JSS
68
+ RSRC_LIST_KEY = :sites
69
+
70
+ ### The hash key used for the JSON object output.
71
+ ### It's also used in various error messages
72
+ RSRC_OBJECT_KEY = :site
73
+
74
+ ### these keys, as well as :id and :name, are present in valid API JSON data for this class
75
+ VALID_DATA_KEYS = []
76
+
77
+ #####################################
78
+ ### Attributes
79
+ #####################################
80
+
81
+ #####################################
82
+ ### Constructor
83
+ #####################################
84
+
85
+
86
+ #####################################
87
+ ### Public Instance Methods
88
+ #####################################
89
+
90
+
91
+ end # class site
92
+
93
+ end # module
@@ -0,0 +1,109 @@
1
+ ### Copyright 2016 Pixar
2
+ ###
3
+ ### Licensed under the Apache License, Version 2.0 (the "Apache License")
4
+ ### with the following modification; you may not use this file except in
5
+ ### compliance with the Apache License and the following modification to it:
6
+ ### Section 6. Trademarks. is deleted and replaced with:
7
+ ###
8
+ ### 6. Trademarks. This License does not grant permission to use the trade
9
+ ### names, trademarks, service marks, or product names of the Licensor
10
+ ### and its affiliates, except as required to comply with Section 4(c) of
11
+ ### the License and to reproduce the content of the NOTICE file.
12
+ ###
13
+ ### You may obtain a copy of the Apache License at
14
+ ###
15
+ ### http://www.apache.org/licenses/LICENSE-2.0
16
+ ###
17
+ ### Unless required by applicable law or agreed to in writing, software
18
+ ### distributed under the Apache License with the above modification is
19
+ ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20
+ ### KIND, either express or implied. See the Apache License for the specific
21
+ ### language governing permissions and limitations under the Apache License.
22
+ ###
23
+ ###
24
+
25
+ ###
26
+ module JSS
27
+
28
+ #####################################
29
+ ### Module Variables
30
+ #####################################
31
+
32
+ #####################################
33
+ ### Module Methods
34
+ #####################################
35
+
36
+ #####################################
37
+ ### Classes
38
+ #####################################
39
+
40
+ ###
41
+ ### A Software Update Server in the JSS
42
+ ###
43
+ ### Only minimally implemented, for access to the APIObject list methods
44
+ ###
45
+ ### @see JSS::APIObject
46
+ ###
47
+ class SoftwareUpdateServer < JSS::APIObject
48
+
49
+ #####################################
50
+ ### Mix-Ins
51
+ #####################################
52
+
53
+ #####################################
54
+ ### Class Methods
55
+ #####################################
56
+
57
+ #####################################
58
+ ### Class Constants
59
+ #####################################
60
+
61
+ ### The base for REST resources of this class
62
+ RSRC_BASE = "softwareupdateservers"
63
+
64
+ ### the hash key used for the JSON list output of all objects in the JSS
65
+ RSRC_LIST_KEY = :software_update_servers
66
+
67
+ ### The hash key used for the JSON object output.
68
+ ### It's also used in various error messages
69
+ RSRC_OBJECT_KEY = :software_update_server
70
+
71
+ ### these keys, as well as :id and :name, are present in valid API JSON data for this class
72
+ VALID_DATA_KEYS = [:set_system_wide, :port]
73
+
74
+ #####################################
75
+ ### Attributes
76
+ #####################################
77
+
78
+ ### @return [String]
79
+ attr_reader :ip_address
80
+
81
+ ### @return [Integer]
82
+ attr_reader :port
83
+
84
+ ### @return [Boolean]
85
+ attr_reader :set_system_wide
86
+
87
+
88
+ #####################################
89
+ ### Constructor
90
+ #####################################
91
+
92
+ ###
93
+ ### @see SS::APIObject#initialize
94
+ ###
95
+ def initialize (args = {})
96
+ super
97
+ @ip_address = @init_data[:ip_address]
98
+ @port = @init_data[:port]
99
+ @set_system_wide = @init_data[:set_system_wide]
100
+ end
101
+
102
+ #####################################
103
+ ### Public Instance Methods
104
+ #####################################
105
+
106
+
107
+ end # class NetbootServer
108
+
109
+ end # module