Sha256: 9b0c14e487de03c0fdc9e2447a6f6ef65d4bf92b659d7a760dec33eab8b986ef

Contents?: true

Size: 1.42 KB

Versions: 13

Compression:

Stored size: 1.42 KB

Contents

object @resource

@resource ||= @object

extends "katello/api/v2/systems/base"

child :products => :products do |_product|
  attributes :id, :name
end
attributes :content_overrides

child :foreman_host => :host do
  attributes :id, :name
  attributes :host_status => :status
  attributes :last_report

  child :environment => :puppet_environment do
    attributes :id, :name
  end
  child :operatingsystem do
    attributes :id, :name, :description
  end
  child :model do
    attributes :id, :name
  end
  child :hostgroup do
    attributes :id, :name
  end
end

child @resource.foreman_host.host_collections => :hostCollections do
  attributes :id, :name, :description, :max_hosts, :unlimited_hosts, :total_hosts
end

attributes :serviceLevel => :service_level

node :release_ver do |sys|
  sys.releaseVer.is_a?(Hash) ? sys.releaseVer[:releaseVer] : sys.releaseVer
end

# Requires another API call to fetch from Candlepin
if params[:fields] == "full"
  attributes :system_type => :type
  attributes :compliance
  attributes :facts

  if @resource.respond_to?(:virtual_guest) || @resource.respond_to?(:virtual_host)
    if @resource.virtual_guest
      node :virtual_host do |system|
        system.virtual_host.attributes if system.virtual_host
      end
    else
      node :virtual_guests do |system|
        system.virtual_guests.map(&:attributes)
      end
    end
  end
end

node :permissions do |_activation_key|
  {
    :editable => true
  }
end

Version data entries

13 entries across 13 versions & 1 rubygems

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