Class: Artifactory::Resource::MailServer

Inherits:
Base
  • Object
show all
Defined in:
lib/artifactory/resources/mail_server.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attribute, attributes, #attributes, #client, #client=, #client?, #extract_client!, extract_client!, find_from_config, #format_repos!, format_repos!, from_hash, from_url, has_attribute?, #initialize, #inspect, list_from_config, #set, #to_hash, #to_json, #to_matrix_properties, #to_query_string_parameters, #to_s, #url_safe, url_safe

Constructor Details

This class inherits a constructor from Artifactory::Resource::Base

Class Method Details

.all(options = {}) ⇒ Array<Resource::MailServer>

Get a list of all mail servers in the system.

Parameters:

  • options (Hash) (defaults to: {})

    the list of options

Options Hash (options):

Returns:



34
35
36
37
# File 'lib/artifactory/resources/mail_server.rb', line 34

def all(options = {})
  config = Resource::System.configuration(options)
  list_from_config("config/mailServer", config, options)
end

.find(host, options = {}) ⇒ Resource::MailServer?

Find (fetch) a mail server by its host.

Examples:

Find a MailServer by its host.

mail_server.find('smtp.gmail.com') #=> #<MailServer host: 'smtp.gmail.com' ...>

Parameters:

  • host (String)

    the host of the mail server to find

  • options (Hash) (defaults to: {})

    the list of options

Options Hash (options):

Returns:

  • (Resource::MailServer, nil)

    an instance of the mail server that matches the given host, or nil if one does not exist



57
58
59
60
61
62
63
# File 'lib/artifactory/resources/mail_server.rb', line 57

def find(host, options = {})
  config = Resource::System.configuration(options)
  find_from_config("config/mailServer/host[text()='#{host}']", config, options)
rescue Error::HTTPError => e
  raise unless e.code == 404
  nil
end

Instance Method Details

#artifactory_urlObject

Return this object’s artifactory_url

Returns:

  • (Object)


75
# File 'lib/artifactory/resources/mail_server.rb', line 75

attribute :artifactory_url

#artifactory_url=(value) ⇒ Object

Set this object’s artifactory_url

Parameters:

  • value (Object)

    the value to set for artifactory_url

  • default (Object)

    the default value for this attribute



75
# File 'lib/artifactory/resources/mail_server.rb', line 75

attribute :artifactory_url

#artifactory_url?Boolean

Determines if the artifactory_url value exists and is truthy

Returns:

  • (Boolean)


75
# File 'lib/artifactory/resources/mail_server.rb', line 75

attribute :artifactory_url

#enabledObject

Return this object’s enabled

Returns:

  • (Object)


66
# File 'lib/artifactory/resources/mail_server.rb', line 66

attribute :enabled

#enabled=(value) ⇒ Object

Set this object’s enabled

Parameters:

  • value (Object)

    the value to set for enabled

  • default (Object)

    the default value for this attribute



66
# File 'lib/artifactory/resources/mail_server.rb', line 66

attribute :enabled

#enabled?Boolean

Determines if the enabled value exists and is truthy

Returns:

  • (Boolean)


66
# File 'lib/artifactory/resources/mail_server.rb', line 66

attribute :enabled

#fromObject

Return this object’s from

Returns:

  • (Object)


71
# File 'lib/artifactory/resources/mail_server.rb', line 71

attribute :from

#from=(value) ⇒ Object

Set this object’s from

Parameters:

  • value (Object)

    the value to set for from

  • default (Object)

    the default value for this attribute



71
# File 'lib/artifactory/resources/mail_server.rb', line 71

attribute :from

#from?Boolean

Determines if the from value exists and is truthy

Returns:

  • (Boolean)


71
# File 'lib/artifactory/resources/mail_server.rb', line 71

attribute :from

#hostObject

Return this object’s host

Returns:

  • (Object)


67
# File 'lib/artifactory/resources/mail_server.rb', line 67

attribute :host, -> { raise "host missing!" }

#host=(value) ⇒ Object

Set this object’s host

