From 672733aa66e371edc50f6d1c2467896c40ed9ac8 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Tue, 3 Apr 2018 18:57:55 +0100 Subject: Add an API endpoint to download git repository snapshots --- lib/api/project_snapshots.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/api/project_snapshots.rb (limited to 'lib/api/project_snapshots.rb') 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 -- cgit v1.2.1