workers
POST /workers.get_activity_report
Description
Returns count of active company workers in the selected time range.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
from_date required | Starting time (in seconds from epoch) for collecting statistics | number |
interval required | Time interval in seconds for a single statistics point. The minimal value is 1 | integer |
to_date required | Ending time (in seconds from epoch) for collecting statistics | number |
Responses
HTTP Code | Schema |
---|---|
200 | Response 200 |
Response 200
Name | Description | Schema |
---|---|---|
active optional | Activity series that include only workers that worked on a task in the given time interval. | workers.activity_series |
total optional | Activity series that include all the workers that sent reports in the given time interval. | workers.activity_series |
POST /workers.get_all
Description
Returns information on all registered workers.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
last_seen optional | Filter out workers not active for more than last_seen seconds. A value or 0 or 'none' will disable the filter. | integer |
system_tags optional | The list of allowed worker system tags. Prepend tag value with '-' in order to exclude | < string > array |
tags optional | The list of allowed worker tags. Prepend tag value with '-' in order to exclude | < string > array |
Responses
HTTP Code | Schema |
---|---|
200 | Response 200 |
Response 200
Name | Schema |
---|---|
workers optional | < workers.worker > array |
POST /workers.get_count
Description
Returns the number of registered workers.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
last_seen optional | Filter out workers not active for more than last_seen seconds. A value or 0 or 'none' will disable the filter. | integer |
system_tags optional | The list of allowed worker system tags. Prepend tag value with '-' in order to exclude | < string > array |
tags optional | The list of allowed worker tags. Prepend tag value with '-' in order to exclude | < string > array |
Responses
HTTP Code | Schema |
---|---|
200 | Response 200 |
Response 200
Name | Description | Schema |
---|---|---|
count optional | Workers count | integer |
POST /workers.get_metric_keys
Description
Returns worker statistics metric keys grouped by categories.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
worker_ids optional | List of worker ids to collect metrics for. If not provided or empty then all the company workers metrics are analyzed. | < string > array |
Responses
HTTP Code | Schema |
---|---|
200 | Response 200 |
Response 200
Name | Description | Schema |
---|---|---|
categories optional | List of unique metric categories found in the statistics of the requested workers. | < workers.metrics_category > array |
POST /workers.get_stats
Description
Returns statistics for the selected workers and time range aggregated by date
intervals.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
from_date required | Starting time (in seconds from epoch) for collecting statistics | number |
interval required | Time interval in seconds for a single statistics point. The minimal value is 1 | integer |
items required | List of metric keys and requested statistics | < workers.stat_item > array |
split_by_variant optional | If true then break statistics by hardware sub types Default : false | boolean |
to_date required | Ending time (in seconds from epoch) for collecting statistics | number |
worker_ids optional | List of worker ids to collect metrics for. If not provided or empty then all the company workers metrics are analyzed. | < string > array |
Responses
HTTP Code | Schema |
---|---|
200 | Response 200 |
Response 200
Name | Description | Schema |
---|---|---|
workers optional | List of the requested workers with their statistics | < workers.worker_stats > array |
POST /workers.register
Description
Register a worker in the system. Called by the Worker Daemon.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
queues optional | List of queue IDs on which the worker is listening. | < string > array |
system_tags optional | System tags for the worker | < string > array |
tags optional | User tags for the worker | < string > array |
timeout optional | Registration timeout in seconds. If timeout seconds have passed since the worker's last call to register or status_report, the worker is automatically removed from the list of registered workers. | integer |
worker required | Worker id. Must be unique in company. | string |
Responses
HTTP Code | Schema |
---|---|
200 | object |
POST /workers.status_report
Description
Called periodically by the worker daemon to report machine status
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
machine_stats optional | The machine statistics. | workers.machine_stats |
queue optional | ID of the queue from which task was received. If no queue is sent, the worker's queue field will be cleared. | string |
queues optional | List of queue IDs on which the worker is listening. If null, the worker's queues list will not be updated. | < string > array |
system_tags optional | New system tags for the worker | < string > array |
tags optional | New user tags for the worker | < string > array |
task optional | ID of a task currently being run by the worker. If no task is sent, the worker's task field will be cleared. | string |
timestamp required | UNIX time in seconds since epoch. | integer |
worker required | Worker id. | string |
Responses
HTTP Code | Schema |
---|---|
200 | object |
POST /workers.unregister
Description
Unregister a worker in the system. Called by the Worker Daemon.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
request
Name | Description | Schema |
---|---|---|
worker required | Worker id. Must be unique in company. | string |
Responses
HTTP Code | Schema |
---|---|
200 | object |