Sha256: 6a4835e611e849f89a2c58fadfd0fafd60433040640d42e2b355c7dbd7c16dc3

Contents?: true

Size: 1.24 KB

Versions: 47

Compression:

Stored size: 1.24 KB

Contents

module Api
  module V2
    class RemoteExecutionFeaturesController < ::Api::V2::BaseController
      include ::Api::Version2
      include ::Foreman::Controller::Parameters::RemoteExecutionFeature

      before_action :find_resource, :only => %w{show update}

      api :GET, '/remote_execution_features/', N_('List remote execution features')
      def index
        @remote_execution_features = resource_scope
      end

      api :GET, '/remote_execution_features/:id', N_('Show remote execution feature')
      param :id, :identifier, :required => true
      def show; end

      def_param_group :remote_execution_feature do
        param :remote_execution_feature, Hash, :required => true, :action_aware => true do
          param :job_template_id, :identifier, :required => true, :desc => N_('Job template ID to be used for the feature')
        end
      end

      api :PUT, '/remote_execution_features/:id', N_('Update a job template')
      param :id, :identifier, :required => true
      param_group :remote_execution_feature
      def update
        process_response @remote_execution_feature.update_attributes(remote_execution_feature_params)
      end

      private

      def parent_scope
        resource_class.where(nil)
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
foreman_remote_execution-2.0.10 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.9 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.8 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-3.0.3 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-3.0.2 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.7 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-3.0.1 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-3.0.0 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.6 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.5 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.4 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.3 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.2 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.1 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-2.0.0 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-1.8.4 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-1.8.3 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-1.8.2 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-1.8.1 app/controllers/api/v2/remote_execution_features_controller.rb
foreman_remote_execution-1.8.0 app/controllers/api/v2/remote_execution_features_controller.rb