Class: JSS::OSXConfigurationProfile
- 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.
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
-
#description ⇒ String
The description of this profile.
-
#distribution_method ⇒ String
The distribution_method of this profile.
-
#level ⇒ String
The level (user/computer) of this profile.
-
#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 ⇒ Boolean
readonly
Should this profile be redeployed when an inventory update happens?.
-
#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_feature_on_main_page ⇒ Boolean
included
from SelfServable
Should this item feature on the main page of SSvc?.
-
#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_icon ⇒ Hash
included
from SelfServable
readonly
The Hash contains these keys with info about the icon: - :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) - :filename => [String] The name of the image file uploaded to the JSS, if applicable.
-
#self_service_install_button_text ⇒ String
included
from SelfServable
The text label on the install button in SSvc (OSX SSvc only).
-
#self_service_user_removable ⇒ Hash
included
from SelfServable
readonly
The keys are - :removal_disallowed => [String] one of the items in PROFILE_REMOVAL_OPTIONS - :password => [String] if :removal_disallowed is “With Authorization”, this contains the passwd (in plaintext) needed to remove the profile.
-
#user_removable ⇒ Boolean
Can the user remove this profile.
-
#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: #change_self_service_category)
included
from SelfServable
Add or change one of the categories for this item in SSvc.
-
#in_self_service? ⇒ Boolean
Is this profile available in Self Service?.
-
#initialize(args = {}) ⇒ OSXConfigurationProfile
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.
-
#parse_self_service ⇒ void
included
from SelfServable
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_payloads ⇒ Hash
The payload plist parsed into a Ruby hash.
-
#payload_content ⇒ Array<Hash>
The individual payloads from the payload Plist.
-
#payload_types ⇒ Array<String>
The PayloadType of each payload (e.g. com.apple.caldav.account).
-
#remove_self_service_category(cat) ⇒ void
included
from SelfServable
Remove a category from those for this item in SSvc.
-
#self_service_xml ⇒ REXML::Element
included
from SelfServable
private
Return a REXML <location> element to be included in the rest_xml of objects that have a Location subset.
-
#should_update ⇒ void
included
from Scopable
When the scope changes, it calls this to tell us that an update is needed.
-
#update ⇒ Object
included
from 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
Is this profile removable by the user?.
Constructor Details
#initialize(args = {}) ⇒ OSXConfigurationProfile
See JSS::APIObject#initialize
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 132 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
#description ⇒ String
Returns the description of this profile.
105 106 107 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 105 def description @description end |
#distribution_method ⇒ String
Returns the distribution_method of this profile.
108 109 110 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 108 def distribution_method @distribution_method end |
#level ⇒ String
Returns the level (user/computer) of this profile.
114 115 116 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 114 def level @level end |
#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.
123 124 125 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 123 def payloads @payloads end |
#redeploy_on_update ⇒ Boolean (readonly)
Returns Should this profile be redeployed when an inventory update happens?.
120 121 122 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 120 def redeploy_on_update @redeploy_on_update end |
#scope ⇒ Object Originally defined in module Scopable
Attribtues
#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? (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_description ⇒ String Originally defined in module SelfServable
Returns The verbage that appears in SelfSvc for this item.
#self_service_feature_on_main_page ⇒ Boolean Originally defined in module SelfServable
Returns Should this item feature on the main page of SSvc?.
#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_icon ⇒ Hash (readonly) Originally defined in module SelfServable
The Hash contains these keys with info about the icon:
-
: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)
-
:filename => [String] The name of the image file uploaded to the JSS, if applicable
#self_service_install_button_text ⇒ String Originally defined in module SelfServable
Returns The text label on the install button in SSvc (OSX SSvc only).
#self_service_user_removable ⇒ Hash (readonly) Originally defined in module SelfServable
The keys are
-
:removal_disallowed => [String] one of the items in 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_removable ⇒ Boolean
Returns can the user remove this profile.
111 112 113 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 111 def user_removable @user_removable end |
#uuid ⇒ String (readonly)
Returns the uuid of this profile. NOT Updatable.
117 118 119 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 117 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
Returns is this profile available in Self Service?.
205 206 207 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 205 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_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
#parse_self_service ⇒ void 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_payloads ⇒ Hash
Returns The payload plist parsed into a Ruby hash.
221 222 223 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 221 def parsed_payloads Plist.parse_xml @payloads end |
#payload_content ⇒ Array<Hash>
Returns the individual payloads from the payload Plist.
228 229 230 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 228 def payload_content parsed_payloads['PayloadContent'] end |
#payload_types ⇒ Array<String>
Returns the PayloadType of each payload (e.g. com.apple.caldav.account).
235 236 237 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 235 def payload_types payload_content.map{|p| p['PayloadType'] } end |
#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_xml ⇒ REXML::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_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.
#update ⇒ Object 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
Returns is this profile removable by the user?.
213 214 215 |
# File 'lib/jss/api_object/osx_configuration_profile.rb', line 213 def user_removable? @user_removable end |