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
- SELF_SERVICE_PAYLOAD =
Our SelfService deploys profiles
:profile
- SITE_SUBSET =
Where is the Site data in the API JSON?
:general
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 ⇒ 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
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
The text label on the install button in SSvc (OSX SSvc only).
-
#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.
-
#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_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.
-
#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.
-
#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 ⇒ 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.
-
#upload(type, local_file) ⇒ String
included
from Uploadable
Upload a file to the JSS via the REST Resource of the object to which this module is mixed in.
-
#user_removable? ⇒ Boolean?
included
from SelfServable
Can this thing be removed by the user?.
Constructor Details
#initialize(args = {}) ⇒ ConfigurationProfile
See JSS::APIObject#initialize
85 86 87 88 89 90 91 |
# File 'lib/jss/api_object/configuration_profile.rb', line 85 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.
69 70 71 |
# File 'lib/jss/api_object/configuration_profile.rb', line 69 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.
78 79 80 |
# File 'lib/jss/api_object/configuration_profile.rb', line 78 def payloads @payloads end |
#redeploy_on_update ⇒ Boolean (readonly)
Returns Should this profile be redeployed when an inventory update happens?.
75 76 77 |
# File 'lib/jss/api_object/configuration_profile.rb', line 75 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_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
Returns The text label on the install button in SSvc (OSX SSvc only).
#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.
72 73 74 |
# File 'lib/jss/api_object/configuration_profile.rb', line 72 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
#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
109 110 111 |
# File 'lib/jss/api_object/configuration_profile.rb', line 109 def parsed_payloads Plist.parse_xml @payloads end |
#payload_content ⇒ Array<Hash>
Returns the individual payloads from the payload Plist.
115 116 117 |
# File 'lib/jss/api_object/configuration_profile.rb', line 115 def payload_content parsed_payloads['PayloadContent'] end |
#payload_types ⇒ Array<String>
Returns the PayloadType of each payload (e.g. com.apple.caldav.account).
121 122 123 |
# File 'lib/jss/api_object/configuration_profile.rb', line 121 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
#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
#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 ⇒ 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
#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?