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

2712 api parameterisation #2724

Merged
merged 5 commits into from
Jun 14, 2022
Merged

2712 api parameterisation #2724

merged 5 commits into from
Jun 14, 2022

Conversation

iamleeg
Copy link
Contributor

@iamleeg iamleeg commented Jun 13, 2022

Replaced the server parameter with a disease parameter, so instead of saying "the production covid-19 line list or you have to give us a full URL", we say "the production covid-19 line list or you ask for another disease".

I used different approaches in Python and R to accept this parameter: a class constructor in Python and changing the function argument in R. I don't get the impression that R programmers expect or use classes much, and I found three different implementations of classes which made me wonder if I might pick a "wrong" one that users don't expect to see.

I'm not fully satisfied with this solution as you now can't specify self-hosted or a dev/qa instance. But I couldn't work out a way to easily parameterise the disease name (which gives the "marketing" benefit that we advertise flexibility for different diseases) as well as the other fields. Perhaps we still let you set a custom URL in an env var? Would R users expect that as a customisation point?

@abhidg
Copy link
Contributor

abhidg commented Jun 13, 2022

Assuming that each disease is a separate instance, we could just ask people to specify the appropriate endpoint? That way they can specify (potentially) self-hosted, as well as dev/qa for monkeypox/covid-19.

Alternatively, to get dev/qa, that can be a separate flag to switch the URL variant

@iamleeg
Copy link
Contributor Author

iamleeg commented Jun 13, 2022

Assuming that each disease is a separate instance, we could just ask people to specify the appropriate endpoint?

Yes, though this is a bit harder to use. I suppose we could put that information on the Profile page alongside the API key ("this API key is for use with the following server name: data.covid-19.global.health").

Alternatively, to get dev/qa, that can be a separate flag to switch the URL variant

Right, so disease=covid-19, env=production would be the main portal. That doesn't support custom URLs for self-hosted, but that's not a scenario we yet have so maybe doesn't need doing for now!

If you set the env GDH_URL, we use that

(R users can set this in .Renvironment, apparently)

Otherwise build from the disease/environment you specify.
@iamleeg iamleeg merged commit fcc8d83 into main Jun 14, 2022
@iamleeg iamleeg deleted the 2712_api_parameterisation branch June 14, 2022 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants