Class: Jamf::Script
- Inherits:
-
CollectionResource
- Object
- JSONObject
- Resource
- CollectionResource
- Jamf::Script
- Defined in:
- lib/jamf/api/resources/collection_resources/script.rb
Overview
A building defined in the JSS
Constant Summary collapse
- RSRC_PATH =
Constants
'scripts'.freeze
- RSRC_VERSION =
'v1'.freeze
- PRIORITY_BEFORE =
'BEFORE'.freeze
- PRIORITY_AFTER =
'AFTER'.freeze
- PRIORITY_AT_REBOOT =
'AT_REBOOT'.freeze
- PRIORTIES =
[ PRIORITY_BEFORE, PRIORITY_AFTER, PRIORITY_AT_REBOOT ].freeze
- OBJECT_MODEL =
Object Model / Attributes See APIObject class documentation for details of how the OBJECT_MODEL hash works.
{ # @!attribute [r] id # @return [Integer] id: { class: :integer, identifier: :primary, readonly: true }, # @!attribute name # @return [String] name: { class: :string, identifier: true }, # @!attribute info # @return [String] info: { class: :string }, # @!attribute notes # @return [String] notes: { class: :string }, # @!attribute priority # @return [String] priority: { class: :string, enum: Jamf::Script::PRIORTIES }, # TODO: Jamf should standardize object references # this should be a Category::Reference object # @!attribute categoryId # @return [Integer] categoryId: { class: :integer }, # @!attribute categoryName # @return [String] categoryName: { class: :string }, # @!attribute osRequirements # @return [String] osRequirements: { class: :string }, # @!attribute scriptContents # @return [String] scriptContents: { class: :string, validate: :script_contents, aliases: %i[code] }, # @!attribute parameter4 # @return [String] parameter4: { class: :string }, # @!attribute parameter5 # @return [String] parameter5: { class: :string }, # @!attribute parameter6 # @return [String] parameter6: { class: :string }, # @!attribute parameter7 # @return [String] parameter7: { class: :string }, # @!attribute parameter8 # @return [String] parameter8: { class: :string }, # @!attribute parameter9 # @return [String] parameter9: { class: :string }, # @!attribute parameter10 # @return [String] parameter10: { class: :string }, # @!attribute parameter11 # @return [String] parameter11: { class: :string } }.freeze
Instance Attribute Summary collapse
- #categoryId ⇒ Integer
- #categoryName ⇒ String
- #id ⇒ Integer readonly
- #info ⇒ String
- #name ⇒ String
- #notes ⇒ String
- #osRequirements ⇒ String
- #parameter10 ⇒ String
- #parameter11 ⇒ String
- #parameter4 ⇒ String
- #parameter5 ⇒ String
- #parameter6 ⇒ String
- #parameter7 ⇒ String
- #parameter8 ⇒ String
- #parameter9 ⇒ String
- #priority ⇒ String
- #scriptContents ⇒ String
Class Method Summary collapse
-
.scriptContents(scr_ident, cnx: Jamf.cnx) ⇒ Object
Class Methods.
Instance Method Summary collapse
-
#add_change_log_note(note, cnx: Jamf.cnx) ⇒ void
included
from ChangeLog
Add a note to this resource’s change log.
-
#change_log(refresh = false, cnx: Jamf.cnx) ⇒ Array<Jamf::ChangeHistoryEntry>
included
from ChangeLog
The change and note history for this resource.
-
#reference ⇒ self.class::GenericReference
included
from Referable
A reference to this object.
Constructor Details
This class inherits a constructor from Jamf::JSONObject
Instance Attribute Details
#categoryId ⇒ Integer
|
# File 'lib/jamf/api/resources/collection_resources/script.rb', line 101
|
#id ⇒ Integer (readonly)
|
# File 'lib/jamf/api/resources/collection_resources/script.rb', line 64
|
Class Method Details
.scriptContents(scr_ident, cnx: Jamf.cnx) ⇒ Object
Class Methods
182 183 184 185 186 |
# File 'lib/jamf/api/resources/collection_resources/script.rb', line 182 def self.scriptContents(scr_ident, cnx: Jamf.cnx) id = valid_id scr_ident raise Jamf::NoSuchItemError, "No script matches '#{scr_ident}'" unless id cnx.download "#{RSRC_VERSION}/#{RSRC_PATH}/#{id}/download" end |
Instance Method Details
#add_change_log_note(note, cnx: Jamf.cnx) ⇒ void Originally defined in module ChangeLog
This method returns an undefined value.
Add a note to this resource’s change log.
If the change history has been cached already, it is recached after adding the note.
#change_log(refresh = false, cnx: Jamf.cnx) ⇒ Array<Jamf::ChangeHistoryEntry> Originally defined in module ChangeLog
The change and note history for this resource.
The history is cached internally and only re-fetched when a truthy parameter is given.
#reference ⇒ self.class::GenericReference Originally defined in module Referable
Returns A reference to this object.