workers
Creates, updates, deletes, gets or lists a workers resource.
Overview
| Name | workers |
| Type | Resource |
| Id | azure.communication_job_router.workers |
Fields
The following fields are returned by SELECT queries:
- get_worker
- list_workers
| Name | Datatype | Description |
|---|---|---|
id | string | Id of a worker. Required. |
assignedJobs | array | A list of assigned jobs attached to this worker. |
availableForOffers | boolean | A flag indicating this worker is open to receive offers or not. |
capacity | integer | The total capacity score this worker has to manage multiple concurrent jobs. |
channels | array | Collection of channel(s) this worker can handle and their impact on the workers capacity. |
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. |
loadRatio | number | A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed. |
maxConcurrentOffers | integer | If this is set, the worker will only receive up to this many new offers at a time. |
offers | array | A list of active offers issued to this worker. |
queues | array | Collection of queue(s) that this worker can receive work from. |
state | string | Current state of a worker. Known values are: "active", "draining", and "inactive". (active, draining, inactive) |
tags | object | A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean. |
| Name | Datatype | Description |
|---|---|---|
id | string | Id of a worker. Required. |
assignedJobs | array | A list of assigned jobs attached to this worker. |
availableForOffers | boolean | A flag indicating this worker is open to receive offers or not. |
capacity | integer | The total capacity score this worker has to manage multiple concurrent jobs. |
channels | array | Collection of channel(s) this worker can handle and their impact on the workers capacity. |
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. |
loadRatio | number | A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed. |
maxConcurrentOffers | integer | If this is set, the worker will only receive up to this many new offers at a time. |
offers | array | A list of active offers issued to this worker. |
queues | array | Collection of queue(s) that this worker can receive work from. |
state | string | Current state of a worker. Known values are: "active", "draining", and "inactive". (active, draining, inactive) |
tags | object | A 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_worker | select | worker_id, endpoint | Retrieves an existing worker by Id. Retrieves an existing worker by Id. | |
list_workers | select | endpoint | maxpagesize, state, channelId, queueId, hasCapacity | Retrieves existing workers. Retrieves existing workers. |
delete_worker | delete | worker_id, endpoint | Deletes 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.
| 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: ) |
worker_id | string | Id of a worker. Required. |
channelId | string | If specified, select workers who have a channel configuration with this channel. Default value is None. |
hasCapacity | boolean | If 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. |
maxpagesize | integer | |
queueId | string | If specified, select workers who are assigned to this queue. Default value is None. |
state | string | If specified, select workers by worker state. Known values are: "active", "draining", "inactive", and "all". Default value is None. |
SELECT examples
- get_worker
- list_workers
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
;
Retrieves existing workers. Retrieves existing workers.
SELECT
id,
assignedJobs,
availableForOffers,
capacity,
channels,
etag,
labels,
loadRatio,
maxConcurrentOffers,
offers,
queues,
state,
tags
FROM azure.communication_job_router.workers
WHERE endpoint = '{{ endpoint }}' -- required
AND maxpagesize = '{{ maxpagesize }}'
AND state = '{{ state }}'
AND channelId = '{{ channelId }}'
AND queueId = '{{ queueId }}'
AND hasCapacity = '{{ hasCapacity }}'
;
DELETE examples
- delete_worker
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
;