Sha256: 902ad7e253b424760e9cdc1ef42e35106a0ed7c045c7e9bc475ee90f63cddda2

Contents?: true

Size: 1.56 KB

Versions: 13

Compression:

Stored size: 1.56 KB

Contents

object @capsule_content

attribute :last_sync_time

child :active_sync_tasks => :active_sync_tasks do
  extends 'foreman_tasks/api/tasks/show'
end
child :last_failed_sync_tasks => :last_failed_sync_tasks do
  extends 'foreman_tasks/api/tasks/show'
end

child @lifecycle_environments => :lifecycle_environments do
  extends 'katello/api/v2/common/identifier'
  extends 'katello/api/v2/common/org_reference'

  attributes :library
  node :syncable do |env|
    @capsule_content.environment_syncable?(env)
  end
  node :counts do |env|
    counts = {
      :content_hosts => env.systems.readable.count,
      :content_views => env.content_views.non_default.count,
      :products => env.products.enabled.count
    }
    repo_data = @capsule_content.current_repositories_data(env)
    counts.merge!(Katello::Pulp::ContentCountsCalculator.new(repo_data).calculate)
  end

  node :content_views do |env|
    env.content_views.map do |content_view|
      attributes = {
        :id => content_view.id,
        :label => content_view.label,
        :name => content_view.name,
        :composite => content_view.composite,
        :last_published => content_view.versions.empty? ? nil : content_view.versions.last.created_at,
        :counts => {
          :content_hosts => content_view.systems.readable.count,
          :products => content_view.products.enabled.count
        }
      }
      repo_data = @capsule_content.current_repositories_data(env, content_view)
      attributes[:counts].merge!(Katello::Pulp::ContentCountsCalculator.new(repo_data).calculate)
      attributes
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
katello-3.1.0.1 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.1.0 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.1.0.rc2.1 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.2 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.1.0.rc1 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.1 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.0 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.0.rc7 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.0.rc5 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.0.rc4 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.0.rc3 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.0.rc2 app/views/katello/api/v2/capsule_content/sync_status.json.rabl
katello-3.0.0.rc1 app/views/katello/api/v2/capsule_content/sync_status.json.rabl