app/views/katello/api/v2/subscriptions/show.json.rabl in katello-2.2.2 vs app/views/katello/api/v2/subscriptions/show.json.rabl in katello-2.4.0.rc1
- old
+ new
@@ -1,36 +1,21 @@
-object @subscription
+object @resource
-attributes :cp_id => :id
+extends "katello/api/v2/subscriptions/base"
-# When attached candlepin entitlements are returned (eg. for subscriptions attached
-# to systems), the 'id' is the entitlement id. This field is for referencing the
-# original subscription.
-attributes :subscription_id
-
+attributes :virt_only
+attributes :arch
+attributes :unmapped_guest
attributes :description
-extends 'katello/api/v2/common/org_reference'
-
-attributes :product_name
-attributes :start_date, :end_date
-attributes :available, :quantity, :consumed, :amount
-attributes :account_number, :contract_number
-attributes :support_type, :support_level
-attributes :product_id
-
-attributes :arch, :virt_only, :unmapped_guest
-attributes :sockets, :cores, :ram
-attributes :instance_multiplier, :stacking_id, :multi_entitlement
-
node :provided_products, :if => lambda { |sub| sub && !sub.products.blank? } do |subscription|
subscription.products.map do |product|
{id: product[:id], name: product[:name]}
end
end
-node :systems, :if => (params[:action] == "show") do |subscription|
+node :systems do |subscription|
subscription.systems.readable.map do |sys|
facts = sys.facts
{
uuid: sys.uuid,
name: sys.name,
@@ -55,11 +40,11 @@
}
}
end
end
-node :activation_keys, :if => (params[:action] == "show") do |subscription|
+node :activation_keys do |subscription|
subscription.activation_keys.readable.map do |key|
{
id: key.id,
name: key.name,
release_version: key.release_version,
@@ -75,7 +60,10 @@
}
end
end
node :host, :if => lambda { |sub| sub && sub.host } do |subscription|
- {id: subscription.host.uuid, name: subscription.host.name}
+ {
+ id: subscription.host.uuid,
+ name: subscription.host.name
+ }
end