forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 1
/
0051.yml
42 lines (42 loc) · 1.78 KB
/
0051.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: 51
description: update get_non_stopped_workers db function to include all fields
methods:
get_non_stopped_workers:
deprecated: true
get_non_stopped_workers_2:
description: |-
Get non-stopped workers filtered by the optional arguments,
ordered by `worker_pool_id`, `worker_group`, and `worker_id`.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset `page_offset`.
mode: read
serviceName: worker_manager
args: worker_pool_id_in text, worker_group_in text, worker_id_in text, page_size_in integer, page_offset_in integer
returns: table(worker_pool_id text, worker_group text, worker_id text, provider_id text, created timestamptz, expires timestamptz, state text, provider_data jsonb, capacity integer, last_modified timestamptz, last_checked timestamptz, secret jsonb, etag uuid)
body: |-
begin
return query
select
workers.worker_pool_id,
workers.worker_group,
workers.worker_id,
workers.provider_id,
workers.created,
workers.expires,
workers.state,
workers.provider_data,
workers.capacity,
workers.last_modified,
workers.last_checked,
workers.secret,
workers.etag
from workers
where
(workers.worker_pool_id = worker_pool_id_in or worker_pool_id_in is null) and
(workers.worker_group = worker_group_in or worker_group_in is null) and
(workers.worker_id = worker_id_in or worker_id_in is null) and
(workers.state <> 'stopped')
order by worker_pool_id, worker_group, worker_id
limit get_page_limit(page_size_in)
offset get_page_offset(page_offset_in);
end