Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISW - Handle input setup mode #20530

Closed
2 tasks done
grotlue opened this issue Sep 24, 2024 · 6 comments · Fixed by #20715
Closed
2 tasks done

ISW - Handle input setup mode #20530

grotlue opened this issue Sep 24, 2024 · 6 comments · Fixed by #20715

Comments

@grotlue
Copy link
Contributor

grotlue commented Sep 24, 2024

  • 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

  • Frontend: Handle input setup mode #20715

  • Backend: Introduce input setup mode #20769

@AntonEbel
Copy link
Contributor

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

@grotlue grotlue changed the title Add Setup Input Page and handle input setup mode Handle input setup mode Oct 11, 2024
@AntonEbel
Copy link
Contributor

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.

@AntonEbel
Copy link
Contributor

AntonEbel commented Oct 14, 2024

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.

@grotlue grotlue self-assigned this Oct 16, 2024
@grotlue
Copy link
Contributor Author

grotlue commented Oct 16, 2024

Since the requierements say that an input should be created in setup_mode = true, the POST call 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.)

@grotlue grotlue linked a pull request Oct 16, 2024 that will close this issue
9 tasks
@grotlue grotlue mentioned this issue Oct 16, 2024
9 tasks
@grotlue grotlue reopened this Oct 18, 2024
@patrickmann patrickmann self-assigned this Oct 21, 2024
@patrickmann
Copy link
Contributor

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.

@grotlue
Copy link
Contributor Author

grotlue commented Oct 22, 2024

The frontend for this issue is already merged to master, but I will add the feature flag in a new PR.

@tellistone tellistone changed the title Handle input setup mode ISW - Handle input setup mode Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants