Hi all, relative newbie to Foreman here, trying to pull some data from the Foreman API for use in another application.
I'll walk you through my thinking, so if I've made any mistakes, perhaps someone might point them out to me. I'm trying to pull out parameter data for a class on a host, which is set at hostgroup level in this case (but might not always be). So in Puppet, a host (or group of hosts) can have a class applied to it. As part of including that class on the host, parameters must be populated with values. The class can have default values to be used, or they can be overridden. For example, if you click parameters at https://foreman/hostgroups/123-<group-name>/edit you'll see where values are passed for particular classes. If the value has been set at the hostgroup level, there doesn't seem to be a way to fetch it via the host. I tried these two calls: http://foreman/api/hosts/<host-id> - shows the classes, but not parameters http://foreman/api/hosts/<host-id>/smart_class_parameters - shows default values for parameters, but not where they've been over-ridden by the group I can't even get it from the hostgroup calls: http://foreman/api/hostgroups/<hostgroup-id>/smart_class_parameters/ The only way I've found so far is to fetch the class object: http://foreman/api/puppetclasses/<class-id> This shows each parameter with an ID, so we can get the parameter object and value: http://foreman/api/smart_class_parameters/<parameter-id> This contains the values set for overriding parameters based on rules like '"match": "hostgroup=<group-name>".' It doesn't seem possible to be able to fetch which parameters have been set for a host, without parsing the rules to see if they match the host. Is my understanding above all correct? Is there a shortcut that I'm missing to finding out what values a host is using for a class? -- You received this message because you are subscribed to the Google Groups "Foreman users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/foreman-users. For more options, visit https://groups.google.com/d/optout.
