Sha256: 01e607be6ec314192e631f19a9e4999ac651927f41261064a1fbb763a25fa1ca

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 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 :host_collections => :hostCollections do
  attributes :id, :name, :description, :max_content_hosts, :unlimited_content_hosts, :total_content_hosts
end

child :custom_info => :customInfo do
  attributes :id, :keyname, :value
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

1 entries across 1 versions & 1 rubygems

Version Path
katello-2.2.2 app/views/katello/api/v2/systems/show.json.rabl