Sha256: 93a7f73de104fdbf1218993e465021cdb42e50dbaeaa513fa4afd2f44fe7978d

Contents?: true

Size: 911 Bytes

Versions: 33

Compression:

Stored size: 911 Bytes

Contents

module ForemanRhCloud
  # Macro to fetch remediation playbook from cloud.redhat.com
  module TemplateRendererHelper
    extend ActiveSupport::Concern
    extend ApipieDSL::Module

    apipie :class, 'Macros related to Red Hat cloud interface' do
      name 'RHCloud'
      sections only: %w[all jobs]
    end

    apipie :method, 'Returns a playbook generated from Red Hat cloud recommendations' do
      required :hit_remediation_pairs, String, desc: 'JSON-encoded array of hashes in the form of [{hit_id: 1, remediation_id: 2}, ...]'
      returns String, desc: 'Playbook generated for the specific recommendations and hosts'
    end
    def remediations_playbook(hit_remediation_pairs)
      hit_remediation_pairs = JSON.parse(hit_remediation_pairs)
      retriever = ForemanRhCloud::RemediationsRetriever.new(hit_remediation_pairs, logger: template_logger)
      retriever.create_playbook
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.25 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.24.1 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.24.1 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.24 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.24 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.23 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.23 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.22 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.22 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.21.1 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.21.1 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.21 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.20 app/services/foreman_rh_cloud/template_renderer_helper.rb