10 # Type of a background job.
12 # @commit: block commit job type, see "block-commit"
14 # @stream: block stream job type, see "block-stream"
16 # @mirror: drive mirror job type, see "drive-mirror"
18 # @backup: drive backup job type, see "drive-backup"
23 'data': ['commit', 'stream', 'mirror', 'backup'] }
28 # Indicates the present state of a given job in its lifetime.
30 # @undefined: Erroneous, default state. Should not ever be visible.
32 # @created: The job has been created, but not yet started.
34 # @running: The job is currently running.
36 # @paused: The job is running, but paused. The pause may be requested by
37 # either the QMP user or by internal processes.
39 # @ready: The job is running, but is ready for the user to signal completion.
40 # This is used for long-running jobs like mirror that are designed to
43 # @standby: The job is ready, but paused. This is nearly identical to @paused.
44 # The job may return to @ready or otherwise be canceled.
46 # @waiting: The job is waiting for other jobs in the transaction to converge
47 # to the waiting state. This status will likely not be visible for
48 # the last job in a transaction.
50 # @pending: The job has finished its work, but has finalization steps that it
51 # needs to make prior to completing. These changes may require
52 # manual intervention by the management process if manual was set
53 # to true. These changes may still fail.
55 # @aborting: The job is in the process of being aborted, and will finish with
56 # an error. The job will afterwards report that it is @concluded.
57 # This status may not be visible to the management process.
59 # @concluded: The job has finished all work. If manual was set to true, the job
60 # will remain in the query list until it is dismissed.
62 # @null: The job is in the process of being dismantled. This state should not
63 # ever be visible externally.
67 { 'enum': 'JobStatus',
68 'data': ['undefined', 'created', 'running', 'paused', 'ready', 'standby',
69 'waiting', 'pending', 'aborting', 'concluded', 'null' ] }
74 # Represents command verbs that can be applied to a job.
76 # @cancel: see @block-job-cancel
78 # @pause: see @block-job-pause
80 # @resume: see @block-job-resume
82 # @set-speed: see @block-job-set-speed
84 # @complete: see @block-job-complete
86 # @dismiss: see @block-job-dismiss
88 # @finalize: see @block-job-finalize
93 'data': ['cancel', 'pause', 'resume', 'set-speed', 'complete', 'dismiss',
99 # Emitted when a job transitions to a different status.
101 # @id: The job identifier
102 # @status: The new job status
106 { 'event': 'JOB_STATUS_CHANGE',
107 'data': { 'id': 'str',
108 'status': 'JobStatus' } }
113 # Pause an active job.
115 # This command returns immediately after marking the active job for pausing.
116 # Pausing an already paused job is an error.
118 # The job will pause as soon as possible, which means transitioning into the
119 # PAUSED state if it was RUNNING, or into STANDBY if it was READY. The
120 # corresponding JOB_STATUS_CHANGE event will be emitted.
122 # Cancelling a paused job automatically resumes it.
124 # @id: The job identifier.
128 { 'command': 'job-pause', 'data': { 'id': 'str' } }
133 # Resume a paused job.
135 # This command returns immediately after resuming a paused job. Resuming an
136 # already running job is an error.
138 # @id : The job identifier.
142 { 'command': 'job-resume', 'data': { 'id': 'str' } }
147 # Instruct an active background job to cancel at the next opportunity.
148 # This command returns immediately after marking the active job for
151 # The job will cancel as soon as possible and then emit a JOB_STATUS_CHANGE
152 # event. Usually, the status will change to ABORTING, but it is possible that
153 # a job successfully completes (e.g. because it was almost done and there was
154 # no opportunity to cancel earlier than completing the job) and transitions to
157 # @id: The job identifier.
161 { 'command': 'job-cancel', 'data': { 'id': 'str' } }
167 # Manually trigger completion of an active job in the READY state.
169 # @id: The job identifier.
173 { 'command': 'job-complete', 'data': { 'id': 'str' } }
178 # Deletes a job that is in the CONCLUDED state. This command only needs to be
179 # run explicitly for jobs that don't have automatic dismiss enabled.
181 # This command will refuse to operate on any job that has not yet reached its
182 # terminal state, JOB_STATUS_CONCLUDED. For jobs that make use of JOB_READY
183 # event, job-cancel or job-complete will still need to be used as appropriate.
185 # @id: The job identifier.
189 { 'command': 'job-dismiss', 'data': { 'id': 'str' } }
194 # Instructs all jobs in a transaction (or a single job if it is not part of any
195 # transaction) to finalize any graph changes and do any necessary cleanup. This
196 # command requires that all involved jobs are in the PENDING state.
198 # For jobs in a transaction, instructing one job to finalize will force
199 # ALL jobs in the transaction to finalize, so it is only necessary to instruct
200 # a single member job to finalize.
202 # @id: The identifier of any job in the transaction, or of a job that is not
203 # part of any transaction.
207 { 'command': 'job-finalize', 'data': { 'id': 'str' } }
212 # Information about a job.
214 # @id: The job identifier
216 # @type: The kind of job that is being performed
218 # @status: Current job state/status
220 # @current-progress: Progress made until now. The unit is arbitrary and the
221 # value can only meaningfully be used for the ratio of
222 # @current-progress to @total-progress. The value is
223 # monotonically increasing.
225 # @total-progress: Estimated @current-progress value at the completion of
226 # the job. This value can arbitrarily change while the
227 # job is running, in both directions.
229 # @error: If this field is present, the job failed; if it is
230 # still missing in the CONCLUDED state, this indicates
231 # successful completion.
233 # The value is a human-readable error message to describe
234 # the reason for the job failure. It should not be parsed
239 { 'struct': 'JobInfo',
240 'data': { 'id': 'str', 'type': 'JobType', 'status': 'JobStatus',
241 'current-progress': 'int', 'total-progress': 'int',
247 # Return information about jobs.
249 # Returns: a list with a @JobInfo for each active job
253 { 'command': 'query-jobs', 'returns': ['JobInfo'] }