Skip to main content

jobs

Creates, updates, deletes, gets or lists a jobs resource.

Overview

Namejobs
TypeResource
Idazure.communication_job_router.jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringId of a job. Required.
assignmentsobjectA collection of the assignments of the job. Key is AssignmentId.
attachedWorkerSelectorsarrayA collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job.
channelIdstringThe channel identifier. eg. voice, chat, etc.
channelReferencestringReference to an external parent context, eg. call ID.
classificationPolicyIdstringId of a classification policy used for classifying this job.
dispositionCodestringReason code for cancelled or closed jobs.
enqueuedAtstring (date-time)Timestamp a job was queued in UTC.
etagstringThe entity tag for this resource. Required.
labelsobjectA set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.
matchingModeobjectIf provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode.
notesarrayNotes attached to a job, sorted by timestamp.
priorityintegerPriority of this job.
queueIdstringId of a queue that this job is queued to.
requestedWorkerSelectorsarrayA collection of manually specified worker selectors, which a worker must satisfy in order to process this job.
scheduledAtstring (date-time)If set, job will be scheduled to be enqueued at a given time.
statusstringThe status of the job. Known values are: "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", "scheduleFailed", and "waitingForActivation". (pendingClassification, queued, assigned, completed, closed, cancelled, classificationFailed, created, pendingSchedule, scheduled, scheduleFailed, waitingForActivation)
tagsobjectA set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_jobselectjob_id, endpointRetrieves an existing job by Id. Retrieves an existing job by Id.
list_jobsselectendpointmaxpagesize, status, queueId, channelId, classificationPolicyId, scheduledBefore, scheduledAfterRetrieves list of jobs based on filter parameters. Retrieves list of jobs based on filter parameters.
delete_jobdeletejob_id, endpointDeletes a job and all of its traces. Deletes a job and all of its traces.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
job_idstringId of a job. Required.
channelIdstringIf specified, filter jobs by channel. Default value is None.
classificationPolicyIdstringIf specified, filter jobs by classificationPolicy. Default value is None.
maxpagesizeinteger
queueIdstringIf specified, filter jobs by queue. Default value is None.
scheduledAfterstring (date-time)If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf). Default value is None.
scheduledBeforestring (date-time)If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, scheduledBefore]. Default value is None.
statusstringIf specified, filter jobs by status. Known values are: "all", "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", and "active". Default value is None.

SELECT examples

Retrieves an existing job by Id. Retrieves an existing job by Id.

SELECT
id,
assignments,
attachedWorkerSelectors,
channelId,
channelReference,
classificationPolicyId,
dispositionCode,
enqueuedAt,
etag,
labels,
matchingMode,
notes,
priority,
queueId,
requestedWorkerSelectors,
scheduledAt,
status,
tags
FROM azure.communication_job_router.jobs
WHERE job_id = '{{ job_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;

DELETE examples

Deletes a job and all of its traces. Deletes a job and all of its traces.

DELETE FROM azure.communication_job_router.jobs
WHERE job_id = '{{ job_id }}' --required
AND endpoint = '{{ endpoint }}' --required
;