Class: Jamf::PatchExternalSource

Inherits:
PatchSource show all
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.

See Also:

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

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Jamf::PatchSource

Instance Attribute Details

#need_to_updateBoolean (readonly) Originally defined in module Updatable

Returns do we have unsaved changes?.

Returns:

  • (Boolean)

    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

Parameters:

  • name (String)

    the name for the new object

  • cnx (Jamf::Connection) (defaults to: nil)

    the API in which to create the object Defaults to the API used to instantiate this object

Returns:

  • (APIObject)

    An unsaved clone of this APIObject with the given name

Raises:

#createObject



118
119
120
121
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 118

def create
  validate_host_port('create a patch source')
  super
end

#disablevoid

This method returns an undefined value.

Disable this source for retrieving patch info



70
71
72
73
74
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 70

def disable
  return unless enabled?
  @enabled = false
  @need_to_update = true
end

#enablevoid

This method returns an undefined value.

Enable this source for retrieving patch info



59
60
61
62
63
64
# File 'lib/jamf/api/classic/api_objects/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/jamf/api/classic/api_objects/patch_external_source.rb', line 78

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_sslvoid 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/jamf/api/classic/api_objects/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/jamf/api/classic/api_objects/patch_external_source.rb', line 89

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

#updateObject



123
124
125
126
# File 'lib/jamf/api/classic/api_objects/patch_external_source.rb', line 123

def update
  validate_host_port('update a patch source')
  super
end

#use_sslvoid 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/jamf/api/classic/api_objects/patch_external_source.rb', line 100

def use_ssl
  return if ssl_enabled?
  @ssl_enabled = true
  @need_to_update = true
end