2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
module API
|
2021-01-03 14:25:43 +05:30
|
|
|
class ProjectSnapshots < ::API::Base
|
2018-05-09 12:01:36 +05:30
|
|
|
helpers ::API::Helpers::ProjectSnapshotsHelpers
|
|
|
|
|
|
|
|
before { authorize_read_git_snapshot! }
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
feature_category :source_code_management
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
resource :projects do
|
|
|
|
desc 'Download a (possibly inconsistent) snapshot of a repository' do
|
|
|
|
detail 'This feature was introduced in GitLab 10.7'
|
2023-01-13 00:05:48 +05:30
|
|
|
success File
|
|
|
|
produces 'application/x-tar'
|
|
|
|
failure [
|
|
|
|
{ code: 401, message: 'Unauthorized' }
|
|
|
|
]
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
params do
|
|
|
|
optional :wiki, type: Boolean, desc: 'Set to true to receive the wiki repository'
|
|
|
|
end
|
|
|
|
get ':id/snapshot' do
|
|
|
|
send_git_snapshot(snapshot_repository)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|