diff options
author | Nick Thomas <nick@gitlab.com> | 2018-04-03 18:57:55 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-04-19 17:25:01 +0100 |
commit | 672733aa66e371edc50f6d1c2467896c40ed9ac8 (patch) | |
tree | f7d5313ab03c496c74ca63a29f786d9db19f79b1 /lib/api/project_snapshots.rb | |
parent | fb46dfb235f452333984891af5bb677f90faf174 (diff) | |
download | gitlab-ce-672733aa66e371edc50f6d1c2467896c40ed9ac8.tar.gz |
Add an API endpoint to download git repository snapshots
Diffstat (limited to 'lib/api/project_snapshots.rb')
-rw-r--r-- | lib/api/project_snapshots.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/api/project_snapshots.rb b/lib/api/project_snapshots.rb new file mode 100644 index 00000000000..71005acc587 --- /dev/null +++ b/lib/api/project_snapshots.rb @@ -0,0 +1,19 @@ +module API + class ProjectSnapshots < Grape::API + helpers ::API::Helpers::ProjectSnapshotsHelpers + + before { authorize_read_git_snapshot! } + + resource :projects do + desc 'Download a (possibly inconsistent) snapshot of a repository' do + detail 'This feature was introduced in GitLab 10.7' + 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 |