Sha256: 3cfd34712142d7fc3fb2776594d470620d293a7016cd2dc4a05528627064c6db

Contents?: true

Size: 408 Bytes

Versions: 6

Compression:

Stored size: 408 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Endpoints
    class Sources < Grape::API
      namespace :sources do
        desc "Get sources", {
          is_array: true,
          success: Entities::Sources
        }
        get "/" do
          sources = Mihari::Alert.distinct.pluck(:source)
          present({ sources: sources }, with: Entities::Sources)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mihari-3.12.0 lib/mihari/web/endpoints/sources.rb
mihari-3.11.0 lib/mihari/web/endpoints/sources.rb
mihari-3.10.1 lib/mihari/web/endpoints/sources.rb
mihari-3.10.0 lib/mihari/web/endpoints/sources.rb
mihari-3.9.2 lib/mihari/web/endpoints/sources.rb
mihari-3.9.1 lib/mihari/web/endpoints/sources.rb