Schedule script via API #18776
Unanswered
kochargs
asked this question in
Help Wanted!
Replies: 1 comment
-
It's definitely still broken.. The moment I add
Running on NetBox Community v4.2.6. @jeremystretch I believe that this issue is still relevant. |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Deployment Type
Self-hosted
NetBox Version
v3.7.8, v4.1.11
Python Version
3.10
Steps to Reproduce
schedule_at : "2025-02-28 11:59:00"
interval: 1
response = requests.post(script_url, headers=HEADERS, data=payload)
While scheduling a script via API, if i use the above payload for a netbox running 3.7.8, 2 observations are seen
The URL returned for script is named like
http://localhost:8000/api/extras/scripts/all_creds.CredentialStore/
However, if i send the same POST request to netbox running 4.1.11, the URL returned is with ID
http://x.x.x.x/api/extras/scripts/54/
I am able to successfully able to schedule the script on 3.7.8 with that payload however on v4.1.11, i am getting this error with exact same payload.
I am ensuring that i have set, scheduling_enabled = True, although it doesn't matter here
Having named URLS make is so much easier in case i have a netbox script with multiple classes, so to reference which script i want to execute / schedule is so much easier with scriptname.module approach rather than figuring out the ID of that script dynamically.
What is the correct approach to schedule a script via API on v4.1.11 ?
How can i convert the URL nomenclature for /api/scripts from ID based to name based as in v.3.7.8
Beta Was this translation helpful? Give feedback.
All reactions