Module: Backend::Api::Sources::Package
- Extended by:
- ConnectionHelper
- Defined in:
- api/sources/package.rb
Overview
Class that connect to endpoints related to source packages
Class Method Summary collapse
-
.attributes(project, package, revision) ⇒ String
Returns the attributes content.
-
.copy(target_project, target_package, source_project, source_package, user, options = {}) ⇒ String
Copy a package into another project.
-
.file(project, package, filename) ⇒ String
Returns the content of the source file.
-
.files(project, package, options = {}) ⇒ String
Returns a file list of the sources for a package.
-
.merge_service(project, package, user) ⇒ String
Runs the command mergeservice for that project/package.
-
.meta(project, package) ⇒ String
Returns the meta file from a package.
-
.rebuild(project, package, options = {}) ⇒ String
Runs the command rebuild for that package.
-
.revisions(project, package) ⇒ String
Returns the revisions (mrev) list for a package.
-
.run_service(project, package, user) ⇒ String
Runs the command runservice for that project/package.
-
.source_diff(project, package, options = {}) ⇒ String
Returns the source diff.
-
.trigger_services(project, package, user) ⇒ String
It triggers all the services of a package.
-
.wait_service(project, package) ⇒ String
Runs the command waitservice for that project/package.
-
.write_attributes(project, package, user, content, comment) ⇒ String
Writes the content in xml for attributes.
-
.write_file(project, package, filename, content = '') ⇒ String
Writes the content of the source file.
-
.write_link(project, package, user, content) ⇒ String
Writes the link information of a package.
-
.write_patchinfo(project, package, user, content, comment = nil) ⇒ String
Writes the patchinfo.
Class Method Details
.attributes(project, package, revision) ⇒ String
Returns the attributes content
13 14 15 16 17 |
# File 'api/sources/package.rb', line 13 def self.attributes(project, package, revision) params = { meta: 1 } params[:rev] = revision if revision get(["/source/:project/:package/_attribute", project, package || '_project'], params: params) end |
.copy(target_project, target_package, source_project, source_package, user, options = {}) ⇒ String
Copy a package into another project
116 117 118 119 120 |
# File 'api/sources/package.rb', line 116 def self.copy(target_project, target_package, source_project, source_package, user, = {}) post(["/source/:project/:package", target_project, target_package], defaults: { cmd: :copy, oproject: source_project, opackage: source_package, user: user }, params: , accepted: [:keeplink, :expand, :comment]) end |
.file(project, package, filename) ⇒ String
Returns the content of the source file
163 164 165 |
# File 'api/sources/package.rb', line 163 def self.file(project, package, filename) get(["/source/:project/:package/:filename", project, package, filename]) end |
.files(project, package, options = {}) ⇒ String
Returns a file list of the sources for a package
38 39 40 |
# File 'api/sources/package.rb', line 38 def self.files(project, package, = {}) get(["/source/:project/:package", project, package], params: ) end |
.merge_service(project, package, user) ⇒ String
Runs the command mergeservice for that project/package
93 94 95 |
# File 'api/sources/package.rb', line 93 def self.merge_service(project, package, user) post(["/source/:project/:package", project, package], params: { cmd: :mergeservice, user: user }) end |
.meta(project, package) ⇒ String
Returns the meta file from a package
54 55 56 |
# File 'api/sources/package.rb', line 54 def self.(project, package) get(["/source/:project/:package/_meta", project, package]) end |
.rebuild(project, package, options = {}) ⇒ String
Runs the command rebuild for that package
154 155 156 |
# File 'api/sources/package.rb', line 154 def self.rebuild(project, package, = {}) post(["/build/:project", project], defaults: { cmd: :rebuild, package: package }, params: , accepted: [:repository, :arch]) end |
.revisions(project, package) ⇒ String
Returns the revisions (mrev) list for a package
46 47 48 |
# File 'api/sources/package.rb', line 46 def self.revisions(project, package) get(["/source/:project/:package/_history", project, package], params: { meta: 1, deleted: 1 }) end |
.run_service(project, package, user) ⇒ String
Runs the command runservice for that project/package
102 103 104 |
# File 'api/sources/package.rb', line 102 def self.run_service(project, package, user) post(["/source/:project/:package", project, package], params: { cmd: :runservice, user: user }) end |
.source_diff(project, package, options = {}) ⇒ String
Returns the source diff
143 144 145 146 |
# File 'api/sources/package.rb', line 143 def self.source_diff(project, package, = {}) post(["/source/:project/:package", project, package], defaults: { cmd: :diff, view: :xml, withissues: 1 }, params: , accepted: [:rev, :orev, :opackage, :oproject, :linkrev, :olinkrev, :expand]) end |
.trigger_services(project, package, user) ⇒ String
It triggers all the services of a package
63 64 65 |
# File 'api/sources/package.rb', line 63 def self.trigger_services(project, package, user) post(["/source/:project/:package", project, package], params: { cmd: :runservice, user: user }) end |
.wait_service(project, package) ⇒ String
Runs the command waitservice for that project/package
84 85 86 |
# File 'api/sources/package.rb', line 84 def self.wait_service(project, package) post(["/source/:project/:package", project, package], params: { cmd: :waitservice }) end |
.write_attributes(project, package, user, content, comment) ⇒ String
Writes the content in xml for attributes
26 27 28 29 30 31 |
# File 'api/sources/package.rb', line 26 def self.write_attributes(project, package, user, content, comment) params = { meta: 1, user: user } params[:comment] = comment if comment put(["/source/:project/:package/_attribute", project, package || '_project'], data: content, params: params) end |
.write_file(project, package, filename, content = '') ⇒ String
Writes the content of the source file
173 174 175 |
# File 'api/sources/package.rb', line 173 def self.write_file(project, package, filename, content = '') put(["/source/:project/:package/:filename", project, package, filename], data: content) end |
.write_link(project, package, user, content) ⇒ String
Writes the link information of a package
128 129 130 |
# File 'api/sources/package.rb', line 128 def self.write_link(project, package, user, content) put(["/source/:project/:package/_link", project, package], data: content, params: { user: user }) end |
.write_patchinfo(project, package, user, content, comment = nil) ⇒ String
Writes the patchinfo
74 75 76 77 78 |
# File 'api/sources/package.rb', line 74 def self.write_patchinfo(project, package, user, content, comment = nil) params = { user: user } params[:comment] = comment if comment put(["/source/:project/:package/_patchinfo", project, package], data: content, params: params) end |