Project

General

Profile

Actions

Bug #9074

open

API - incorrect FQDN matcher when creating host with name set to hostname

Added by Jiří Machálek over 9 years ago. Updated over 9 years ago.

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

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.

Actions #1

Updated by Dominic Cleal over 9 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.

Actions

Also available in: Atom PDF