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

Allow to redefine the request method for templates #35

Open
ninsbl opened this issue Mar 9, 2023 · 1 comment
Open

Allow to redefine the request method for templates #35

ninsbl opened this issue Mar 9, 2023 · 1 comment

Comments

@ninsbl
Copy link

ninsbl commented Mar 9, 2023

Some templates could produce a fairly swift response, like e.g. v.db.select, r.category or the like.

In such cases, it can be often much more convenient to run the template as GET instead of POST and have the results returned directly. Therefore, it would be great if one could redefine a method e.g. through the template,...

That would greatly improve the flexibility and allow users to extend the actinia-core API with tailor-made endpoints...

Any hint on how to achieve that? Is it possible and if yes, Where in the code would one have to look to get that in? Or is that a case for a plugin?

@anikaweinmann
Copy link
Member

Cool idea.
We thought about how this could be implemented:
In a new actinia-plugin you can add a endpoint link in https://github.com/actinia-org/actinia-module-plugin/blob/main/actinia_module_plugin/endpoints.py#L69C25-L69C39 e.g. for ephemeral processing for example "/locations/<location>/execute/<module>". The way to do the processing can be similar to https://github.com/actinia-org/actinia-module-plugin/blob/main/actinia_module_plugin/core/modules/grass.py#L65.

The request would of this new processing endpoint would then be something like:

curl -U 'xxx:xxx' -X GET actinia.de/api/v3/locations/nc_spm_08/execute/v.db.select?map=xxx&columns=xxx

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

No branches or pull requests

2 participants