Bug #9074
openAPI - incorrect FQDN matcher when creating host with name set to hostname
Description
When POSTing to /api/v2/hosts and using host[lookup_values_attributes] hash, parameter host[name] is directly used for smart variable matcher (fqdn=name). When host[name] is just hostname and not FQDN the resulting matcher is incorrect.
As workaround it is possible to set host[name] to FQDN, but web interface can use just hostname, so API should handle it in the same way. Btw. host[lookup_values_attributes] is missing in API documentation.
Updated by Dominic Cleal almost 10 years ago
Jiří Machálek wrote:
Btw. host[lookup_values_attributes] is missing in API documentation.
Yeah, it's a Rails method used for nesting attributes in forms, I don't think we'd really consider it part of the official API as it's to support the UI. The API itself doesn't support resource nesting, you'd be expected to add an override value after creating the host via /api/v2/puppetclasses/:name/smart_class_parameters/:name/override_values.