pynautobot icon indicating copy to clipboard operation
pynautobot copied to clipboard

Add method to easily run a Job from pynautobot

Open dgarros opened this issue 2 years ago • 2 comments

it would be useful to have a method to easily start the execution of a Job with pynautobot

Something like that

>>> import pynautobot
>>> nautobot = pynautobot.api( url="https://demo.nautobot.com/", token="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
>>>
>>> job = nautobot.extras.jobs.run(class_path="xxx", commit=False, data=None, schedule=None)

Also, maybe a separate request but it would be nice to have a way to execute a Job and wait for it to finish Something like that

>>> import pynautobot
>>> nautobot = pynautobot.api( url="https://demo.nautobot.com/", token="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
>>> job_result = nautobot.extras.jobs.run_and_wait(class_path="xxx", commit=False)

dgarros avatar Mar 04 '22 22:03 dgarros

@jvanderaa @jeffkala Would this be considered completed with #56 merged?

Renrut5 avatar Aug 13 '24 13:08 Renrut5

@Renrut5 it looks like the original ask was for 2 items, the second one being a way for it to run a job and wait for the result. This has not been implemented yet.

joewesch avatar Aug 13 '24 13:08 joewesch