Class: Api::V2::RemoteExecutionFeaturesController

Inherits:
BaseController
  • Object
show all
Includes:
Api::Version2, Foreman::Controller::Parameters::RemoteExecutionFeature
Defined in:
app/controllers/api/v2/remote_execution_features_controller.rb

Instance Method Summary collapse

Instance Method Details

#available_remote_execution_featuresObject



34
35
36
37
38
# File 'app/controllers/api/v2/remote_execution_features_controller.rb', line 34

def available_remote_execution_features
  host = Host.find(params[:id])
  @remote_execution_features = resource_scope
  @permissions = {:can_run_job => (authorized_for(controller: :job_invocations, action: :create) && (!host.infrastructure_host? || User.current.can?(:execute_jobs_on_infrastructure_hosts))) }
end

#indexObject



10
11
12
# File 'app/controllers/api/v2/remote_execution_features_controller.rb', line 10

def index
  @remote_execution_features = resource_scope
end

#showObject



16
17
# File 'app/controllers/api/v2/remote_execution_features_controller.rb', line 16

def show
end

#updateObject



28
29
30
# File 'app/controllers/api/v2/remote_execution_features_controller.rb', line 28

def update
  process_response @remote_execution_feature.update(remote_execution_feature_params)
end