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

New console command core:api to call any API #7159

Open
mattab opened this issue Feb 9, 2015 · 7 comments
Open

New console command core:api to call any API #7159

mattab opened this issue Feb 9, 2015 · 7 comments
Labels
c: New plugin For features that probably will not be added to Matomo, but could be implemented as plugins. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@mattab
Copy link
Member

mattab commented Feb 9, 2015

The goal of this issue is to create a new console command core:api that would let anyone easily call any API via the CLI, as Super User.

Why a core:api command? There are currently dozens of APIs and it can be complicated to build a correct URL and input this in the console.

Maybe we could do nice things like auto-completion of plugin names and API methods, and ideally show the method parameters to fill in. I'm not 100% sure if it would be that useful, so please comment if you need this!

@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Feb 9, 2015
@mattab mattab added this to the Mid term milestone Feb 9, 2015
@mgazdzik
Copy link
Contributor

mgazdzik commented Feb 9, 2015

+1 for this, as it would liberate us in many cases from webserver timeout constraint, also output could be streamed directly to file = easy reports for download generation.

@mattab mattab modified the milestones: Short term, Mid term Feb 9, 2015
@tsteur
Copy link
Member

tsteur commented Feb 9, 2015

It would be ok for me although I don't need it therefore has no priority for me. I do not really see which problem it solves. If it is about constructing URL's why not something for the UI? There are even tools for this but they mainly require REST like APIs. Also I would prefer if this would not automatically use super user permission.

@tsteur tsteur added the c: New plugin For features that probably will not be added to Matomo, but could be implemented as plugins. label Feb 9, 2015
@diosmosis
Copy link
Member

If this is added to core, I think it should be added to climulti:request (or alternatively, climulti should use this instead of climulti:request). As far as I can tell, climulti:request also calls the API (though maybe not as superuser).

@mattab
Copy link
Member Author

mattab commented Feb 10, 2015

Maybe we could do it simple for MVP (eg. without autocompletion), as a quick "shortcut" that would re-use climulti:request command.

@tsteur
Copy link
Member

tsteur commented Feb 10, 2015

I still don't get what the actual problem is that will be solved here.

Why a core:api command? There are currently dozens of APIs and it can be complicated to build a correct URL and input this in the console.

Why does one has to input this in the console when requesting an API etc?

@mattab
Copy link
Member Author

mattab commented Feb 10, 2015

For example to store the API results in a file, or to get a static image and store it as image file, or to call "invalidate archived reports" API without browser timing issues, and maybe other use cases?

@tsteur
Copy link
Member

tsteur commented Feb 10, 2015

call "invalidate archived reports" API without browser timing issues

sounds like a problem :) Maybe a separate command for this would be better? Otherwise the issue sounds to me like "I have an idea" let's find the problem :) Eg wget can be used to save API output etc. but if people actually have a need to do this often then this command seems to solve it.

@mattab mattab modified the milestones: Mid term, Short term Feb 10, 2015
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@mattab mattab changed the title New console command to call any API as super user New console command core:api to call any API as super user Jun 19, 2017
@mattab mattab changed the title New console command core:api to call any API as super user New console command core:api to call any API Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: New plugin For features that probably will not be added to Matomo, but could be implemented as plugins. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants