Class: JSS::PatchExternalSource
- Inherits:
-
PatchSource
- Object
- APIObject
- PatchSource
- JSS::PatchExternalSource
- Includes:
- Creatable
- Defined in:
- lib/jss/api_object/patch_source/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) ⇒ 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 JSS::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) ⇒ APIObject Originally defined in module Creatable
make a clone of this API object, with a new name. The class must be creatable
#create ⇒ Object
118 119 120 121 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 118 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
70 71 72 73 74 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 70 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
59 60 61 62 63 64 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 59 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
78 79 80 81 82 83 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 78 def host_name=(newname) return if newname == host_name raise JSS::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
111 112 113 114 115 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 111 def no_ssl return unless ssl_enabled? @ssl_enabled = false @need_to_update = true end |
#port=(new_port) ⇒ Object
see PatchSource attr_reader :port
89 90 91 92 93 94 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 89 def port=(new_port) return if new_port == port raise JSS::InvalidDataError, 'ports must be Integers' unless port.is_a? Integer @port = new_port @need_to_update = true end |
#update ⇒ Object
123 124 125 126 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 123 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
100 101 102 103 104 |
# File 'lib/jss/api_object/patch_source/patch_external_source.rb', line 100 def use_ssl return if ssl_enabled? @ssl_enabled = true @need_to_update = true end |