Sha256: 57d13a526079fd943a352ba89f69684a08bcb1a209d940d7d4d4ae7e0c09d528

Contents?: true

Size: 1.28 KB

Versions: 15

Compression:

Stored size: 1.28 KB

Contents

object @job_invocation

attributes :id, :description, :job_category, :targeting_id, :status, :start_at, :status_label, :ssh_user, :time_to_pickup

node do |invocation|
  pattern_template = invocation.pattern_template_invocations.first
  {
    :template_id => pattern_template&.template_id,
    :template_name => pattern_template&.template_name,
    :effective_user => pattern_template&.effective_user,
    :succeeded => invocation.progress_report[:success],
    :failed    => invocation.progress_report[:error],
    :pending   => invocation.progress_report[:pending],
    :cancelled => invocation.progress_report[:cancelled],
    :total     => invocation_count(invocation, :output_key => :total_count),
    :missing   => invocation.missing_hosts_count,
    :total_hosts => invocation.total_hosts_count,
  }
end

child :task => :dynflow_task do
  attributes :id, :state
end

if params.key?(:include_permissions)
  node :permissions do |invocation|
    authorizer = Authorizer.new(User.current)
    {
      "edit_job_templates" => authorizer.can?("edit_job_templates", invocation, false),
      "view_foreman_tasks" => authorizer.can?("view_foreman_tasks", invocation.task, false),
      "edit_recurring_logics" => authorizer.can?("edit_recurring_logics", invocation.recurring_logic, false),
    }
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.4 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-14.1.3 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-14.1.2 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-14.1.1 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-14.1.0 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-14.0.2 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-14.0.1 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-13.2.6 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-14.0.0 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-13.2.5 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-13.2.4 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-13.2.3 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-13.2.2 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-13.2.1 app/views/api/v2/job_invocations/base.json.rabl
foreman_remote_execution-13.2.0 app/views/api/v2/job_invocations/base.json.rabl