Sha256: d766701ed24a15f1186485e34a07e033a7c75772c0b21e4c60de16cfc87d6a89

Contents?: true

Size: 1.4 KB

Versions: 4

Compression:

Stored size: 1.4 KB

Contents

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

if @object.respond_to?(:alternate_content_source_type)
  if @object.custom? || @object.rhui?
    attributes :name, :alternate_content_source_type, :content_type, :base_url, :subpaths, :upstream_username, :smart_proxies, :verify_ssl, :use_http_proxies
    child :ssl_ca_cert => :ssl_ca_cert do |_object|
      attributes :id, :name
    end

    child :ssl_client_cert => :ssl_client_cert do |_object|
      attributes :id, :name
    end

    child :ssl_client_key => :ssl_client_key do |_object|
      attributes :id, :name
    end
  elsif @object.simplified?
    attributes :name, :alternate_content_source_type, :content_type, :products, :smart_proxies, :use_http_proxies
  end
end

child :latest_dynflow_refresh_task => :last_refresh do |_object|
  attributes :id, :username, :started_at, :ended_at, :state, :result, :progress
  node :last_refresh_words do |object|
    if (object.respond_to?('started_at') && object.started_at)
      time_ago_in_words(Time.parse(object.started_at.to_s))
    end
  end
end

if ::Foreman::Cast.to_bool(params.fetch(:include_permissions, false))
  node :permissions do |alternate_content_source|
    {
      :view_alternate_content_sources => alternate_content_source.readable?,
      :edit_alternate_content_sources => alternate_content_source.editable?,
      :destroy_alternate_content_sources => alternate_content_source.deletable?,
    }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katello-4.16.0.rc1 app/views/katello/api/v2/alternate_content_sources/base.json.rabl
katello-4.15.0 app/views/katello/api/v2/alternate_content_sources/base.json.rabl
katello-4.15.0.rc2 app/views/katello/api/v2/alternate_content_sources/base.json.rabl
katello-4.15.0.rc1 app/views/katello/api/v2/alternate_content_sources/base.json.rabl