Class: Artifactory::Resource::Backup

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attribute, attributes, #attributes, #client, #client=, #client?, #extract_client!, extract_client!, format_repos!, #format_repos!, from_hash, from_url, has_attribute?, #initialize, #inspect, #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::Backup>

Get a list of all backup jobs in the system.

Parameters:

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

    the list of options

Options Hash (options):

Returns:



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

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

.find(key, options = {}) ⇒ Resource::Backup?

Find (fetch) a backup job by its key.

Examples:

Find a Backup by its key.

backup.find('backup-daily') #=> #<Backup key: 'backup-daily' ...>

Parameters:

  • key (String)

    the name of the backup job to find

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

    the list of options

Options Hash (options):

Returns:

  • (Resource::Backup, nil)

    an instance of the backup job that matches the given key, or nil if one does not exist



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

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

  nil
end

Instance Method Details

#create_archiveObject

Return this object’s create_archive

Returns:

  • (Object)


117
# File 'lib/artifactory/resources/backup.rb', line 117

attribute :create_archive

#create_archive=(value) ⇒ Object

Set this object’s create_archive

Parameters:

  • value (Object)

    the value to set for create_archive

  • default (Object)

    the default value for this attribute



117
# File 'lib/artifactory/resources/backup.rb', line 117

attribute :create_archive

#create_archive?Boolean

Determines if the create_archive value exists and is truthy

Returns:

  • (Boolean)


117
# File 'lib/artifactory/resources/backup.rb', line 117

attribute :create_archive

#cron_expObject

Return this object’s cron_exp

Returns:

  • (Object)


115
# File 'lib/artifactory/resources/backup.rb', line 115

attribute :cron_exp

#cron_exp=(value) ⇒ Object

Set this object’s cron_exp

Parameters:

  • value (Object)

    the value to set for cron_exp

  • default (Object)

    the default value for this attribute



115
# File 'lib/artifactory/resources/backup.rb', line 115

attribute :cron_exp

#cron_exp?Boolean

Determines if the cron_exp value exists and is truthy

Returns:

  • (Boolean)


115
# File 'lib/artifactory/resources/backup.rb', line 115

attribute :cron_exp

#dirObject

Return this object’s dir

Returns:

  • (Object)


114
# File 'lib/artifactory/resources/backup.rb', line 114

attribute :dir

#dir=(value) ⇒ Object

Set this object’s dir

Parameters:

  • value (Object)

    the value to set for dir

  • default (Object)

    the default value for this attribute



114
# File 'lib/artifactory/resources/backup.rb', line 114

attribute :dir

#dir?Boolean

Determines if the dir value exists and is truthy

Returns:

  • (Boolean)


114
# File 'lib/artifactory/resources/backup.rb', line 114

attribute :dir

#enabledObject

Return this object’s enabled

Returns:

  • (Object)


113
# File 'lib/artifactory/resources/backup.rb', line 113

attribute :enabled, true

#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



113
# File 'lib/artifactory/resources/backup.rb', line 113

attribute :enabled, true

#enabled?Boolean

Determines if the enabled value exists and is truthy

Returns:

  • (Boolean)


113
# File 'lib/artifactory/resources/backup.rb', line 113

attribute :enabled, true

#exclude_buildsObject

Return this object’s exclude_builds

Returns:

  • (Object)


120
# File 'lib/artifactory/resources/backup.rb', line 120

attribute :exclude_builds

#exclude_builds=(value) ⇒ Object

Set this object’s exclude_builds

Parameters:

  • value (Object)

    the value to set for exclude_builds

  • default (Object)

    the default value for this attribute



120
# File 'lib/artifactory/resources/backup.rb', line 120

attribute :exclude_builds

#exclude_builds?Boolean

Determines if the exclude_builds value exists and is truthy

Returns:

  • (Boolean)


120
# File 'lib/artifactory/resources/backup.rb', line 120

attribute :exclude_builds

#excluded_repositoriesObject

Return this object’s excluded_repositories

Returns:

  • (Object)


118
# File 'lib/artifactory/resources/backup.rb', line 118

attribute :excluded_repositories

#excluded_repositories=(value) ⇒ Object

Set this object’s excluded_repositories

Parameters:

  • value (Object)

    the value to set for excluded_repositories

  • default (Object)

    the default value for this attribute



118
# File 'lib/artifactory/resources/backup.rb', line 118

attribute :excluded_repositories

#excluded_repositories?Boolean

Determines if the excluded_repositories value exists and is truthy

Returns:

  • (Boolean)


118
# File 'lib/artifactory/resources/backup.rb', line 118

attribute :excluded_repositories

#keyObject

Return this object’s key

Returns:

  • (Object)


112
# File 'lib/artifactory/resources/backup.rb', line 112

attribute :key, -> { raise "name missing!" }

#key=(value) ⇒ Object

Set this object’s key

Parameters:

  • value (Object)

    the value to set for key

  • default (Object)

    the default value for this attribute



112
# File 'lib/artifactory/resources/backup.rb', line 112

attribute :key, -> { raise "name missing!" }

#key?Boolean

Determines if the key value exists and is truthy

Returns:

  • (Boolean)


112
# File 'lib/artifactory/resources/backup.rb', line 112

attribute :key, -> { raise "name missing!" }

#retention_period_hoursObject

Return this object’s retention_period_hours

Returns:

  • (Object)


116
# File 'lib/artifactory/resources/backup.rb', line 116

attribute :retention_period_hours

#retention_period_hours=(value) ⇒ Object

Set this object’s retention_period_hours

Parameters:

  • value (Object)

    the value to set for retention_period_hours

  • default (Object)

    the default value for this attribute



116
# File 'lib/artifactory/resources/backup.rb', line 116

attribute :retention_period_hours

#retention_period_hours?Boolean

Determines if the retention_period_hours value exists and is truthy

Returns:

  • (Boolean)


116
# File 'lib/artifactory/resources/backup.rb', line 116

attribute :retention_period_hours

#send_mail_on_errorObject

Return this object’s send_mail_on_error

Returns:

  • (Object)


119
# File 'lib/artifactory/resources/backup.rb', line 119

attribute :send_mail_on_error

#send_mail_on_error=(value) ⇒ Object

Set this object’s send_mail_on_error

Parameters:

  • value (Object)

    the value to set for send_mail_on_error

  • default (Object)

    the default value for this attribute



119
# File 'lib/artifactory/resources/backup.rb', line 119

attribute :send_mail_on_error

#send_mail_on_error?Boolean

Determines if the send_mail_on_error value exists and is truthy

Returns:

  • (Boolean)


119
# File 'lib/artifactory/resources/backup.rb', line 119

attribute :send_mail_on_error