Class: JSS::OSXConfigurationProfile

Inherits:
APIObject
  • Object
show all
Includes:
Scopable, SelfServable, Updatable
Defined in:
lib/jss-api/api_object/osx_configuration_profile.rb

Overview

An OS X Configuration Profile in the JSS.

Note that the profile payloads and the profile UUID cannot be edited or updated with this via this class. Use the web UI.

See Also:

Constant Summary collapse

RSRC_BASE =

The base for REST resources of this class

"osxconfigurationprofiles"
RSRC_LIST_KEY =

the hash key used for the JSON list output of all objects in the JSS

:os_x_configuration_profiles
RSRC_OBJECT_KEY =

The hash key used for the JSON object output. It’s also used in various error messages

:os_x_configuration_profile
VALID_DATA_KEYS =

these keys, as well as :id and :name, are present in valid API JSON data for this class

[:distribution_method, :scope, :redeploy_on_update]
SCOPE_TARGET_KEY =

Our scopes deal with computers

:computers
SELF_SERVICE_TARGET =

Our SelfService happens on OSX

:osx
SELF_SERVICE_PAYLOAD =

Our SelfService deploys profiles

:profile
DISTRIBUTION_METHODS =

The possible values for the :distribution_method

["Install Automatically", "Make Available in Self Service"]
SELF_SERVICE_DIST_METHOD =
"Make Available in Self Service"
LEVELS =

The possible values for :level

["user", "computer"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ OSXConfigurationProfile

See JSS::APIObject#initialize



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 129

def initialize (args = {})
  
  super
  
  @description = @main_subset[:description]
  @distribution_method = @main_subset[:distribution_method]
  @user_removable = @main_subset[:user_removable]
  @level = @main_subset[:level]
  @uuid = @main_subset[:uuid]
  @redeploy_on_update = @main_subset[:redeploy_on_update]
  @payloads = @main_subset[:payloads]
  
  self.parse_scope
  self.parse_self_service
  
end

Instance Attribute Details

#descriptionString



102
103
104
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 102

def description
  @description
end

#distribution_methodString



105
106
107
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 105

def distribution_method
  @distribution_method
end

#levelString



111
112
113
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 111

def level
  @level
end

#need_to_updateBoolean (readonly) Originally defined in module Updatable

#payloadsString (readonly)



120
121
122
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 120

def payloads
  @payloads
end

#redeploy_on_updateBoolean (readonly)



117
118
119
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 117

def redeploy_on_update
  @redeploy_on_update
end

#scopeObject Originally defined in module Scopable

Attribtues

#self_service_categoriesArray<Hash> (readonly) Originally defined in module SelfServable

Each Hash has these keys about the category

  • :id => [Integer] the JSS id of the category

  • :name => [String] the name of the category

  • :display_in => [Boolean] should the item be displayed in this category in SSvc? (OSX SSvc only)

  • :feature_in => [Boolean] should the item be featured in this category in SSVC? (OSX SSvc only)

NOTE: as of Casper 9.61 there’s a bug in the JSON output from the API, and only the last category is returned, if more than one are set.

#self_service_descriptionString Originally defined in module SelfServable

#self_service_feature_on_main_pageBoolean Originally defined in module SelfServable

#self_service_force_users_to_view_descriptionBoolean Originally defined in module SelfServable

#self_service_iconHash (readonly) Originally defined in module SelfServable

The Hash contains these keys with info about the icon:

  • :filename => [String] The name of the image file uploaded to the JSS

  • :uri => [String] the URI for retriving the icon

  • :id => [Integer] the JSS id number for the icon (not all SSvc items have this)

  • :data => [String] the icon image encoded as Base64 (not all SSvc items have this)

#self_service_install_button_textString Originally defined in module SelfServable

#self_service_securityHash (readonly) Originally defined in module SelfServable

The keys are

  • :removal_disallowed => [String] one of the items in IOS_PROFILE_REMOVAL_OPTIONS

  • :password => [String] if :removal_disallowed is “With Authorization”, this contains the passwd (in plaintext) needed to remove the profile.

NOTE that the key should be called :removal_allowed, since ‘Never’ means it can’t be removed.

#user_removableBoolean



108
109
110
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 108

def user_removable
  @user_removable
end

#uuidString (readonly)



114
115
116
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 114

def uuid
  @uuid
end

Instance Method Details

#add_self_service_category(new_cat, display_in = true, feature_in = false) ⇒ void Also known as: change_self_service_category Originally defined in module SelfServable

This method returns an undefined value.

Add or change one of the categories for this item in SSvc.

#in_self_service?Boolean



203
204
205
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 203

def in_self_service?
  @distribution_method == SELF_SERVICE_DIST_METHOD
end

#name=(newname) ⇒ void Originally defined in module Updatable

This method returns an undefined value.

Change the name of this item Remember to #update to push changes to the server.

#parse_scopevoid Originally defined in module Scopable

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Call this during initialization of objects that have a scope and the scope instance will be created from @init_data

#parse_self_servicevoid Originally defined in module SelfServable

This method returns an undefined value.

Call this during initialization of objects that have a self_service subset and the self_service attributes will be populated (as primary attributes) from @init_data

#parsed_payloadsHash



219
220
221
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 219

def parsed_payloads
  Plist.parse_xml @payloads
end

#payload_contentArray<Hash>



226
227
228
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 226

def payload_content
  parsed_payloads['PayloadContent']
end

#payload_typesArray<String>



233
234
235
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 233

def payload_types
  payload_content.map{|p| p['PayloadType'] }
end

#profile_can_be_removed(new_val) ⇒ void Originally defined in module SelfServable

This method returns an undefined value.

Set whether or when the user can remove a profile installed with SSvc

#remove_self_service_category=(cat) ⇒ void Originally defined in module SelfServable

This method returns an undefined value.

Remove a category from those for this item in SSvc

#self_service_xmlREXML::Element Originally defined in module SelfServable

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return a REXML <location> element to be included in the rest_xml of objects that have a Location subset

#should_updatevoid Originally defined in module Scopable

This method returns an undefined value.

When the scope changes, it calls this to tell us that an update is needed.

#updateObject Originally defined in module Scopable

A wrapper around the update method, to try catching RestClient::Conflict 409 errors when we couldn’t verify all ldap users/groups due to lack of ldap connections

#user_removable?Boolean



211
212
213
# File 'lib/jss-api/api_object/osx_configuration_profile.rb', line 211

def user_removable?
  @user_removable
end