Skip to main content

workers

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

Overview

Nameworkers
TypeResource
Idazure.communication_job_router.workers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringId of a worker. Required.
assignedJobsarrayA list of assigned jobs attached to this worker.
availableForOffersbooleanA flag indicating this worker is open to receive offers or not.
capacityintegerThe total capacity score this worker has to manage multiple concurrent jobs.
channelsarrayCollection of channel(s) this worker can handle and their impact on the workers capacity.
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.
loadRationumberA value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed.
maxConcurrentOffersintegerIf this is set, the worker will only receive up to this many new offers at a time.
offersarrayA list of active offers issued to this worker.
queuesarrayCollection of queue(s) that this worker can receive work from.
statestringCurrent state of a worker. Known values are: "active", "draining", and "inactive". (active, draining, inactive)
tagsobjectA set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_workerselectworker_id, endpointRetrieves an existing worker by Id. Retrieves an existing worker by Id.
list_workersselectendpointmaxpagesize, state, channelId, queueId, hasCapacityRetrieves existing workers. Retrieves existing workers.
delete_workerdeleteworker_id, endpointDeletes a worker and all of its traces. Deletes a worker 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: )
worker_idstringId of a worker. Required.
channelIdstringIf specified, select workers who have a channel configuration with this channel. Default value is None.
hasCapacitybooleanIf set to true, select only workers who have capacity for the channel specified by channelId or for any channel if channelId not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false. Default value is None.
maxpagesizeinteger
queueIdstringIf specified, select workers who are assigned to this queue. Default value is None.
statestringIf specified, select workers by worker state. Known values are: "active", "draining", "inactive", and "all". Default value is None.

SELECT examples

Retrieves an existing worker by Id. Retrieves an existing worker by Id.

SELECT
id,
assignedJobs,
availableForOffers,
capacity,
channels,
etag,
labels,
loadRatio,
maxConcurrentOffers,
offers,
queues,
state,
tags
FROM azure.communication_job_router.workers
WHERE worker_id = '{{ worker_id }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;

DELETE examples

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

DELETE FROM azure.communication_job_router.workers
WHERE worker_id = '{{ worker_id }}' --required
AND endpoint = '{{ endpoint }}' --required
;