Class: JSS::ConfigurationProfile

Inherits:
APIObject show all
Includes:
Categorizable, Scopable, SelfServable, Sitable, Updatable
Defined in:
lib/jss/api_object/configuration_profile.rb,
lib/jss.rb

Overview

The parent class of OSXConfigurationProfile and MobileDeviceConfigurationProfile

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

DISTRIBUTION_METHODS =

The possible values for the distribution_method/deployment_method

['Install Automatically', 'Make Available in Self Service'].freeze
SELF_SERVICE_DIST_METHOD =

which DISTRIBUTION_METHODS means we're in self service?

'Make Available in Self Service'.freeze
SELF_SERVICE_PAYLOAD =

Our SelfService deploys profiles

:profile
SITE_SUBSET =

Where is the Site data in the API JSON?

:general
CATEGORY_SUBSET =

Where is the Category in the API JSON?

:general
CATEGORY_DATA_TYPE =

How is the category stored in the API data?

Hash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ ConfigurationProfile

See JSS::APIObject#initialize


92
93
94
95
96
97
98
# File 'lib/jss/api_object/configuration_profile.rb', line 92

def initialize(args = {})
  super
  @description = @main_subset[:description]
  @uuid = @main_subset[:uuid]
  @redeploy_on_update = @main_subset[:redeploy_on_update]
  @payloads = @main_subset[:payloads]
end

Instance Attribute Details

#descriptionString


76
77
78
# File 'lib/jss/api_object/configuration_profile.rb', line 76

def description
  @description
end

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

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

#need_to_updateBoolean (readonly) Originally defined in module Updatable

#payloadsString (readonly)


85
86
87
# File 'lib/jss/api_object/configuration_profile.rb', line 85

def payloads
  @payloads
end

#redeploy_on_updateBoolean (readonly)


82
83
84
# File 'lib/jss/api_object/configuration_profile.rb', line 82

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)

#self_service_descriptionString Originally defined in module SelfServable

#self_service_display_nameString (readonly) Originally defined in module SelfServable

#self_service_feature_on_main_pageBoolean Originally defined in module SelfServable

Only applicable to macOS targets

#self_service_force_users_to_view_descriptionBoolean Originally defined in module SelfServable

#self_service_install_button_textString Originally defined in module SelfServable

defaults to 'Install'

#self_service_notification_messageString Originally defined in module SelfServable

#self_service_notification_subjectString Originally defined in module SelfServable

object name.

#self_service_notification_typeSymbol Originally defined in module SelfServable

#self_service_notifications_enabledBoolean Also known as: self_service_notifications_enabled? Originally defined in module SelfServable

#self_service_reinstall_button_textString Originally defined in module SelfServable

defaults to 'Reinstall'

#self_service_reminder_frequencyInteger Originally defined in module SelfServable

#self_service_reminders_enabledBoolean Also known as: self_service_reminders_enabled? Originally defined in module SelfServable

#self_service_removal_passwordString (readonly) Originally defined in module SelfServable

#self_service_user_removableSymbol Originally defined in module SelfServable

#uuidString (readonly)


79
80
81
# File 'lib/jss/api_object/configuration_profile.rb', line 79

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

#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.

#category=(new_cat) ⇒ void Originally defined in module Categorizable

This method returns an undefined value.

Change the category of this object. Any of the NON_CATEGORIES values will unset the category

#category_assigned?Boolean Also known as: categorized? Originally defined in module Categorizable

Does this object have a category assigned?

#category_idInteger Originally defined in module Categorizable

The id of the category for this object.

#category_nameString Also known as: category Originally defined in module Categorizable

The name of the category for this object. For backward compatibility, this is aliased to just 'category'

#category_objectJSS::Category Originally defined in module Categorizable

The JSS::Category instance for this object's category

#createObject Originally defined in module SelfServable

HACK: ity hack hack… remove when jamf fixes these bugs

#evaluate_new_category(new_cat) ⇒ Array<String, Integer> Originally defined in module Categorizable

Given a category name or id, return the name and id TODO: use APIObject.exist? and/or APIObject.valid_id

#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

#parsed_payloadsHash

The @payloads Plist, parsed into a Ruby object


116
117
118
# File 'lib/jss/api_object/configuration_profile.rb', line 116

def parsed_payloads
  Plist.parse_xml @payloads
end

#payload_contentArray<Hash>


122
123
124
# File 'lib/jss/api_object/configuration_profile.rb', line 122

def payload_content
  parsed_payloads['PayloadContent']
end

#payload_typesArray<String>


128
129
130
# File 'lib/jss/api_object/configuration_profile.rb', line 128

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

#self_service_dislay_name=(new_val) ⇒ void Originally defined in module SelfServable

This method returns an undefined value.

#self_service_execute_urlString Originally defined in module SelfServable

#self_service_payloadSymbol Originally defined in module SelfServable

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

#self_service_targetsArray<Symbol> Originally defined in module SelfServable

What devices types can get this thing in Self Service

#self_service_view_urlString Originally defined in module SelfServable

#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.

#site=(new_site) ⇒ void Originally defined in module Sitable

This method returns an undefined value.

Change the site of this object. Any of the NON_SITES values will unset the site

#site_assigned?Boolean Originally defined in module Sitable

Does this object have a site assigned?

#site_idInteger Originally defined in module Sitable

The id of the site for this object.

#site_nameString Also known as: site Originally defined in module Sitable

The name of the site for this object. For backward compatibility, this is aliased to just 'site'

#site_objectJSS::Site Originally defined in module Sitable

The JSS::Site instance for this object's site

#unset_categoryvoid Originally defined in module Categorizable

This method returns an undefined value.

Set the category to nothing

#unset_sitevoid Originally defined in module Sitable

This method returns an undefined value.

Set the site to nothing

#updateObject Originally defined in module SelfServable

HACK: ity hack hack… remove when jamf fixes these bugs

#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.

#user_removable?Boolean? Originally defined in module SelfServable

Can this thing be removed by the user?