Parameters:

  • value (Object)

    the value to set for host

  • default (Object)

    the default value for this attribute



67
# File 'lib/artifactory/resources/mail_server.rb', line 67

attribute :host, -> { raise "host missing!" }

#host?Boolean

Determines if the host value exists and is truthy

Returns:

  • (Boolean)


67
# File 'lib/artifactory/resources/mail_server.rb', line 67

attribute :host, -> { raise "host missing!" }

#passwordObject

Return this object’s password

Returns:

  • (Object)


70
# File 'lib/artifactory/resources/mail_server.rb', line 70

attribute :password

#password=(value) ⇒ Object

Set this object’s password

Parameters:

  • value (Object)

    the value to set for password

  • default (Object)

    the default value for this attribute



70
# File 'lib/artifactory/resources/mail_server.rb', line 70

attribute :password

#password?Boolean

Determines if the password value exists and is truthy

Returns:

  • (Boolean)


70
# File 'lib/artifactory/resources/mail_server.rb', line 70

attribute :password

#portObject

Return this object’s port

Returns:

  • (Object)


68
# File 'lib/artifactory/resources/mail_server.rb', line 68

attribute :port

#port=(value) ⇒ Object

Set this object’s port

Parameters:

  • value (Object)

    the value to set for port

  • default (Object)

    the default value for this attribute



68
# File 'lib/artifactory/resources/mail_server.rb', line 68

attribute :port

#port?Boolean

Determines if the port value exists and is truthy

Returns:

  • (Boolean)


68
# File 'lib/artifactory/resources/mail_server.rb', line 68

attribute :port

#sslObject

Return this object’s ssl

Returns:

  • (Object)


74
# File 'lib/artifactory/resources/mail_server.rb', line 74

attribute :ssl

#ssl=(value) ⇒ Object

Set this object’s ssl

Parameters:

  • value (Object)

    the value to set for ssl

  • default (Object)

    the default value for this attribute



74
# File 'lib/artifactory/resources/mail_server.rb', line 74

attribute :ssl

#ssl?Boolean

Determines if the ssl value exists and is truthy

Returns:

  • (Boolean)


74
# File 'lib/artifactory/resources/mail_server.rb', line 74

attribute :ssl

#subject_prefixObject

Return this object’s subject_prefix

Returns:

  • (Object)


72
# File 'lib/artifactory/resources/mail_server.rb', line 72

attribute :subject_prefix

#subject_prefix=(value) ⇒ Object

Set this object’s subject_prefix

Parameters:

  • value (Object)

    the value to set for subject_prefix

  • default (Object)

    the default value for this attribute



72
# File 'lib/artifactory/resources/mail_server.rb', line 72

attribute :subject_prefix

#subject_prefix?Boolean

Determines if the subject_prefix value exists and is truthy

Returns:

  • (Boolean)


72
# File 'lib/artifactory/resources/mail_server.rb', line 72

attribute :subject_prefix

#tlsObject

Return this object’s tls

Returns:

  • (Object)


73
# File 'lib/artifactory/resources/mail_server.rb', line 73

attribute :tls

#tls=(value) ⇒ Object

Set this object’s tls

Parameters:

  • value (Object)

    the value to set for tls

  • default (Object)

    the default value for this attribute



73
# File 'lib/artifactory/resources/mail_server.rb', line 73

attribute :tls

#tls?Boolean

Determines if the tls value exists and is truthy

Returns:

  • (Boolean)


73
# File 'lib/artifactory/resources/mail_server.rb', line 73

attribute :tls

#usernameObject

Return this object’s username

Returns:

  • (Object)


69
# File 'lib/artifactory/resources/mail_server.rb', line 69

attribute :username

#username=(value) ⇒ Object

Set this object’s username

Parameters:

  • value (Object)

    the value to set for username

  • default (Object)

    the default value for this attribute



69
# File 'lib/artifactory/resources/mail_server.rb', line 69

attribute :username

#username?Boolean

Determines if the username value exists and is truthy

Returns:

  • (Boolean)


69
# File 'lib/artifactory/resources/mail_server.rb', line 69

attribute :username