jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | azure.communication_job_router.jobs |
Fields
The following fields are returned by SELECT queries:
- get_job
- list_jobs
| Name | Datatype | Description |
|---|---|---|
id | string | Id of a job. Required. |
assignments | object | A collection of the assignments of the job. Key is AssignmentId. |
attachedWorkerSelectors | array | A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job. |
channelId | string | The channel identifier. eg. voice, chat, etc. |
channelReference | string | Reference to an external parent context, eg. call ID. |
classificationPolicyId | string | Id of a classification policy used for classifying this job. |
dispositionCode | string | Reason code for cancelled or closed jobs. |
enqueuedAt | string (date-time) | Timestamp a job was queued in UTC. |
etag | string | The entity tag for this resource. Required. |
labels | object | A 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. |
matchingMode | object | If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode. |
notes | array | Notes attached to a job, sorted by timestamp. |
priority | integer | Priority of this job. |
queueId | string | Id of a queue that this job is queued to. |
requestedWorkerSelectors | array | A collection of manually specified worker selectors, which a worker must satisfy in order to process this job. |
scheduledAt | string (date-time) | If set, job will be scheduled to be enqueued at a given time. |
status | string | The 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) |
tags | object | A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean. |
| Name | Datatype | Description |
|---|---|---|
id | string | Id of a job. Required. |
assignments | object | A collection of the assignments of the job. Key is AssignmentId. |
attachedWorkerSelectors | array | A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job. |
channelId | string | The channel identifier. eg. voice, chat, etc. |
channelReference | string | Reference to an external parent context, eg. call ID. |
classificationPolicyId | string | Id of a classification policy used for classifying this job. |
dispositionCode | string | Reason code for cancelled or closed jobs. |
enqueuedAt | string (date-time) | Timestamp a job was queued in UTC. |
etag | string | The entity tag for this resource. Required. |
labels | object | A 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. |
matchingMode | object | If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode. |
notes | array | Notes attached to a job, sorted by timestamp. |
priority | integer | Priority of this job. |
queueId | string | Id of a queue that this job is queued to. |
requestedWorkerSelectors | array | A collection of manually specified worker selectors, which a worker must satisfy in order to process this job. |
scheduledAt | string (date-time) | If set, job will be scheduled to be enqueued at a given time. |
status | string | The 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) |
tags | object | A 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_job | select | job_id, endpoint | Retrieves an existing job by Id. Retrieves an existing job by Id. | |
list_jobs | select | endpoint | maxpagesize, status, queueId, channelId, classificationPolicyId, scheduledBefore, scheduledAfter | Retrieves list of jobs based on filter parameters. Retrieves list of jobs based on filter parameters. |
delete_job | delete | job_id, endpoint | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: ) |
job_id | string | Id of a job. Required. |
channelId | string | If specified, filter jobs by channel. Default value is None. |
classificationPolicyId | string | If specified, filter jobs by classificationPolicy. Default value is None. |
maxpagesize | integer | |
queueId | string | If specified, filter jobs by queue. Default value is None. |
scheduledAfter | string (date-time) | If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf). Default value is None. |
scheduledBefore | string (date-time) | If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, scheduledBefore]. Default value is None. |
status | string | If 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
- get_job
- list_jobs
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
;
Retrieves list of jobs based on filter parameters. Retrieves list of jobs based on filter parameters.
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 endpoint = '{{ endpoint }}' -- required
AND maxpagesize = '{{ maxpagesize }}'
AND status = '{{ status }}'
AND queueId = '{{ queueId }}'
AND channelId = '{{ channelId }}'
AND classificationPolicyId = '{{ classificationPolicyId }}'
AND scheduledBefore = '{{ scheduledBefore }}'
AND scheduledAfter = '{{ scheduledAfter }}'
;
DELETE examples
- delete_job
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
;