Class: Jamf::PatchExternalSource
- Inherits:
-
PatchSource
- Object
- APIObject
- PatchSource
- Jamf::PatchExternalSource
- Includes:
- Creatable
- Defined in:
- lib/jamf/api/classic/api_objects/patch_external_source.rb
Overview
An ‘External’ patch source. These sources are defined by Jamf Admins and can be created, modified or deleted.
Constant Summary collapse
- RSRC_BASE =
The base for REST resources of this class
'patchexternalsources'.freeze
- RSRC_LIST_KEY =
the hash key used for the JSON list output of all objects in the JSS
:patch_external_sources- RSRC_OBJECT_KEY =
The hash key used for the JSON object output. It’s also used in various error messages
:patch_external_source
Instance Attribute Summary collapse
-
#need_to_update ⇒ Boolean
included
from Updatable
readonly
Do we have unsaved changes?.
Instance Method Summary collapse
-
#clone(new_name, api: nil, cnx: nil) ⇒ APIObject
included
from Creatable
make a clone of this API object, with a new name.
- #create ⇒ Object
-
#disable ⇒ void
Disable this source for retrieving patch info.
-
#enable ⇒ void
Enable this source for retrieving patch info.
-
#host_name=(newname) ⇒ Object
(also: #hostname=, #host=)
see PatchSource attr_reader :host_name.
-
#no_ssl ⇒ void
(also: #disable_ssl)
Do not use SSL for connecting to the source host.
-
#port=(new_port) ⇒ Object
see PatchSource attr_reader :port.
- #update ⇒ Object
-
#use_ssl ⇒ void
(also: #enable_ssl)
Use SSL for connecting to the source host.
Constructor Details
This class inherits a constructor from Jamf::PatchSource
Instance Attribute Details
#need_to_update ⇒ Boolean (readonly) Originally defined in module Updatable
Returns do we have unsaved changes?.
Instance Method Details
#clone(new_name, api: nil, cnx: nil) ⇒ APIObject Originally defined in module Creatable
make a clone of this API object, with a new name. The class must be creatable
#create ⇒ Object
105 106 107 108 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 105 def create validate_host_port('create a patch source') super end |
#disable ⇒ void
This method returns an undefined value.
Disable this source for retrieving patch info
52 53 54 55 56 57 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 52 def disable return unless enabled? @enabled = false @need_to_update = true end |
#enable ⇒ void
This method returns an undefined value.
Enable this source for retrieving patch info
40 41 42 43 44 45 46 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 40 def enable return if enabled? validate_host_port('enable a patch source') @enabled = true @need_to_update = true end |
#host_name=(newname) ⇒ Object Also known as: hostname=, host=
see PatchSource attr_reader :host_name
61 62 63 64 65 66 67 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 61 def host_name=(newname) return if newname == host_name raise Jamf::InvalidDataError, 'names must be String' unless name.is_a? String @host_name = name @need_to_update = true end |
#no_ssl ⇒ void Also known as: disable_ssl
This method returns an undefined value.
Do not use SSL for connecting to the source host
97 98 99 100 101 102 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 97 def no_ssl return unless ssl_enabled? @ssl_enabled = false @need_to_update = true end |
#port=(new_port) ⇒ Object
see PatchSource attr_reader :port
73 74 75 76 77 78 79 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 73 def port=(new_port) return if new_port == port raise Jamf::InvalidDataError, 'ports must be Integers' unless port.is_a? Integer @port = new_port @need_to_update = true end |
#update ⇒ Object
110 111 112 113 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 110 def update validate_host_port('update a patch source') super end |
#use_ssl ⇒ void Also known as: enable_ssl
This method returns an undefined value.
Use SSL for connecting to the source host
85 86 87 88 89 90 |
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 85 def use_ssl return if ssl_enabled? @ssl_enabled = true @need_to_update = true end |