class Artifactory::Resource::Backup

def all(options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :client (Artifactory::Client) --

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

def find(key, options = {})

Returns:
  • (Resource::Backup, nil) -

Options Hash: (**options)
  • :client (Artifactory::Client) --

Parameters:
  • options (Hash) --
  • key (String) --

Other tags:
    Example: Find a Backup by its key. -
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

def find_from_config(xpath, config, options = {})

Parameters:
  • options (Hash) --
  • config (REXML) --
  • xpath (String) --
def find_from_config(xpath, config, options = {})
  name_node = REXML::XPath.match(config, xpath)
  return nil if name_node.empty?
  properties = Util.xml_to_hash(name_node[0].parent, "excludedRepositories", false)
  from_hash(properties, options)
end

def list_from_config(xpath, config, options = {})

Returns:
  • (~Resource::Base) -

Parameters:
  • options (Hash) --
  • config (REXML) --
  • xpath (String) --
def list_from_config(xpath, config, options = {})
  REXML::XPath.match(config, xpath).map do |r|
    hash = Util.xml_to_hash(r, "excludedRepositories", false)
    from_hash(hash, options)
  end
end