Class: Backend::Api::BuildResults::Binaries

Inherits:
Object
  • Object
show all
Extended by:
ConnectionHelper
Defined in:
api/build_results/binaries.rb

Overview

Class that connect to endpoints related to binaries

Class Method Summary collapse

Class Method Details

.available_in_project(project_name) ⇒ Hash

Returns the available binaries for the project

Returns:

  • (Hash)


49
50
51
# File 'api/build_results/binaries.rb', line 49

def self.available_in_project(project_name)
  transform_binary_packages_response(http_get(['/build/:project/_availablebinaries', project_name]))
end

.available_in_repositories(project_name, repository_urls, repository_paths) ⇒ Hash

Returns the available binaries for the repositories given

Parameters:

  • repository_urls (Array)

    Absolute urls of repositories.

  • repository_paths (Array)

    Paths of local repositories in the form of project/repository.

Returns:

  • (Hash)


57
58
59
60
61
# File 'api/build_results/binaries.rb', line 57

def self.available_in_repositories(project_name, repository_urls, repository_paths)
  return {} if repository_paths.empty? && repository_urls.empty?
  transform_binary_packages_response(http_get(['/build/:project/_availablebinaries', project_name],
                                              params: { url: repository_urls, path: repository_paths }, expand: [:url, :path]))
end

.build_dependency_info(project_name, package_name, repository_name, architecture_name) ⇒ String

Returns the build dependency information

Returns:

  • (String)


42
43
44
45
# File 'api/build_results/binaries.rb', line 42

def self.build_dependency_info(project_name, package_name, repository_name, architecture_name)
  http_get(['/build/:project/:repository/:architecture/_builddepinfo', project_name, repository_name, architecture_name],
           params: { package: package_name, view: :pkgnames })
end

.download_url_for_file(project_name, repository_name, package_name, architecture_name, file_name) ⇒ String

Returns the download url (published path) for a file of a package

Returns:

  • (String)


28
29
30
31
32
# File 'api/build_results/binaries.rb', line 28

def self.download_url_for_file(project_name, repository_name, package_name, architecture_name, file_name)
  http_get(['/build/:project/:repository/:architecture/:package/:file',
            project_name, repository_name, architecture_name, package_name, file_name],
           params: { view: :publishedpath })
end

.files(project_name, repository_name, architecture_name, package_name) ⇒ String

Returns a file list of binaries

Returns:

  • (String)


10
11
12
# File 'api/build_results/binaries.rb', line 10

def self.files(project_name, repository_name, architecture_name, package_name)
  http_get(['/build/:project/:repository/:architecture/:package', project_name, repository_name, architecture_name, package_name])
end

.history(project, repository, package, architecture) ⇒ Object

Returns the history file of a package



15
16
17
# File 'api/build_results/binaries.rb', line 15

def self.history(project, repository, package, architecture)
  http_get(['/build/:project/:repository/:architecture/:package/_history', project, repository, architecture, package])
end

.job_history(project_name, repository_name, architecture_name) ⇒ String

Returns the jobs history for a project

Returns:

  • (String)


21
22
23
24
# File 'api/build_results/binaries.rb', line 21

def self.job_history(project_name, repository_name, architecture_name)
  http_get(['/build/:project/:repository/:architecture/_jobhistory', project_name, repository_name, architecture_name],
           params: { code: :lastfailures })
end

.rpmlint_log(project_name, package_name, repository_name, architecture_name) ⇒ String

Returns the RPMlint log

Returns:

  • (String)


36
37
38
# File 'api/build_results/binaries.rb', line 36

def self.rpmlint_log(project_name, package_name, repository_name, architecture_name)
  http_get(['/build/:project/:repository/:architecture/:package/rpmlint.log', project_name, repository_name, architecture_name, package_name])
end

.wipe_published_locked(project_name) ⇒ Object

Runs the command wipepublishedlocked for that project to cleanup published binaries



64
65
66
# File 'api/build_results/binaries.rb', line 64

def self.wipe_published_locked(project_name)
  http_post(['/build/:project', project_name], params: { cmd: :wipepublishedlocked })
end