Actions
Feature #31205
openallow specifying host_parameter_attributes on the CreateHostMutation in the graphql api
Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Description
At $customer we're modifying LISA¹ (which heavily uses the graphql api) for our own use.
We require a certain number of host parameters to be set, to be integrated into trusted facts by the installer.
However the CreateHostMutation
does currently not accept host_parameters_attributes
.
My quick and dirty patch is noted below (tested and working at $customer) but we probably want to have a more specific type than `RawJson`.
--- /usr/share/foreman/app/graphql/mutations/hosts/create.rb.orig 2020-10-27 16:20:14.270390141 +0100 +++ /usr/share/foreman/app/graphql/mutations/hosts/create.rb 2020-10-27 22:59:45.157237740 +0100 @@ -31,6 +31,7 @@ argument :puppet_ca_proxy_id, ID, loads: Types::SmartProxy argument :puppetclass_ids, [ID], loads: Types::Puppetclass, as: :puppetclasses argument :compute_attributes, Types::RawJson, required: false + argument :host_parameters_attributes, Types::RawJson, required: false argument :interfaces_attributes, [Types::InterfaceAttributesInput], required: false field :host, Types::Host, 'The new host.', null: true
Updated by Tomer Brisker about 4 years ago
The proper fix is likely to implement a parameter type, similar to how interface attributes are handled.
Actions