Skip to main content

工作人员

POST /workers.get_activity_report

描述

返回选定时间范围内活跃公司员工的数量。

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
from_date
required
Starting time (in seconds from epoch) for collecting statisticsnumber
interval
required
Time interval in seconds for a single statistics point. The minimal value is 1integer
to_date
required
Ending time (in seconds from epoch) for collecting statisticsnumber

响应

HTTP CodeSchema
200Response 200

响应 200

NameDescriptionSchema
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

描述

返回所有已注册工作者的信息。

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
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 returnedstring

响应

HTTP CodeSchema
200Response 200

响应 200

NameSchema
workers
optional
< workers.worker > array

POST /workers.get_count

描述

返回已注册工人的数量。

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
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 countedstring

响应

HTTP CodeSchema
200Response 200

响应 200

NameDescriptionSchema
count
optional
Workers countinteger

POST /workers.get_metric_keys

描述

返回按类别分组的工作者统计指标键。

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
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 CodeSchema
200Response 200

响应 200

NameDescriptionSchema
categories
optional
List of unique metric categories found in the statistics of the requested
workers.
< workers.metrics_category > array

POST /workers.get_stats

描述

返回按日期间隔聚合的选定工人和时间范围的统计信息。

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
from_date
required
Starting time (in seconds from epoch) for collecting statisticsnumber
interval
required
Time interval in seconds for a single statistics point. The minimal value is 1integer
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 statisticsnumber
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 CodeSchema
200Response 200

响应 200

NameDescriptionSchema
workers
optional
List of the requested workers with their statistics< workers.worker_stats > array

POST /workers.register

描述

在系统中注册一个工作器。由工作器守护进程调用。

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
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 CodeSchema
200object

POST /workers.status_report

描述

由工作守护程序定期调用以报告机器状态

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
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 CodeSchema
200object

POST /workers.unregister

描述

在系统中注销一个工作器。由工作器守护进程调用。

参数

TypeNameDescriptionSchema
Bodyrequest
required
request bodyrequest

请求

NameDescriptionSchema
worker
required
Worker id. Must be unique in company.string

响应

HTTP CodeSchema
200object