Class: JSS::ConfigurationProfile
- 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.
Direct Known Subclasses
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
- REDEPLOY_NEWLY_ASSIGNED =
when a change is made, which in-scope machines should get the changed profile?
'Newly Assigned'.freeze
- REDEPLOY_ALL =
'All'.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
-
#description ⇒ String
The description of this profile.
-
#icon ⇒ JSS::Icon?
(also: #self_service_icon)
included
from SelfServable
The icon used in self-service.
-
#in_self_service ⇒ Boolean
(also: #in_self_service?)
included
from SelfServable
readonly
Is this thing available in Self Service?.
-
#need_to_update ⇒ Boolean
included
from Updatable
readonly
Do we have unsaved changes?.
-
#payloads ⇒ String
readonly
The plist containing the payloads for this profile.
-
#redeploy_on_update ⇒ String
readonly
When a change is made to the profile, which scoped machines should get the changes? This will always contain REDEPLOY_NEWLY_ASSIGNED when fetched, but can be set to REDEPLOY_ALL via the redeploy_to_all: parameter to #update & #save.
-
#scope ⇒ Object
included
from Scopable
Attribtues.
-
#self_service_categories ⇒ Array<Hash>
included
from SelfServable
readonly
Each Hash has these keys about the category - :id => [Integer] the JSS id of the category - :name => [String] the name of the category.
-
#self_service_description ⇒ String
included
from SelfServable
The verbage that appears in SelfSvc for this item.
-
#self_service_display_name ⇒ String
(also: #self_service_dislay_name)
included
from SelfServable
The name to display in macOS Self Service.
-
#self_service_feature_on_main_page ⇒ Boolean
included
from SelfServable
Only applicable to macOS targets.
-
#self_service_force_users_to_view_description ⇒ Boolean
included
from SelfServable
Should an extra window appear before the user can install the item? (OSX SSvc only).
-
#self_service_install_button_text ⇒ String
included
from SelfServable
defaults to 'Install'.
-
#self_service_notification_message ⇒ String
included
from SelfServable
The message text of the notification.
-
#self_service_notification_subject ⇒ String
included
from SelfServable
object name.
-
#self_service_notification_type ⇒ Symbol
included
from SelfServable
How should notifications be sent either :ssvc_only or :ssvc_and_nctr.
-
#self_service_notifications_enabled ⇒ Boolean
(also: #self_service_notifications_enabled?)
included
from SelfServable
Should jamf send notifications to self service?.
-
#self_service_reinstall_button_text ⇒ String
included
from SelfServable
defaults to 'Reinstall'.
-
#self_service_reminder_frequency ⇒ Integer
included
from SelfServable
How often (in days) should reminders be given.
-
#self_service_reminders_enabled ⇒ Boolean
(also: #self_service_reminders_enabled?)
included
from SelfServable
Should self service give reminders by displaying the notification repeatedly?.
-
#self_service_removal_password ⇒ String
included
from SelfServable
readonly
The password needed for removal, in plain text.
-
#self_service_user_removable ⇒ Symbol
included
from SelfServable
One of the keys in PROFILE_REMOVAL_BY_USER.
-
#uuid ⇒ String
readonly
The uuid of this profile.
Instance Method Summary collapse
-
#add_self_service_category(new_cat, display_in: true, feature_in: false) ⇒ void
(also: #set_self_service_category, #change_self_service_category)
included
from SelfServable
Add or change one of the categories for this item in self service.
-
#add_to_self_service ⇒ void
included
from SelfServable
Add this object to self service if not already there.
-
#category=(new_cat) ⇒ void
included
from Categorizable
Change the category of this object.
-
#category_assigned? ⇒ Boolean
(also: #categorized?)
included
from Categorizable
Does this object have a category assigned?.
-
#category_id ⇒ Integer
included
from Categorizable
The id of the category for this object.
-
#category_name ⇒ String
(also: #category)
included
from Categorizable
The name of the category for this object.
-
#category_object ⇒ JSS::Category
included
from Categorizable
The JSS::Category instance for this object's category.
-
#create ⇒ Object
included
from SelfServable
HACK: ity hack hack…
-
#evaluate_new_category(new_cat) ⇒ Array<String, Integer>
included
from Categorizable
Given a category name or id, return the name and id TODO: use APIObject.exist? and/or APIObject.valid_id.
-
#initialize(args = {}) ⇒ ConfigurationProfile
constructor
See JSS::APIObject#initialize.
-
#name=(newname) ⇒ void
included
from Updatable
Change the name of this item Remember to #update to push changes to the server.
-
#parse_scope ⇒ void
included
from Scopable
private
Call this during initialization of objects that have a scope and the scope instance will be created from @init_data.
-
#parsed_payloads ⇒ Hash
The @payloads Plist, parsed into a Ruby object.
-
#payload_content ⇒ Array<Hash>
The individual payloads from the payload Plist.
- #payload_content=(new_content) ⇒ void
-
#payload_types ⇒ Array<String>
The PayloadType of each payload (e.g. com.apple.caldav.account).
-
#remove_from_self_service ⇒ void
included
from SelfServable
Remove this object from self service if it's there.
-
#remove_self_service_category(cat) ⇒ void
included
from SelfServable
Remove a category from those for this item in SSvc.
-
#save(redeploy_to_all: false) ⇒ Object
wrapper with param.
-
#self_service_execute_url ⇒ String
included
from SelfServable
The url to view this thing in Self Service.
-
#self_service_payload ⇒ Symbol
included
from SelfServable
What does this object deploy to the device via self service?.
-
#self_service_targets ⇒ Array<Symbol>
included
from SelfServable
What devices types can get this thing in Self Service.
-
#self_service_view_url ⇒ String
included
from SelfServable
The url to view this thing in Self Service.
-
#should_update ⇒ void
included
from Scopable
When the scope changes, it calls this to tell us that an update is needed.
-
#site=(new_site) ⇒ void
included
from Sitable
Change the site of this object.
-
#site_assigned? ⇒ Boolean
included
from Sitable
Does this object have a site assigned?.
-
#site_id ⇒ Integer
included
from Sitable
The id of the site for this object.
-
#site_name ⇒ String
(also: #site)
included
from Sitable
The name of the site for this object.
-
#site_object ⇒ JSS::Site
included
from Sitable
The JSS::Site instance for this object's site.
-
#unset_category ⇒ void
included
from Categorizable
Set the category to nothing.
-
#unset_site ⇒ void
included
from Sitable
Set the site to nothing.
-
#update(redeploy_to_all: false) ⇒ Object
clear flag after updating.
-
#upload(type, local_file, force_ipa_upload: false) ⇒ Boolean
included
from Uploadable
instance method wrapper for class method.
-
#user_removable? ⇒ Boolean?
included
from SelfServable
Can this thing be removed by the user?.
Constructor Details
#initialize(args = {}) ⇒ ConfigurationProfile
See JSS::APIObject#initialize
99 100 101 102 103 104 105 |
# File 'lib/jss/api_object/configuration_profile.rb', line 99 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
#description ⇒ String
Returns the description of this profile.
79 80 81 |
# File 'lib/jss/api_object/configuration_profile.rb', line 79 def description @description end |
#icon ⇒ JSS::Icon? Also known as: self_service_icon Originally defined in module SelfServable
Returns The icon used in self-service.
#in_self_service ⇒ Boolean (readonly) Also known as: in_self_service? Originally defined in module SelfServable
Returns Is this thing available in Self Service?.
#need_to_update ⇒ Boolean (readonly) Originally defined in module Updatable
Returns do we have unsaved changes?.
#payloads ⇒ String (readonly)
Returns the plist containing the payloads for this profile. NOT Updatable.
92 93 94 |
# File 'lib/jss/api_object/configuration_profile.rb', line 92 def payloads @payloads end |
#redeploy_on_update ⇒ String (readonly)
Returns When a change is made to the profile, which scoped machines should get the changes? This will always contain REDEPLOY_NEWLY_ASSIGNED when fetched, but can be set to REDEPLOY_ALL via the redeploy_to_all: parameter to #update & #save. After the update is complete, it reverts to REDEPLOY_NEWLY_ASSIGNED.
89 90 91 |
# File 'lib/jss/api_object/configuration_profile.rb', line 89 def redeploy_on_update @redeploy_on_update end |
#self_service_categories ⇒ Array<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_description ⇒ String Originally defined in module SelfServable
Returns The verbage that appears in SelfSvc for this item.
#self_service_display_name ⇒ String Also known as: self_service_dislay_name Originally defined in module SelfServable
Returns The name to display in macOS Self Service.
#self_service_feature_on_main_page ⇒ Boolean Originally defined in module SelfServable
Only applicable to macOS targets
#self_service_force_users_to_view_description ⇒ Boolean Originally defined in module SelfServable
Returns Should an extra window appear before the user can install the item? (OSX SSvc only).
#self_service_install_button_text ⇒ String Originally defined in module SelfServable
defaults to 'Install'
#self_service_notification_message ⇒ String Originally defined in module SelfServable
Returns The message text of the notification.
#self_service_notification_subject ⇒ String Originally defined in module SelfServable
object name.
#self_service_notification_type ⇒ Symbol Originally defined in module SelfServable
Returns How should notifications be sent either :ssvc_only or :ssvc_and_nctr.
#self_service_notifications_enabled ⇒ Boolean Also known as: self_service_notifications_enabled? Originally defined in module SelfServable
Returns Should jamf send notifications to self service?.
#self_service_reinstall_button_text ⇒ String Originally defined in module SelfServable
defaults to 'Reinstall'
#self_service_reminder_frequency ⇒ Integer Originally defined in module SelfServable
Returns How often (in days) should reminders be given.
#self_service_reminders_enabled ⇒ Boolean Also known as: self_service_reminders_enabled? Originally defined in module SelfServable
Returns Should self service give reminders by displaying the notification repeatedly?.
#self_service_removal_password ⇒ String (readonly) Originally defined in module SelfServable
Returns The password needed for removal, in plain text.
#self_service_user_removable ⇒ Symbol Originally defined in module SelfServable
Returns one of the keys in PROFILE_REMOVAL_BY_USER.
#uuid ⇒ String (readonly)
Returns the uuid of this profile. NOT Updatable.
82 83 84 |
# File 'lib/jss/api_object/configuration_profile.rb', line 82 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_service ⇒ void 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_id ⇒ Integer Originally defined in module Categorizable
The id of the category for this object.
#category_name ⇒ String 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_object ⇒ JSS::Category Originally defined in module Categorizable
The JSS::Category instance for this object's category
#create ⇒ Object 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_scope ⇒ void 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_payloads ⇒ Hash
The @payloads Plist, parsed into a Ruby object
125 126 127 |
# File 'lib/jss/api_object/configuration_profile.rb', line 125 def parsed_payloads JSS.parse_plist @payloads end |
#payload_content ⇒ Array<Hash>
Returns the individual payloads from the payload Plist.
131 132 133 |
# File 'lib/jss/api_object/configuration_profile.rb', line 131 def payload_content parsed_payloads['PayloadContent'] end |
#payload_content=(new_content) ⇒ void
This method returns an undefined value.
151 152 153 154 155 156 157 |
# File 'lib/jss/api_object/configuration_profile.rb', line 151 def payload_content=(new_content) payload_plist_data = parsed_payloads payload_plist_data['PayloadContent'] = new_content @payloads = JSS.xml_plist_from new_content @need_to_update = true @update_payloads = true end |
#payload_types ⇒ Array<String>
Returns the PayloadType of each payload (e.g. com.apple.caldav.account).
161 162 163 |
# File 'lib/jss/api_object/configuration_profile.rb', line 161 def payload_types payload_content.map { |p| p['PayloadType'] } end |
#remove_from_self_service ⇒ void 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
#save(redeploy_to_all: false) ⇒ Object
wrapper with param
175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/jss/api_object/configuration_profile.rb', line 175 def save(redeploy_to_all: false) if @in_jss raise JSS::UnsupportedError, 'Updating this object in the JSS is currently not supported by ruby-jss' unless updatable? update redeploy_to_all: redeploy_to_all else raise JSS::UnsupportedError, 'Creating this object in the JSS is currently not supported by ruby-jss' unless creatable? create end end |
#self_service_execute_url ⇒ String Originally defined in module SelfServable
Returns The url to view this thing in Self Service.
#self_service_payload ⇒ Symbol Originally defined in module SelfServable
What does this object deploy to the device via self service?
#self_service_targets ⇒ Array<Symbol> Originally defined in module SelfServable
What devices types can get this thing in Self Service
#self_service_view_url ⇒ String Originally defined in module SelfServable
Returns The url to view this thing in Self Service.
#should_update ⇒ void 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_id ⇒ Integer Originally defined in module Sitable
The id of the site for this object.
#site_name ⇒ String 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_object ⇒ JSS::Site Originally defined in module Sitable
The JSS::Site instance for this object's site
#unset_category ⇒ void Originally defined in module Categorizable
This method returns an undefined value.
Set the category to nothing
#unset_site ⇒ void Originally defined in module Sitable
This method returns an undefined value.
Set the site to nothing
#update(redeploy_to_all: false) ⇒ Object
clear flag after updating
166 167 168 169 170 171 172 |
# File 'lib/jss/api_object/configuration_profile.rb', line 166 def update(redeploy_to_all: false) @redeploy_on_update = redeploy_to_all ? REDEPLOY_ALL : REDEPLOY_NEWLY_ASSIGNED super() # always reset to newly assigned @redeploy_on_update = REDEPLOY_NEWLY_ASSIGNED @update_payloads = nil end |
#upload(type, local_file, force_ipa_upload: false) ⇒ Boolean Originally defined in module Uploadable
instance method wrapper for class method
Upload a file to the JSS to be stored with this instance of the class mixing in the Uploadable module
#user_removable? ⇒ Boolean? Originally defined in module SelfServable
Can this thing be removed by the user?