Class: JobInvocationComposer::ParamsForFeature

Inherits:
Object
  • Object
show all
Defined in:
app/models/job_invocation_composer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feature_label, hosts, provided_inputs = {}) ⇒ ParamsForFeature

Returns a new instance of ParamsForFeature.



312
313
314
315
316
317
318
# File 'app/models/job_invocation_composer.rb', line 312

def initialize(feature_label, hosts, provided_inputs = {})
  @feature = RemoteExecutionFeature.feature!(feature_label)
  @provided_inputs = provided_inputs
  translator = HostIdsTranslator.new(hosts)
  @host_bookmark = translator.bookmark
  @host_scoped_search = translator.scoped_search
end

Instance Attribute Details

#featureObject (readonly)

Returns the value of attribute feature.



310
311
312
# File 'app/models/job_invocation_composer.rb', line 310

def feature
  @feature
end

#feature_labelObject (readonly)

Returns the value of attribute feature_label.



310
311
312
# File 'app/models/job_invocation_composer.rb', line 310

def feature_label
  @feature_label
end

#provided_inputsObject (readonly)

Returns the value of attribute provided_inputs.



310
311
312
# File 'app/models/job_invocation_composer.rb', line 310

def provided_inputs
  @provided_inputs
end

Instance Method Details

#paramsObject



320
321
322
323
324
325
326
327
# File 'app/models/job_invocation_composer.rb', line 320

def params
  { :job_category => job_template.job_category,
    :targeting => targeting_params,
    :triggering => {},
    :concurrency_control => {},
    :remote_execution_feature_id => @feature.id,
    :template_invocations => template_invocations_params }.with_indifferent_access
end