Sha256: 4c21d29644f9676e648adec8c3f59460ef070d4f647dd785cfe62780b56becf7

Contents?: true

Size: 1.49 KB

Versions: 35

Compression:

Stored size: 1.49 KB

Contents

object @environment => :environment

extends 'katello/api/v2/common/identifier'
extends 'katello/api/v2/common/org_reference'

attributes :library

node :prior do |env|
  if env.prior
    {name: env.prior.name, :id => env.prior.id}
  end
end

node :successor do |env|
  if !env.library && env.successor
    {name: env.successor.name, :id => env.successor.id}
  end
end

node :counts do |env|
  counts = {
    :content_hosts => env.hosts.authorized("view_hosts").count,
    :content_views => env.content_views.non_default.count
  }
  if env.library?
    repos = env.repositories.in_default_view
    counts[:packages] = Katello::Rpm.total_for_repositories(repos)
    counts[:puppet_modules] = Katello::PuppetModule.in_repositories(repos).count
    counts[:errata] = partial('katello/api/v2/errata/counts', :object => Katello::RelationPresenter.new(Katello::Erratum.in_repositories(repos)))
    counts[:yum_repositories] = repos.yum_type.count
    counts[:docker_repositories] = repos.docker_type.count
    counts[:ostree_repositories] = repos.ostree_type.count
    counts[:products] = env.organization.products.enabled.count
  end
  counts
end

node :permissions do |env|
  {
    :create_lifecycle_environments => env.creatable?,
    :view_lifecycle_environments => env.readable?,
    :edit_lifecycle_environments => env.editable?,
    :destroy_lifecycle_environments => env.deletable?,
    :promote_or_remove_content_views_to_environments => env.promotable_or_removable?
  }
end

extends 'katello/api/v2/common/timestamps'

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
katello-3.5.2 app/views/katello/api/v2/environments/show.json.rabl
katello-3.6.0 app/views/katello/api/v2/environments/show.json.rabl
katello-3.6.0.1.rc2 app/views/katello/api/v2/environments/show.json.rabl
katello-3.6.0.rc2 app/views/katello/api/v2/environments/show.json.rabl
katello-3.6.0.rc1 app/views/katello/api/v2/environments/show.json.rabl
katello-3.5.1.1 app/views/katello/api/v2/environments/show.json.rabl
katello-3.5.1 app/views/katello/api/v2/environments/show.json.rabl
katello-3.5.0.1 app/views/katello/api/v2/environments/show.json.rabl
katello-3.5.0 app/views/katello/api/v2/environments/show.json.rabl
katello-3.5.0.rc2 app/views/katello/api/v2/environments/show.json.rabl
katello-3.5.0.rc1 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.5 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.4 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.2 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.1 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.0.2 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.0.1 app/views/katello/api/v2/environments/show.json.rabl
katello-3.3.2 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.0 app/views/katello/api/v2/environments/show.json.rabl
katello-3.4.0.rc2 app/views/katello/api/v2/environments/show.json.rabl