Project

General

Profile

Actions

Feature #1123

closed

api for config_templates needs to return additional attributes

Added by Corey Osman over 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

/config_templates?format=json returns too much data. I simply want a list of templates and some attributes instead of the code
thats inside the templates. If I want the code inside the template it would be better to pass the name of a template or id like:

config_templates/grubby?format=json

Here is a sample of what gets returned now:

[{"config_template":{"name":"Grubby Default","template":"#!/bin/bash\n\nKERNEL=\"/boot/kernel\"\nINITRD=\"/boot/initrd.img\"\n\nwget 
-O \"$KERNEL\" \"<%= @host.url_for_boot(:kernel) %>\"\nwget -O \"$INITRD\" \"<%= @host.url_for_boot(:initrd) %>\"\n\ngrubby 
--add-kernel=$KERNEL --initrd=$INITRD  --copy-default --title \"<%= @host.operatingsystem %>\" --make-default  --args=\
"ks=<%= foreman_url(\"provision\")%>\"\n","snippet":null}},{"config_template":{"name":"HTTP proxy","template":" 
<% if proxy = @host.params[\"http_proxy\"] -%>\nhttp_proxy=<%= proxy %>\nexport http_proxy\nhttps_proxy=<%= proxy %>
\nexport https_proxy\nno_proxy=localhost,127.0.0.0/8,*.local,*.<%= @host.domain.name -%>,puppet\nexport no_proxy\n
<% end -%>\n","snippet":true}},{"config_template":{"name":"Jumpstart Default","template":"install_type <%= @install_type %>\npartitioning explicit\n<%= @disk %>\n<% if @h

Actions

Also available in: Atom PDF