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_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:



18
19
20
21
# File 'lib/artifactory/resources/mail_server.rb', line 18

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



41
42
43
44
45
46
47
# File 'lib/artifactory/resources/mail_server.rb', line 41

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)


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

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



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

attribute :artifactory_url

#artifactory_url?Boolean

Determines if the artifactory_url value exists and is truthy

Returns:

  • (Boolean)


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

attribute :artifactory_url

#enabledObject

Return this object’s enabled

Returns:

  • (Object)


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

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



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

attribute :enabled

#enabled?Boolean

Determines if the enabled value exists and is truthy

Returns:

  • (Boolean)


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

attribute :enabled

#fromObject

Return this object’s from

Returns:

  • (Object)


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

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



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

attribute :from

#from?Boolean

Determines if the from value exists and is truthy

Returns:

  • (Boolean)


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

attribute :from

#hostObject

Return this object’s host

Returns:

  • (Object)


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

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



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

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

#host?Boolean

Determines if the host value exists and is truthy

Returns:

  • (Boolean)


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

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

#passwordObject

Return this object’s password

Returns:

  • (Object)


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

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



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

attribute :password

#password?Boolean

Determines if the password value exists and is truthy

Returns:

  • (Boolean)


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

attribute :password

#portObject

Return this object’s port

Returns:

  • (Object)


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

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



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

attribute :port

#port?Boolean

Determines if the port value exists and is truthy

Returns:

  • (Boolean)


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

attribute :port

#sslObject

Return this object’s ssl

Returns:

  • (Object)


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

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



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

attribute :ssl

#ssl?Boolean

Determines if the ssl value exists and is truthy

Returns:

  • (Boolean)


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

attribute :ssl

#subject_prefixObject

Return this object’s subject_prefix

Returns:

  • (Object)


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

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



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

attribute :subject_prefix

#subject_prefix?Boolean

Determines if the subject_prefix value exists and is truthy

Returns:

  • (Boolean)


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

attribute :subject_prefix

#tlsObject

Return this object’s tls

Returns:

  • (Object)


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

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



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

attribute :tls

#tls?Boolean

Determines if the tls value exists and is truthy

Returns:

  • (Boolean)


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

attribute :tls

#usernameObject

Return this object’s username

Returns:

  • (Object)


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

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



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

attribute :username

#username?Boolean

Determines if the username value exists and is truthy

Returns:

  • (Boolean)


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

attribute :username