Project

General

Profile

« Previous | Next » 

Revision 2e469342

Added by Joseph Magen over 10 years ago

fixes #3491 - API v2 rabl templates base, main, show for each controller

View differences:

app/views/api/v2/architectures/base.json.rabl
object @architecture
attributes :name, :id
app/views/api/v2/architectures/index.json.rabl
collection @architectures
extends "api/v2/architectures/show"
extends "api/v2/architectures/main"
app/views/api/v2/architectures/main.json.rabl
object @architecture
extends "api/v2/architectures/base"
attributes :created_at, :updated_at
app/views/api/v2/architectures/show.json.rabl
object @architecture
attributes :name, :id, :created_at, :operatingsystem_ids, :updated_at
extends "api/v2/architectures/main"
app/views/api/v2/audits/base.json.rabl
object @audit
attributes :id, :auditable_id, :auditable_name, :auditable_type, :action, :audited_changes
app/views/api/v2/audits/index.json.rabl
collection @audits
extends "api/v2/audits/show"
extends "api/v2/audits/main"
app/views/api/v2/audits/main.json.rabl
object @audit
extends "api/v2/audits/base"
attributes :user_id, :user_type, :user_name, :version, :comment, :associated_id, :associated_type,
:remote_address, :associated_name, :created_at, :updated_at
app/views/api/v2/audits/show.json.rabl
object @audit
attributes :id, :auditable_id, :auditable_type, :user_id, :user_type, :user_name, :action, :audited_changes, :version, :comment, :associated_id, :associated_type, :created_at, :remote_address, :auditable_name, :associated_name, :updated_at
extends "api/v2/audits/main"
app/views/api/v2/auth_source_ldaps/base.json.rabl
object @auth_source_ldap
attributes :id, :type, :name
app/views/api/v2/auth_source_ldaps/index.json.rabl
collection @auth_source_ldaps
extends "api/v2/auth_source_ldaps/show"
extends "api/v2/auth_source_ldaps/main"
app/views/api/v2/auth_source_ldaps/main.json.rabl
object @auth_source_ldap
extends "api/v2/auth_source_ldaps/base"
attributes :port, :account, :base_dn, :ldap_filter, :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :onthefly_register, :tls, :created_at, :updated_at
app/views/api/v2/auth_source_ldaps/show.json.rabl
object @auth_source_ldap
attributes :id, :type, :name, :host, :port, :account, :base_dn, :ldap_filter, :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :onthefly_register, :tls, :created_at, :updated_at
extends "api/v2/auth_source_ldaps/main"
app/views/api/v2/common_parameters/base.json.rabl
object @common_parameter
attributes :id, :name, :value
app/views/api/v2/common_parameters/index.json.rabl
collection @common_parameters
extends "api/v2/common_parameters/show"
extends "api/v2/common_parameters/main"
app/views/api/v2/common_parameters/main.json.rabl
object @common_parameter
extends "api/v2/common_parameters/base"
attributes :created_at, :updated_at
app/views/api/v2/common_parameters/show.json.rabl
object @common_parameter
attributes :id, :name, :value
extends "api/v2/common_parameters/main"
app/views/api/v2/compute_resources/base.json.rabl
object @compute_resource
attributes :id, :name
attribute :provider_friendly_name => 'provider'
app/views/api/v2/compute_resources/index.json.rabl
collection @compute_resources
extends "api/v2/compute_resources/show"
extends "api/v2/compute_resources/main"
app/views/api/v2/compute_resources/main.json.rabl
object @compute_resource
extends "api/v2/compute_resources/base"
attributes :description, :url, :created_at, :updated_at
node do |r|
partial("api/v2/compute_resources/#{r.provider.downcase}.json", :object => r)
end
app/views/api/v2/compute_resources/show.json.rabl
object @compute_resource
attributes :id, :name, :description, :url, :created_at, :updated_at
attribute :provider_friendly_name => 'provider'
node do |r|
partial("api/v2/compute_resources/#{r.provider.downcase}.json", :object => r)
end
extends "api/v2/compute_resources/main"
app/views/api/v2/config_templates/base.json.rabl
object @config_template
attributes :id, :name
app/views/api/v2/config_templates/index.json.rabl
collection @config_templates
extends "api/v2/config_templates/show"
extends "api/v2/config_templates/main"
app/views/api/v2/config_templates/main.json.rabl
object @config_template
extends "api/v2/config_templates/base"
attributes :snippet, :audit_comment, :template_kind_id, :template_kind_name, :created_at, :updated_at
app/views/api/v2/config_templates/show.json.rabl
object @config_template
attributes :id, :name, :template, :snippet, :audit_comment, :template_kind_id, :template_kind_name
extends "api/v2/config_templates/main"
attributes :template
child :template_combinations, :object_root => false do
extends "api/v2/template_combinations/show"
extends "api/v2/template_combinations/base"
end
child :operatingsystems, :object_root => false do
attributes :id, :name
extends "api/v2/operatingsystems/base"
end
app/views/api/v2/domains/base.json.rabl
object @domain
attributes :id, :name
app/views/api/v2/domains/index.json.rabl
collection @domains
extends "api/v2/domains/show"
extends "api/v2/domains/main"
app/views/api/v2/domains/main.json.rabl
object @domain
extends "api/v2/domains/base"
attributes :fullname, :dns_id, :created_at, :updated_at
app/views/api/v2/domains/show.json.rabl
object @domain
attributes :id, :name, :fullname, :dns_id, :created_at, :updated_at
extends "api/v2/domains/main"
app/views/api/v2/environments/base.json.rabl
object @environment
attributes :name, :id
app/views/api/v2/environments/index.json.rabl
collection @environments
extends "api/v2/environments/show"
extends "api/v2/environments/main"
app/views/api/v2/environments/main.json.rabl
object @environment
extends "api/v2/environments/base"
attributes :created_at, :updated_at
app/views/api/v2/environments/show.json.rabl
object @environment
attributes :name, :id, :created_at, :updated_at
extends "api/v2/environments/main"
app/views/api/v2/hostgroups/base.json.rabl
object @hostgroup
attributes :id, :name, :label
app/views/api/v2/hostgroups/index.json.rabl
collection @hostgroups
extends "api/v2/hostgroups/show"
extends "api/v2/hostgroups/main"
app/views/api/v2/hostgroups/main.json.rabl
object @hostgroup
extends "api/v2/hostgroups/base"
attributes :subnet_id, :subnet_name, :operatingsystem_id, :operatingsystem_name, :domain_id, :domain_name, :environment_id, :environment_name, :ancestry, :parameters, :puppetclass_ids
app/views/api/v2/hostgroups/show.json.rabl
object @hostgroup
attributes :name, :id, :subnet_id, :subnet_name, :operatingsystem_id, :operatingsystem_name, :domain_id, :domain_name, :environment_id, :environment_name, :ancestry, :label, :parameters, :puppetclass_ids
extends "api/v2/hostgroups/main"
app/views/api/v2/hosts/base.json.rabl
object @host
attributes :name, :id
app/views/api/v2/hosts/index.json.rabl
collection @hosts
attributes :name, :id, :hostgroup_id, :hostgroup_name, :operatingsystem_id, :operatingsystem_name
extends "api/v2/hosts/main"
app/views/api/v2/hosts/main.json.rabl
object @host
extends "api/v2/hosts/base"
attributes :ip, :environment_id, :environment_name, :last_report, :mac,
:sp_mac, :sp_ip, :sp_name, :domain_id, :domain_name, :architecture_id, :architecture_name, :operatingsystem_id, :operatingsystem_name,
:subnet_id, :subnet_name, :sp_subnet_id, :ptable_id, :ptable_name, :medium_id, :medium_name, :build,
:comment, :disk, :installed_at, :model_id, :model_name, :hostgroup_id, :hostgroup_name, :owner_id, :owner_type,
:enabled, :puppet_ca_proxy_id, :managed, :use_image, :image_file, :uuid, :compute_resource_id, :compute_resource_name,
:puppet_proxy_id, :certname, :image_id, :image_name, :created_at, :updated_at,
:last_compile, :last_freshcheck, :serial, :source_file_id, :puppet_status
if SETTINGS[:organizations_enabled]
attributes :organization_id, :organization_name
end
if SETTINGS[:locations_enabled]
attributes :location_id, :location_name
end
app/views/api/v2/hosts/show.json.rabl
object @host
object @host
attributes :name, :id, :ip, :environment_id, :environment_name, :last_report, :updated_at, :created_at, :mac,
:sp_mac, :sp_ip, :sp_name, :domain_id, :domain_name, :architecture_id, :architecture_name, :operatingsystem_id, :operatingsystem_name,
:subnet_id, :subnet_name, :sp_subnet_id, :ptable_id, :ptable_name, :medium_id, :medium_name, :build,
:comment, :disk, :installed_at, :model_id, :model_name, :hostgroup_id, :hostgroup_name, :owner_id, :owner_type,
:enabled, :puppet_ca_proxy_id, :managed, :use_image, :image_file, :uuid, :compute_resource_id, :compute_resource_name,
:puppet_proxy_id, :certname, :image_id, :image_name, :created_at, :updated_at,
:last_compile, :last_freshcheck, :serial, :source_file_id, :puppet_status, :root_pass
if SETTINGS[:organizations_enabled]
attributes :organization_id, :organization_name
end
if SETTINGS[:locations_enabled]
attributes :location_id, :location_name
end
extends "api/v2/hosts/main"
child :host_parameters, :object_root => false do
attributes :id, :name, :value, :priority, :is_property, :created_at, :updated_at
extends "api/v2/parameters/base"
end
node do |host|
app/views/api/v2/images/base.json.rabl
object @image
attributes :id, :name
app/views/api/v2/images/index.json.rabl
collection @images
extends "api/v2/images/show"
extends "api/v2/images/main"
app/views/api/v2/images/main.json.rabl
object @image
extends "api/v2/images/base"
attributes :operatingsystem_id, :operatingsystem_name, :compute_resource_id, :compute_resource_name, :architecture_id, :architecture_name, :uuid, :username, :created_at, :updated_at
attribute :iam_role, :if => lambda { |img| img.compute_resource.kind_of? Foreman::Model::EC2 }
app/views/api/v2/images/show.json.rabl
object @image
attributes :id, :operatingsystem_id, :operatingsystem_name, :compute_resource_id, :compute_resource_name, :architecture_id, :architecture_name, :uuid, :username, :name, :created_at, :updated_at
attribute :iam_role, :if => lambda { |img| img.compute_resource.kind_of? Foreman::Model::EC2 }
extends "api/v2/images/main"
app/views/api/v2/interfaces/base.json.rabl
object @interface
attributes :id, :name, :type, :ip, :mac
app/views/api/v2/interfaces/create.json.rabl
object @interface => :interface
object @interface
extends "api/v2/interfaces/show"
app/views/api/v2/interfaces/index.json.rabl
collection @interfaces
extends "api/v2/interfaces/show"
extends "api/v2/interfaces/main"
app/views/api/v2/interfaces/main.json.rabl
object @interface
extends "api/v2/interfaces/base"
attributes :username, :password, :provider, :subnet_id, :subnet_name, :domain_id, :domain_name, :created_at, :updated_at
app/views/api/v2/interfaces/show.json.rabl
object @interface => :interface
object @interface
attributes :id, :ip, :mac, :name, :type, :username, :password, :provider, :subnet_id, :subnet_name, :domain_id, :domain_name,:created_at, :updated_at
extends "api/v2/interfaces/main"
app/views/api/v2/interfaces/update.json.rabl
object @interface => :interface
object @interface
extends "api/v2/interfaces/show"
app/views/api/v2/media/base.json.rabl
object @medium
attributes :id, :name
app/views/api/v2/media/index.json.rabl
collection @media
extends "api/v2/media/show"
extends "api/v2/media/main"
app/views/api/v2/media/main.json.rabl
object @medium
extends "api/v2/media/base"
attributes :path, :os_family, :created_at, :updated_at
node do |medium|
if medium.os_family == 'Solaris'
attributes :media_path, :config_path, :image_path
end
end
app/views/api/v2/media/show.json.rabl
object @medium
attributes :id, :name, :path, :os_family, :created_at, :updated_at, :operatingsystem_ids
extends "api/v2/media/main"
node do |medium|
if medium.os_family == 'Solaris'
attributes :media_path, :config_path, :image_path
end
end
child :operatingsystems, :object_root => false do
extends "api/v2/operatingsystems/base"
end
app/views/api/v2/models/base.json.rabl
object @model
attributes :id, :name
app/views/api/v2/models/index.rabl
collection @models
extends "api/v2/models/show"
extends "api/v2/models/main"
app/views/api/v2/models/main.json.rabl
object @model
extends "api/v2/models/base"
attributes :info, :created_at, :updated_at, :vendor_class, :hardware_model
app/views/api/v2/models/show.rabl
object @model
attributes :id, :name, :info, :created_at, :updated_at, :vendor_class, :hardware_model
extends "api/v2/models/main"
app/views/api/v2/operatingsystems/base.json.rabl
object @operatingsystem
attributes :id, :name, :fullname
app/views/api/v2/operatingsystems/index.json.rabl
collection @operatingsystems
extends "api/v2/operatingsystems/show"
extends "api/v2/operatingsystems/main"
app/views/api/v2/operatingsystems/main.json.rabl
object @operatingsystem
extends "api/v2/operatingsystems/base"
attributes :major, :minor, :family, :release_name, :created_at, :updated_at
app/views/api/v2/operatingsystems/show.json.rabl
object @operatingsystem
attributes :id, :name, :major, :minor, :family, :release_name
extends "api/v2/operatingsystems/main"
child :media, :object_root => false do
attributes :id, :name
extends "api/v2/media/base"
end
child :architectures, :object_root => false do
attributes :id, :name
extends "api/v2/architectures/base"
end
child :ptables, :object_root => false do
attributes :id, :name
extends "api/v2/ptables/base"
end
child :config_templates, :object_root => false do
attributes :name, :id
extends "api/v2/config_templates/base"
end
child :os_default_templates, :object_root => false do
app/views/api/v2/override_values/base.json.rabl
object @override_value
attributes :id, :match, :value
app/views/api/v2/override_values/index.json.rabl
collection @override_values
extends "api/v2/override_values/show"
extends "api/v2/override_values/main"
app/views/api/v2/override_values/main.json.rabl
object @override_value
extends "api/v2/override_values/base"
attributes :created_at, :updated_at
app/views/api/v2/override_values/show.json.rabl
object @override_value => :override_value
object @override_value
attributes :id, :match, :value
extends "api/v2/override_values/main"
app/views/api/v2/parameters/base.json.rabl
object @parameter
attributes :id, :name, :value
app/views/api/v2/parameters/create.json.rabl
object @parameter => :parameter
object @parameter
extends "api/v2/parameters/show"
app/views/api/v2/parameters/index.json.rabl
collection @parameters
extends "api/v2/parameters/show"
extends "api/v2/parameters/main"
app/views/api/v2/parameters/main.json.rabl
object @parameter
extends "api/v2/parameters/base"
attributes :priority, :is_property, :created_at, :updated_at
app/views/api/v2/parameters/show.json.rabl
object @parameter => :parameter
object @parameter
attributes :id, :name, :value
extends "api/v2/parameters/main"
app/views/api/v2/parameters/update.json.rabl
object @parameter => :parameter
object @parameter
extends "api/v2/parameters/show"
app/views/api/v2/ptables/base.json.rabl
object @ptable
attributes :name, :id
app/views/api/v2/ptables/index.json.rabl
collection @ptables
extends "api/v2/ptables/show"
extends "api/v2/ptables/main"
app/views/api/v2/ptables/main.json.rabl
object @ptable
extends "api/v2/ptables/base"
attributes :os_family, :created_at, :updated_at
app/views/api/v2/ptables/show.json.rabl
object @ptable
attributes :name, :id, :layout, :os_family, :created_at, :updated_at
extends "api/v2/ptables/main"
attributes :layout
app/views/api/v2/puppetclasses/main.json.rabl
object @puppetclass
extends "api/v2/puppetclasses/base"
attributes :created_at, :updated_at
app/views/api/v2/puppetclasses/show.json.rabl
object @puppetclass
attributes :id, :name, :created_at, :updated_at
extends "api/v2/puppetclasses/main"
child :environments, :object_root => false do
attributes :id, :name
extends "api/v2/environments/base"
end
child :hostgroups, :object_root => false do
attributes :id, :label
extends "api/v2/hostgroups/base"
end
node do |puppetclass|
app/views/api/v2/reports/base.json.rabl
object @report
attributes :id, :host_id, :host_name, :reported_at, :status
app/views/api/v2/reports/index.json.rabl
collection @reports
extends "api/v2/reports/show"
extends "api/v2/reports/main"
app/views/api/v2/reports/main.json.rabl
object @report
extends "api/v2/reports/base"
attributes :metrics, :created_at, :updated_at
app/views/api/v2/reports/show.json.rabl
object @report
attributes :id, :reported_at, :status, :metrics
extends "api/v2/reports/main"
child :logs, :object_root => false do
child :source, :object_root => false do
......
end
node :summary do |report|
report.summaryStatus
end
report.summaryStatus
end
app/views/api/v2/roles/base.json.rabl
object @role
attributes :name, :id
app/views/api/v2/roles/index.json.rabl
collection @roles
extends "api/v2/roles/show"
extends "api/v2/roles/main"
app/views/api/v2/roles/main.json.rabl
object @role
extends "api/v2/roles/base"
attributes :builtin, :permissions, :created_at, :updated_at
app/views/api/v2/roles/show.json.rabl
object @role
attributes :name, :id, :builtin, :permissions
extends "api/v2/roles/main"
app/views/api/v2/settings/base.json.rabl
object @setting
attributes :id, :name
app/views/api/v2/settings/index.json.rabl
collection @settings
extends "api/v2/settings/show"
extends "api/v2/settings/main"
app/views/api/v2/settings/main.json.rabl
object @setting
extends "api/v2/settings/base"
attributes :value, :description, :category, :settings_type, :default, :created_at, :updated_at
app/views/api/v2/settings/show.json.rabl
object @setting
attributes :id, :name, :value, :description, :category, :settings_type, :default, :created_at, :updated_at
extends "api/v2/settings/main"
app/views/api/v2/smart_class_parameters/base.json.rabl
object @smart_class_parameter => :smart_class_parameter
object @smart_class_parameter
attribute :parameter
attributes :id
app/views/api/v2/smart_class_parameters/create.json.rabl
object @smart_class_parameter => :smart_class_parameter
object @smart_class_parameter
extends "api/v2/smart_class_parameters/show"
app/views/api/v2/smart_class_parameters/destroy.json.rabl
object @smart_class_parameter => :smart_class_parameter
object @smart_class_parameter
extends "api/v2/smart_class_parameters/base"
attributes :description, :override, :parameter_type, :default_value, :required, :validator_type, :validator_rule,
:override_value_order, :override_values_count, :created_at, :updated_at
extends "api/v2/smart_class_parameters/show"
app/views/api/v2/smart_class_parameters/index.json.rabl
collection @smart_class_parameters
extends "api/v2/smart_class_parameters/show"
extends "api/v2/smart_class_parameters/main"
app/views/api/v2/smart_class_parameters/main.json.rabl
object @smart_class_parameter
extends "api/v2/smart_class_parameters/base"
attributes :description, :override, :parameter_type, :default_value, :required, :validator_type, :validator_rule,
:override_value_order, :override_values_count, :created_at, :updated_at
app/views/api/v2/smart_class_parameters/show.json.rabl
object @smart_class_parameter => :smart_class_parameter
object @smart_class_parameter
extends "api/v2/smart_class_parameters/base"
attributes :description, :override, :parameter_type, :default_value, :required, :validator_type, :validator_rule,
:override_value_order, :override_values_count, :created_at, :updated_at
extends "api/v2/smart_class_parameters/main"
unless params[:puppetclass_id].present?
node do |smart_class_parameter|
......
end
node do |smart_class_parameter|
{ :override_values => partial("api/v2/override_values/show", :object => smart_class_parameter.lookup_values) }
{ :override_values => partial("api/v2/override_values/base", :object => smart_class_parameter.lookup_values) }
end
app/views/api/v2/smart_proxies/base.json.rabl
object @smart_proxy
attributes :name, :id, :url
app/views/api/v2/smart_proxies/index.json.rabl
collection @smart_proxies
attributes :name, :id, :url, :created_at, :updated_at
extends "api/v2/smart_proxies/main"
app/views/api/v2/smart_proxies/main.json.rabl
object @smart_proxy
extends "api/v2/smart_proxies/base"
attributes :created_at, :updated_at
child :features, :object_root => false do
attributes :name, :id, :url
end
app/views/api/v2/smart_proxies/show.json.rabl
object @smart_proxy
attributes :name, :id, :url, :created_at, :updated_at
child :features, :object_root => false do
attributes :name, :id, :url
end
extends "api/v2/smart_proxies/main"
app/views/api/v2/smart_variables/base.json.rabl
object @smart_variable => :smart_variable
object @smart_variable
attribute :variable
attributes :id
app/views/api/v2/smart_variables/create.json.rabl
object @smart_variable => :smart_variable
object @smart_variable
extends "api/v2/smart_variables/show"
app/views/api/v2/smart_variables/destroy.json.rabl
object @smart_variable => :smart_variable
object @smart_variable
extends "api/v2/smart_variables/base"
attributes :description, :parameter_type, :default_value, :validator_type, :validator_rule, :override_value_order, :override_values_count,
:puppetclass_id, :puppetclass_name, :created_at, :updated_at
extends "api/v2/smart_variables/show"
app/views/api/v2/smart_variables/index.json.rabl
collection @smart_variables
extends "api/v2/smart_variables/show"
extends "api/v2/smart_variables/main"
app/views/api/v2/smart_variables/main.json.rabl
object @smart_variable
extends "api/v2/smart_variables/base"
attributes :description, :parameter_type, :default_value, :validator_type, :validator_rule, :override_value_order, :override_values_count,
:puppetclass_id, :puppetclass_name, :created_at, :updated_at
app/views/api/v2/smart_variables/show.json.rabl
object @smart_variable => :smart_variable
object @smart_variable
extends "api/v2/smart_variables/base"
attributes :description, :parameter_type, :default_value, :validator_type, :validator_rule, :override_value_order, :override_values_count,
:puppetclass_id, :puppetclass_name, :created_at, :updated_at
extends "api/v2/smart_variables/main"
node do |smart_variable|
{ :override_values => partial("api/v2/override_values/show", :object => smart_variable.lookup_values) }
{ :override_values => partial("api/v2/override_values/base", :object => smart_variable.lookup_values) }
end
app/views/api/v2/subnets/base.json.rabl
object @subnet
attributes :id, :name
app/views/api/v2/subnets/index.json.rabl
collection @subnets
attributes :id, :name, :network, :mask, :priority, :vlanid,
:gateway, :dns_primary, :dns_secondary, :from, :to, :domain_ids,
:dns_id, :dhcp_id, :tftp_id
extends "api/v2/subnets/main"
app/views/api/v2/subnets/main.json.rabl
object @subnet
extends "api/v2/subnets/base"
attributes :network, :mask, :priority, :vlanid,
:gateway, :dns_primary, :dns_secondary, :from, :to, :domain_ids,
:dns_id, :dhcp_id, :tftp_id, :cidr
app/views/api/v2/subnets/show.json.rabl
object @subnet
attributes :id, :name, :network, :mask, :priority, :vlanid,
:gateway, :dns_primary, :dns_secondary, :from, :to, :domain_ids,
:dns_id, :dhcp_id, :tftp_id, :cidr
extends "api/v2/subnets/main"
child :dhcp => :dhcp do
attributes :id, :name, :url
extends "api/v2/smart_proxies/base"
end
child :tftp => :tftp do
attributes :id, :name, :url
extends "api/v2/smart_proxies/base"
end
child :dns => :dns do
attributes :id, :name, :url
extends "api/v2/smart_proxies/base"
end
app/views/api/v2/taxonomies/base.json.rabl
object @taxonomy
attributes :id, :name
app/views/api/v2/taxonomies/index.json.rabl
collection @taxonomies
attributes :id, :name
extends "api/v2/taxonomies/main"
app/views/api/v2/taxonomies/main.json.rabl
object @taxonomy
extends "api/v2/taxonomies/base"
attributes :created_at, :updated_at
app/views/api/v2/taxonomies/show.json.rabl
object @taxonomy
attributes :id, :name,
:organization_ids, :hostgroup_ids,
extends "api/v2/taxonomies/main"
attributes :organization_ids, :hostgroup_ids,
:environment_ids, :domain_ids, :medium_ids,
:subnet_ids, :compute_resource_ids,
:smart_proxy_ids, :user_ids, :config_template_ids,
:created_at, :updated_at
attribute :ignore_types => :select_all_types
app/views/api/v2/template_combinations/base.json.rabl
object @template_combination
attributes :id, :config_template_id, :config_template_name, :hostgroup_id, :hostgroup_name, :environment_id, :environment_name
app/views/api/v2/template_combinations/index.json.rabl
collection @template_combinations
extends "api/v2/template_combinations/show"
extends "api/v2/template_combinations/main"
app/views/api/v2/template_combinations/main.json.rabl
object @template_combination
extends "api/v2/template_combinations/base"
attributes :created_at, :updated_at
app/views/api/v2/template_combinations/show.json.rabl
object @template_combination
attributes :id, :config_template_id, :config_template_name, :hostgroup_id, :hostgroup_name, :environment_id, :environment_name
extends "api/v2/template_combinations/main"
app/views/api/v2/template_kinds/base.json.rabl
object @template_kind
attributes :name, :id
app/views/api/v2/template_kinds/index.json.rabl
collection @template_kinds
extends "api/v2/template_kinds/show"
extends "api/v2/template_kinds/main"
app/views/api/v2/template_kinds/main.json.rabl
object @template_kind
extends "api/v2/template_kinds/base"
attributes :created_at, :updated_at
app/views/api/v2/template_kinds/show.json.rabl
object @template_kind
attributes :name, :id
extends "api/v2/template_kinds/main"
app/views/api/v2/usergroups/base.json.rabl
object @usergroup
attributes :name, :id, :created_at, :updated_at
app/views/api/v2/usergroups/index.json.rabl
collection @usergroups
extends "api/v2/usergroups/show"
extends "api/v2/usergroups/main"
app/views/api/v2/usergroups/main.json.rabl
object @usergroup
extends "api/v2/usergroups/base"
attributes :created_at, :updated_at
app/views/api/v2/usergroups/show.json.rabl
object @usergroup
attributes :name, :id, :created_at, :updated_at
extends "api/v2/usergroups/main"
app/views/api/v2/users/base.json.rabl
object @user
attributes :id, :login
app/views/api/v2/users/index.json.rabl
collection @users
attributes :id, :login, :firstname, :lastname, :mail, :admin, :auth_source_id, :auth_source_name, :last_login_on,
:domains_andor, :hostgroups_andor, :facts_andor, :filter_on_owner, :compute_resources_andor,
:created_at, :updated_at
extends "api/v2/users/main"
app/views/api/v2/users/main.json.rabl
object @user
extends "api/v2/users/base"
attributes :firstname, :lastname, :mail, :admin, :auth_source_id, :auth_source_name, :last_login_on, :created_at, :updated_at
app/views/api/v2/users/show.json.rabl
object @user
attributes :id, :login, :firstname, :lastname, :mail, :admin, :auth_source_id, :auth_source_name, :last_login_on,
:domains_andor, :hostgroups_andor, :facts_andor, :filter_on_owner, :compute_resources_andor,
:created_at, :updated_at
extends "api/v2/users/main"
child :auth_source do
extends "api/v2/auth_source_ldaps/show"
extends "api/v2/auth_source_ldaps/base"
end
child :roles, :object_root => false do
extends "api/v2/roles/show"
extends "api/v2/roles/base"
end
test/functional/api/v2/locations_controller_test.rb
response = ActiveSupport::JSON.decode(@response.body)
assert response.kind_of?(Hash)
assert response['results'].kind_of?(Array)
assert_equal ['id', 'name'], response['results'][0].keys.sort
assert_equal ['created_at', 'id', 'name', 'updated_at'], response['results'][0].keys.sort
end
test "object name on show defaults to object class name" do

Also available in: Unified diff