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

PUT /api/global-parameters/{name} #426

Closed
awills96 opened this issue Jan 9, 2024 · 6 comments
Closed

PUT /api/global-parameters/{name} #426

awills96 opened this issue Jan 9, 2024 · 6 comments

Comments

@awills96
Copy link

awills96 commented Jan 9, 2024

Is your feature request related to a problem? Please describe.

There is currently no functionality to modify global parameters using the Hop client.

Describe the solution you'd like

An implemented function in Client.java to make api PUT requests for global parameter values.

Describe alternatives you've considered

No response

Additional context

I saw that #62 has been open for vhost parameters, but there is no mention of global parameter setting in any other issue or discussion that I have seen (besides the latest version release which adds globals to Definitions.java).

I am able to make a contribution, but due to the existing related issue and the relative complexity of the solution, I wanted to check if there are any considerations from the maintainers of this project.

@michaelklishin
Copy link
Member

It should be a matter of replicating the existing API for parameters without the virtual host argument. We'd appreciate a contribution :)

@awills96
Copy link
Author

Thank you for the quick response, hopefully I'll have a contribution PR sometime next week or so.

@awills96
Copy link
Author

awills96 commented Jan 12, 2024

A question for design,

Should the setter for global parameters be generic? I saw that in the case of upstreams and upstream sets, there is no generic function like setParameter(String component, ParameterizedTypeReference<List<T>> responseType) that is invoked unlike the getParameters function which has an existing implementation and use.

For my contribution, I also wanted to add in getting and setting mqtt_port_to_vhost_mapping, which follows a similar implementation to the way upstreams are handled. I have already worked in a getGlobalParameters(...) function based on existing API calls. Would a generic setGlobalParameters(...) be needed over lower level Mqtt calls that invoke this.httpLayer.put(...) directly (similar to Upstream declarations)?

@michaelklishin
Copy link
Member

@awills96 we can use generics of it improves something… global parameter values really can be anything, so not a lot of room for additional type safety.

As for mqtt_port_to_vhost_mapping, it does not use any "MQTT calls", it is just a specific way of setting one specific parameter. It can be a separate method that relies on a more generic one, or it can use the HTTP API client directly, whichever option looks simpler overall.

@michaelklishin
Copy link
Member

Addressed by @awills96 in #429. Thank you!

@michaelklishin michaelklishin added this to the 5.3.0 milestone Jan 17, 2024
@acogoluegnes acogoluegnes removed this from the 5.3.0 milestone Jan 19, 2024
@acogoluegnes
Copy link
Contributor

Addressed partly in #429 (support for mqtt_port_to_vhost_mapping, but not for any global parameter).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants