ansible_sdk.model.job_status module
- class ansible_sdk.model.job_status.AnsibleJobStatus(job_def: AnsibleJobDef)
Bases:
object
Status object for monitoring running/completed jobs.
- cancel()
Request cancellation of a running job by the executor. On successful cancellation,
CancelledError
will be on raised on running iterators and on any awaiters of this job object.
- drop_event(evt: AnsibleJobEvent)
Request discard of event data that is no longer needed.
- Parameters:
evt – The returned event object to be discarded
- property events: AsyncIterator[AnsibleJobEvent]
Async iterator to enumerate events from this job. Events are yielded live while the job is running; the iterator will not complete until the job has completed or failed. In cases of job failure or cancellation, the iterator will raise an exception with the appropriate detail.
- Returns:
a live iterator of
AnsibleJobEvent
data for this job
- property stdout_lines: AsyncIterator[str]
Async iterator to enumerate lines of display output text from this job. Text lines are yielded live while the job is running; the iterator will not complete until the job has completed or failed. In cases of job failure or cancellation, the iterator will raise an exception with the appropriate detail.
- Returns:
an iterator of lines of display output text from the Ansible job