Class: JSS::OSXConfigurationProfile

Inherits:
APIObject show all
Includes:
Scopable, SelfServable, Updatable
Defined in:
lib/jss/api_object/osx_configuration_profile.rb,
lib/jss.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



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

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]
end

Instance Attribute Details

#descriptionString

Returns the description of this profile.

Returns:

  • (String)

    the description of this profile



106
107
108
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 106

def description
  @description
end

#distribution_methodString

Returns the distribution_method of this profile.

Returns:

  • (String)

    the distribution_method of this profile



109
110
111
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 109

def distribution_method
  @distribution_method
end

#iconJSS::Icon? Also known as: self_service_icon Originally defined in module SelfServable

Returns The icon used in self-service.

Returns:

  • (JSS::Icon, nil)

    The icon used in self-service

#in_self_serviceBoolean (readonly) Also known as: in_self_service? Originally defined in module SelfServable

Returns Is this thing available in Self Service?.

Returns:

  • (Boolean)

    Is this thing available in Self Service?

#levelString

Returns the level (user/computer) of this profile.

Returns:

  • (String)

    the level (user/computer) of this profile



115
116
117
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 115

def level
  @level
end

#need_to_updateBoolean (readonly) Originally defined in module Updatable

Returns do we have unsaved changes?.

Returns:

  • (Boolean)

    do we have unsaved changes?

#payloadsString (readonly)

Returns the plist containing the payloads for this profile. NOT Updatable.

Returns:

  • (String)

    the plist containing the payloads for this profile. NOT Updatable



124
125
126
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 124

def payloads
  @payloads
end

#redeploy_on_updateBoolean (readonly)

Returns Should this profile be redeployed when an inventory update happens?.

Returns:

  • (Boolean)

    Should this profile be redeployed when an inventory update happens?



121
122
123
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 121

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

Most objects also include one or both of these keys:

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

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

Returns:

  • (Array<Hash>)

    The categories in which this item should appear in SSvc

#self_service_descriptionString Originally defined in module SelfServable

Returns The verbage that appears in SelfSvc for this item.

Returns:

  • (String)

    The verbage that appears in SelfSvc for this item

#self_service_feature_on_main_pageBoolean Originally defined in module SelfServable

Only applicable to macOS targets

Returns:

  • (Boolean)

    Should this item feature on the main page of SSvc?

#self_service_force_users_to_view_descriptionBoolean Originally defined in module SelfServable

Returns Should an extra window appear before the user can install the item? (OSX SSvc only).

Returns:

  • (Boolean)

    Should an extra window appear before the user can install the item? (OSX SSvc only)

#self_service_install_button_textString Originally defined in module SelfServable

Returns The text label on the install button in SSvc (OSX SSvc only).

Returns:

  • (String)

    The text label on the install button in SSvc (OSX SSvc only)

#self_service_removal_passwordString (readonly) Originally defined in module SelfServable

Returns The password needed for removal, in plain text.

Returns:

  • (String)

    The password needed for removal, in plain text.

#self_service_user_removableSymbol Originally defined in module SelfServable

Returns one of the keys in PROFILE_REMOVAL_BY_USER.

Returns:

  • (Symbol)

    one of the keys in PROFILE_REMOVAL_BY_USER

#user_removableBoolean

Returns can the user remove this profile.

Returns:

  • (Boolean)

    can the user remove this profile



112
113
114
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 112

def user_removable
  @user_removable
end

#uuidString (readonly)

Returns the uuid of this profile. NOT Updatable.

Returns:

  • (String)

    the uuid of this profile. NOT Updatable



118
119
120
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 118

def uuid
  @uuid
end

Instance Method Details

#add_self_service_category(new_cat, display_in: true, feature_in: false) ⇒ void Also known as: set_self_service_category, 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 self service

Parameters:

  • new_cat (String, Integer)

    the name or id of a category where this object should appear in SelfSvc

  • display_in (Boolean) (defaults to: true)

    should this item appear in the SelfSvc page for the category? Only meaningful in applicable classes

  • feature_in (Boolean) (defaults to: false)

    should this item be featured in the SelfSvc page for the category? Only meaningful in applicable classes. NOTE: this will always be false if display_in is false.

Raises:

#add_to_self_servicevoid Originally defined in module SelfServable

This method returns an undefined value.

Add this object to self service if not already there.

#in_self_service?Boolean

Returns is this profile available in Self Service?.

Returns:

  • (Boolean)

    is this profile available in Self Service?



203
204
205
# File 'lib/jss/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.

Parameters:

  • newname (String)

    the new name

Raises:

#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

#parsed_payloadsHash

Returns The payload plist parsed into a Ruby hash.

Returns:

  • (Hash)

    The payload plist parsed into a Ruby hash



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

def parsed_payloads
  Plist.parse_xml @payloads
end

#payload_contentArray<Hash>

Returns the individual payloads from the payload Plist.

Returns:

  • (Array<Hash>)

    the individual payloads from the payload Plist



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

def payload_content
  parsed_payloads['PayloadContent']
end

#payload_typesArray<String>

Returns the PayloadType of each payload (e.g. com.apple.caldav.account).

Returns:

  • (Array<String>)

    the PayloadType of each payload (e.g. com.apple.caldav.account)



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

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

#remove_from_self_servicevoid Originally defined in module SelfServable

This method returns an undefined value.

Remove this object from self service if it’s there.

#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

Parameters:

  • cat (String, Integer)

    the name or id of the category to remove

#self_service_payloadSymbol Originally defined in module SelfServable

What does this object deploy to the device via self service?

Returns:

  • (Symbol)

    :profile, :app, or :policy

#self_service_targetsArray<Symbol> Originally defined in module SelfServable

What devices types can get this thing in Self Service

Returns:

  • (Array<Symbol>)

    An array of :macos, :ios, or both.

#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

#upload(type, local_file) ⇒ String Originally defined in module Uploadable

Upload a file to the JSS via the REST Resource of the object to which this module is mixed in.

Parameters:

  • type (Symbol)

    the type of upload happening. Must be one of the keys defined in the class’s UPLOAD_TYPES Hash.

  • local_file (String, Pathname)

    String or Pathname pointing to the locally-readable file to be uploaded.

Returns:

  • (String)

    The xml response from the server.

Raises:

#user_removable?Boolean

Returns is this profile removable by the user?.

Returns:

  • (Boolean)

    is this profile removable by the user?



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

def user_removable?
  @user_removable
end