Project

General

Profile

Actions

Feature #31205

open

allow specifying host_parameter_attributes on the CreateHostMutation in the graphql api

Added by Simon Peeters over 3 years ago. Updated about 3 years ago.

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

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

¹ https://github.com/dm-drogeriemarkt/lisa

Actions #1

Updated by Tomer Brisker about 3 years ago

  • Difficulty set to easy
Actions #2

Updated by Tomer Brisker about 3 years ago

The proper fix is likely to implement a parameter type, similar to how interface attributes are handled.

Actions

Also available in: Atom PDF