Replies: 2 comments 2 replies
-
What you seem to be describing is Scripts, why did you think they were not going to meet your needs?
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: Andrea Dainese ***@***.***>
Sent: Wednesday, January 18, 2023 10:49 AM
To: netbox-community/netbox ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [netbox-community/netbox] Scripts with dynamic parameters (Discussion #11531)
For the project I'm working on, I need to enqueue custom scripts with dynamic parameters.
Basically, after a user input, I need to launch time expensive scripts via RQ, capturing results, errors and so on. Those scripts requires some parameters, sent by the user.
I checked the Script doc (https://docs.netbox.dev/en/stable/customization/custom-scripts/) but seems I cannot follow that way.
I tried to reuse the script classes, to implement a third batch type (let's call it "task"), but I failed because _get_script is looking for a file.
I wonder if there is a way to do that, natively in NetBox.
Could you point me in the right direction?
—
Reply to this email directly, view it on GitHub<#11531>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM347ZMZCHSXJQCBVBTWTANJXANCNFSM6AAAAAAT7J577Q>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @mtinberg ! Thank you for your answer. After your suggestion I made few tests, I realize Script could fit my needs. I can now start a Script but I cannot see the log in the "Job Results" page. Probably I'm missing something. I'm programmatically starting the script from a View as following:
Another question if you don't mind: any chance to put my scripts inside my plugin and having them recognized by NetBox without moving them in the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For the project I'm working on, I need to enqueue custom scripts with dynamic parameters.
Basically, after a user input, I need to launch time expensive scripts via RQ, capturing results, errors and so on. Those scripts requires some parameters, sent by the user.
I checked the Script doc (https://docs.netbox.dev/en/stable/customization/custom-scripts/) but seems I cannot follow that way.
I tried to reuse the script classes, to implement a third batch type (let's call it "task"), but I failed because _get_script is looking for a file.
I wonder if there is a way to do that, natively in NetBox.
Could you point me in the right direction?
Beta Was this translation helpful? Give feedback.
All reactions