工作人员
POST /workers.get_activity_report
描述
返回选定时间范围内活跃公司员工的数量。
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | 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 |
响应
HTTP Code | Schema |
---|---|
200 | Response 200 |
响应 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
描述
返回所有已注册工作者的信息。
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | 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 |
worker_pattern optional | The worker name pattern. If specified then only matching keys returned | string |
响应
HTTP Code | Schema |
---|---|
200 | Response 200 |
响应 200
Name | Schema |
---|---|
workers optional | < workers.worker > array |
POST /workers.get_count
描述
返回已注册工人的数量。
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | 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 |
worker_pattern optional | The worker name pattern. If specified then only matching keys are counted | string |
响应
HTTP Code | Schema |
---|---|
200 | Response 200 |
响应 200
Name | Description | Schema |
---|---|---|
count optional | Workers count | integer |
POST /workers.get_metric_keys
描述
返回按类别分组的工作者统计指标键。
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | 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 |
响应
HTTP Code | Schema |
---|---|
200 | Response 200 |
响应 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
描述
返回按日期间隔聚合的选定工人和时间范围的统计信息。
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | 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 |
响应
HTTP Code | Schema |
---|---|
200 | Response 200 |
响应 200
Name | Description | Schema |
---|---|---|
workers optional | List of the requested workers with their statistics | < workers.worker_stats > array |
POST /workers.register
描述
在系统中注册一个工作器。由工作器守护进程调用。
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | 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 |
响应
HTTP Code | Schema |
---|---|
200 | object |
POST /workers.status_report
描述
由工作守护程序定期调用以报告机器状态
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | 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 |
响应
HTTP Code | Schema |
---|---|
200 | object |
POST /workers.unregister
描述
在系统中注销一个工作器。由工作器守护进程调用。
参数
Type | Name | Description | Schema |
---|---|---|---|
Body | request required | request body | request |
请求
Name | Description | Schema |
---|---|---|
worker required | Worker id. Must be unique in company. | string |
响应
HTTP Code | Schema |
---|---|
200 | object |