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

Add more execution controll of reports #2703

Closed
Grokzen opened this issue Dec 18, 2018 · 4 comments
Closed

Add more execution controll of reports #2703

Grokzen opened this issue Dec 18, 2018 · 4 comments

Comments

@Grokzen
Copy link
Contributor

Grokzen commented Dec 18, 2018

Environment

  • Python version: 2.4.8
  • NetBox version: 3.6.x

Proposed Functionality

I want to extend the Report class and functionality to include options and controll to decide from what source i can execute each report. Right now there is 3 execution paths defined in the docs, through the UI, through the API and from command line. This feature should enable the user/developer of a report class to have controll of what execution paths is available.

It might only be needed that we can controll the execution through the UI and API. The CLI path probably have no need for this controll flow.

Use Case

If you have a report that does some really heavy lifting/processing to run, we do not want to have any user start a report run at any given time and have multiple reports running at the same time that would consume a lot of system resources. In this case we probably would like to deploy a crontab job on the server and run the report through the cli option at given intervals and only let the user view the latest report run. One solution would be to restrict what user could run or not run reports, but the problem is that it inlcudes or excludes the ability to run any report in the system.

Questions that needs answer

  1. How the report should behave (error codes and messages) when executed through the API but is blocked
  2. Should configuration of this be done on the class instance or in another place.

Database Changes

If done as properties on the report class instance itself then there is no need for DB changes.

@jeremystretch
Copy link
Member

I don't understand what you're asking for. Could you please state exactly what change you're proposing?

@jeremystretch jeremystretch added the status: revisions needed This issue requires additional information to be actionable label Dec 19, 2018
@Grokzen
Copy link
Contributor Author

Grokzen commented Dec 19, 2018

Hmm, i will try.

Basically i would want some kind of way to disable the possibility to start/run a specific report from either the GUI, through the API, or both.

The crontab example is probably the easiest to explain. We have a report, we want it to run at midnight for example. We deploy a crontab job on the server to run at that time. What we want is to block is that a user can start the same report from the GUI or through the API.

We can't just remove the permission to run reports as they need to be able to run other rpeorts.

@Grokzen
Copy link
Contributor Author

Grokzen commented Dec 19, 2018

In code terms, think something like this, but with way better variable names

from extras.reports import Report


class DeviceConnectionsReport(Report):
    description = "..."
    allow_execute_api = False
    allow_execute_gui = False

@jeremystretch
Copy link
Member

The API and GUI are intended to maintain parity with one another. We won't take any action to intentionally inhibit access via one or the other.

Regarding access to individual reports, this would be a function of object-oriented permissions. This would fall under #554.

@jeremystretch jeremystretch removed the status: revisions needed This issue requires additional information to be actionable label Dec 20, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants