Handle input setup mode
-
All new inputs will be in setup mode after creation instead of stopped
-
Existing inputs can be put into setup mode via a new action in the "More actions" menu in the input list
-
When an input is in setup mode, instead of showing "Start Input" or "Stop Input" we show "Setup Input"
- clicking this button will open the setup wizard
-
When an input is in setup mode "More actions" includes an "Exit Setup mode" action which will disable the setup mode and put the wizard into the stopped state
-
[x] Frontend: https://github.com/Graylog2/graylog2-server/pull/20715
-
[ ] Backend
todos for backend:
- add additionl API endpoint or extend the existing input updateAPI to set an input to "Setup" mode ( The other input states are calculated at runtime. Here we need to persist somehow that the input is in "Setup" mode)
- introduce the new input state "Setup"
- extend API to filter for inputs and/or input states which are in "Setup" state
To detect whether an input is in setup mode, I suggest adding the SETUP status to the input state. It would then look like this:
GET /api/system/inputstates
[{
"id": "6708eb4f549fe94f28546614",
"state": "SETUP"
"started_at": "2024-10-11T09:09:35.747Z",
"detailed_message": null,
"message_input" : { ... }
...
}]
The setup state can be changed by setting setup_mode field with the existing API call:
PUT /api/system/inputs/{id}
{
"title": "Json HTTP API 2",
"type": "org.graylog2.inputs.misc.jsonpath.JsonPathInput",
"configuration": { ... },
"global": true,
"setup_mode" : true
}
For backwards compatibility the setup_mode field is optional and if not specified the value of the field would be false.
Since the requierements say that an input should be created in setup_mode = true, for POST calls setup_mode field is optional and we would be true if not specified.
Since the requierements say that an input should be created in
setup_mode = true, thePOSTcall should look like this:POST /api/system/inputs { ... "setup_mode" : true, ... }
We agreed that the default value for setup_mode will be handled in the backend, so it does not have to be set by default in the POST call. Reason for this decision is that we will avoid updating all custom input forms (AWS etc.)
I am introducing feature flag setup_mode in the backend. If off, setup mode will always be off.
@grotlue You might want to also evaluate that flag in the frontend and hide the UI action. Then we can merge to master in smaller increments.
The frontend for this issue is already merged to master, but I will add the feature flag in a new PR.