summaryrefslogtreecommitdiff
path: root/lib/api/project_snapshots.rb
blob: e19afb6e8e4ee6d4a19be2d80e53fa7c4809e063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module API
  class ProjectSnapshots < ::API::Base
    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