BigW Consortium Gitlab

api.rb 678 Bytes
Newer Older
1 2 3
module Ci
  module API
    class API < Grape::API
4
      include ::API::APIGuard
5 6 7 8 9 10 11
      version 'v1', using: :path

      rescue_from ActiveRecord::RecordNotFound do
        rack_response({ 'message' => '404 Not found' }.to_json, 404)
      end

      rescue_from :all do |exception|
12
        handle_api_exception(exception)
13 14
      end

Tomasz Maczukin committed
15 16
      content_type :txt,  'text/plain'
      content_type :json, 'application/json'
17 18
      format :json

19
      helpers ::SentryHelper
20
      helpers ::Ci::API::Helpers
21
      helpers ::API::Helpers
22
      helpers Gitlab::CurrentSettings
23

24 25 26
      mount ::Ci::API::Builds
      mount ::Ci::API::Runners
      mount ::Ci::API::Triggers
27 28 29
    end
  end
end