-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.0.8
Feature type
New functionality
Proposed functionality
Allow a MultiObjectVar to be pre-filled using a URL. This currently works for ObjectVar. Example of ObjectVar script:
from extras.scripts import *
from virtualization.models import VirtualMachine
class ObjectVarTest(Script):
vm = ObjectVar(
model=VirtualMachine
)
def run(data, commit):
pass
Here you can pre-fill the variable by passing ?vm=<ID> like this https://your.netbox.install/extras/scripts/ob_var.ObjectVarTest/?vm=13.
Change the variable to a MultiObjectVar and try passing multiple values (https://your.netbox.install/extras/scripts/ob_var.ObjectVarTest/?vm=13&vm=37) . It does not currently work.
Use case
Allow a user to go straight to a custom script with some data pre-filled.
Database changes
None
External dependencies
No response
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application