mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56:25 -06:00
Repetition of optional variables in custom scripts
Merge the repeated sentences to the second instance.
This commit is contained in:
parent
742804ecb8
commit
340424c177
@ -19,7 +19,7 @@ class MyScript(Script):
|
||||
...
|
||||
```
|
||||
|
||||
Scripts comprise two core components: a set of variables and a `run()` method. Variables allow your script to accept user input via the NetBox UI, but they are optional: If your script does not require any user input, there is no need to define any variables.
|
||||
Scripts comprise two core components: a set of variables and a `run()` method.
|
||||
|
||||
The `run()` method is where your script's execution logic lives. (Note that your script can have as many methods as needed: this is merely the point of invocation for NetBox.)
|
||||
|
||||
@ -41,7 +41,7 @@ The `run()` method should accept two arguments:
|
||||
!!! note
|
||||
The `commit` argument was introduced in NetBox v2.7.8. Backward compatibility is maintained for scripts which accept only the `data` argument, however beginning with v2.10 NetBox will require the `run()` method of every script to accept both arguments. (Either argument may still be ignored within the method.)
|
||||
|
||||
Defining script variables is optional: You may create a script with only a `run()` method if no user input is needed.
|
||||
Variables allow your script to accept user input via the NetBox UI, but they are optional: If your script does not require any user input, there is no need to define any variables and you may create a script with only a `run()` method.
|
||||
|
||||
Any output generated by the script during its execution will be displayed under the "output" tab in the UI.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user