Sha256: c12d588c8e4e3e557f395f9043a283f092557c0964967842184c71854752582d

Contents?: true

Size: 827 Bytes

Versions: 5

Compression:

Stored size: 827 Bytes

Contents

module Api
  module V1
    class AuditsController < V1::BaseController
      before_filter :find_resource, :only => %w{show update destroy}
      before_filter :setup_search_options, :only => :index

      api :GET, "/audits/", "List all audits."
      api :GET, "/hosts/:host_id/audits/", "List all audits for a given host."
      param :search, String, :desc => "filter results"
      param :order, String, :desc => "sort results"
      param :page, String, :desc => "paginate results"
      param :per_page, String, :desc => "number of entries per request"

      def index
        Audit.unscoped { @audits = Audit.search_for(*search_options).paginate(paginate_options) }
      end

      api :GET, "/audits/:id/", "Show an audit"
      param :id, :identifier, :required => true

      def show
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/app/controllers/api/v1/audits_controller.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/app/controllers/api/v1/audits_controller.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/app/controllers/api/v1/audits_controller.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/app/controllers/api/v1/audits_controller.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/app/controllers/api/v1/audits_controller.rb