Module: Gitlab::Client::ProjectExports
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/project_exports.rb
Overview
Defines methods related to project exports.
Instance Method Summary collapse
-
#export_project(id, options = {}) ⇒ Gitlab::ObjectifiedHash
Start a new export.
-
#export_project_status(id) ⇒ Gitlab::ObjectifiedHash
Get the status of export.
-
#exported_project_download(id) ⇒ Gitlab::FileResponse
Download the finished export.
Instance Method Details
#export_project(id, options = {}) ⇒ Gitlab::ObjectifiedHash
Start a new export
19 20 21 |
# File 'lib/gitlab/client/project_exports.rb', line 19 def export_project(id, = {}) post("/projects/#{url_encode id}/export", body: ) end |
#export_project_status(id) ⇒ Gitlab::ObjectifiedHash
Get the status of export
30 31 32 |
# File 'lib/gitlab/client/project_exports.rb', line 30 def export_project_status(id) get("/projects/#{url_encode id}/export") end |
#exported_project_download(id) ⇒ Gitlab::FileResponse
Download the finished export
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/gitlab/client/project_exports.rb', line 41 def exported_project_download(id) get("/projects/#{url_encode id}/export/download", format: nil, headers: { Accept: 'application/octet-stream' }, parser: proc { |body, _| if body.encoding == Encoding::ASCII_8BIT # binary response ::Gitlab::FileResponse.new StringIO.new(body, 'rb+') else # error with json response ::Gitlab::Request.parse(body) end }) end |