lustro-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lustro_cli/__init__.py +29 -0
- lustro_cli/cli.py +2460 -0
- lustro_cli/client.py +434 -0
- lustro_cli/discovery.py +1033 -0
- lustro_cli/exitcodes.py +25 -0
- lustro_cli/mcp.py +867 -0
- lustro_cli/wire/__init__.py +62 -0
- lustro_cli/wire/_schema.json +97 -0
- lustro_cli/wire/cursor-envelope.schema.json +28 -0
- lustro_cli/wire/error-envelope.schema.json +46 -0
- lustro_cli/wire/golden/cursor-delta.json +91 -0
- lustro_cli/wire/golden/cursor-reset.json +65 -0
- lustro_cli/wire/golden/cursor-unchanged.json +15 -0
- lustro_cli/wire/golden/error-envelope.json +7 -0
- lustro_cli/wire/golden/export-har-websocket.json +148 -0
- lustro_cli/wire/golden/export-har.json +359 -0
- lustro_cli/wire/golden/logs-delta.json +44 -0
- lustro_cli/wire/golden/logs-reset.json +73 -0
- lustro_cli/wire/golden/logs-unchanged.json +9 -0
- lustro_cli/wire/golden/meta.json +12 -0
- lustro_cli/wire/golden/prefs-delta.json +58 -0
- lustro_cli/wire/golden/prefs-files.json +64 -0
- lustro_cli/wire/golden/prefs-reset.json +58 -0
- lustro_cli/wire/golden/prefs-unchanged.json +4 -0
- lustro_cli/wire/golden/rules-list.json +44 -0
- lustro_cli/wire/golden/screen-tree-views.json +596 -0
- lustro_cli/wire/golden/screen-tree.json +689 -0
- lustro_cli/wire/golden/send-result.json +7 -0
- lustro_cli/wire/golden/senders-list.json +6 -0
- lustro_cli/wire/golden/sqlite-databases.json +37 -0
- lustro_cli/wire/golden/sqlite-exec.json +4 -0
- lustro_cli/wire/golden/sqlite-query.json +109 -0
- lustro_cli/wire/golden/sqlite-rows.json +109 -0
- lustro_cli/wire/golden/sqlite-schema.json +98 -0
- lustro_cli/wire/golden/sqlite-tables.json +57 -0
- lustro_cli/wire/golden/stream-delta.json +48 -0
- lustro_cli/wire/golden/stream-reset.json +66 -0
- lustro_cli/wire/golden/stream-unchanged.json +4 -0
- lustro_cli/wire/golden/transaction-image.json +43 -0
- lustro_cli/wire/golden/transaction.json +41 -0
- lustro_cli/wire/golden/websocket.json +37 -0
- lustro_cli/wire/golden/websockets-reset.json +89 -0
- lustro_cli/wire/golden/work-events.json +152 -0
- lustro_cli/wire/golden/work-item.json +118 -0
- lustro_cli/wire/golden/work-items.json +129 -0
- lustro_cli/wire/golden/work-metrics.json +40 -0
- lustro_cli/wire/logs.openapi.json +622 -0
- lustro_cli/wire/meta.schema.json +47 -0
- lustro_cli/wire/network.openapi.json +2458 -0
- lustro_cli/wire/pagination.schema.json +20 -0
- lustro_cli/wire/prefs.openapi.json +699 -0
- lustro_cli/wire/screen.openapi.json +512 -0
- lustro_cli/wire/sqlite.openapi.json +1233 -0
- lustro_cli/wire/stream-envelope.schema.json +33 -0
- lustro_cli/wire/sync.py +80 -0
- lustro_cli/wire/work.openapi.json +1188 -0
- lustro_cli-0.1.0.dist-info/METADATA +585 -0
- lustro_cli-0.1.0.dist-info/RECORD +60 -0
- lustro_cli-0.1.0.dist-info/WHEEL +4 -0
- lustro_cli-0.1.0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,1188 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Lustro WorkManager debug tab",
|
|
5
|
+
"version": "1.3",
|
|
6
|
+
"description": "The app's WorkManager work: every work request that WorkManager knows, with its state, tags, attempts, output, progress, constraints, and schedule; the events of WorkManager's execution and schedule listeners (WorkManager 2.12.0 and newer), with the result, the output, the stop reason, and the exception of each run; the history of work-analytics when the app has it; and cancel and prune. The events need the app's WorkManager configuration to go through WorkDebugTab.configure(), so the app initializes WorkManager on demand; the routes' state says whether it does. The tab records the events from Lustro.start() to Lustro.stop() and keeps them on the app's heap, so they end with the process. The tab never initializes WorkManager. Without WorkManager 2.12.0 or newer, every route answers 503 with code work_unsupported; the message names the app's WorkManager version when the APK has its version file (META-INF/androidx.work_work-runtime.version), which a build can leave out. All routes are token-authenticated (Bearer header or HttpOnly cookie) and live under /api/v1/work. Errors use the shared error envelope."
|
|
7
|
+
},
|
|
8
|
+
"servers": [
|
|
9
|
+
{
|
|
10
|
+
"url": "/",
|
|
11
|
+
"description": "The Lustro debug server (loopback by default)."
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"paths": {
|
|
15
|
+
"/api/v1/work/items": {
|
|
16
|
+
"get": {
|
|
17
|
+
"operationId": "listWork",
|
|
18
|
+
"summary": "Poll the app's work: every work request that WorkManager knows, with its state now.",
|
|
19
|
+
"description": "A cursor envelope. The list is the snapshot of one moment, from WorkManager.getWorkInfos, so the cursor stands for its content: a poll with the returned cursor and the same filters gets status=unchanged while every item stays the same, and status=delta with the whole list after any change. WorkManager keeps finished work until it prunes it: at the next start of the app's process after a day, or on POST prune. 503 with code work_not_initialized while the app has not initialized WorkManager.",
|
|
20
|
+
"parameters": [
|
|
21
|
+
{
|
|
22
|
+
"name": "cursor",
|
|
23
|
+
"in": "query",
|
|
24
|
+
"required": false,
|
|
25
|
+
"schema": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"description": "Opaque cursor from the previous response. Omit on the first poll."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "state",
|
|
32
|
+
"in": "query",
|
|
33
|
+
"required": false,
|
|
34
|
+
"schema": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"description": "One or more WorkState names, comma-separated, in any case: FAILED,CANCELLED. 400 with field state for any other value."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "tag",
|
|
41
|
+
"in": "query",
|
|
42
|
+
"required": false,
|
|
43
|
+
"schema": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"description": "Only work with this tag."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "class",
|
|
50
|
+
"in": "query",
|
|
51
|
+
"required": false,
|
|
52
|
+
"schema": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"description": "Only work of this worker class: its full name, or its simple name (the part after the last . or $)."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "name",
|
|
59
|
+
"in": "query",
|
|
60
|
+
"required": false,
|
|
61
|
+
"schema": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"description": "Only the work of this unique work name, registered or not. The items then carry the name."
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"responses": {
|
|
68
|
+
"200": {
|
|
69
|
+
"description": "Cursor envelope.",
|
|
70
|
+
"content": {
|
|
71
|
+
"application/json": {
|
|
72
|
+
"schema": {
|
|
73
|
+
"$ref": "#/components/schemas/WorkCursorEnvelope"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"400": {
|
|
79
|
+
"$ref": "#/components/responses/Error"
|
|
80
|
+
},
|
|
81
|
+
"401": {
|
|
82
|
+
"$ref": "#/components/responses/Error"
|
|
83
|
+
},
|
|
84
|
+
"403": {
|
|
85
|
+
"$ref": "#/components/responses/Error"
|
|
86
|
+
},
|
|
87
|
+
"413": {
|
|
88
|
+
"$ref": "#/components/responses/Error"
|
|
89
|
+
},
|
|
90
|
+
"500": {
|
|
91
|
+
"$ref": "#/components/responses/Error"
|
|
92
|
+
},
|
|
93
|
+
"503": {
|
|
94
|
+
"$ref": "#/components/responses/Error"
|
|
95
|
+
},
|
|
96
|
+
"504": {
|
|
97
|
+
"$ref": "#/components/responses/Error"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"/api/v1/work/items/{id}": {
|
|
103
|
+
"get": {
|
|
104
|
+
"operationId": "getWork",
|
|
105
|
+
"summary": "One work request, with its events and, with work-analytics, its history.",
|
|
106
|
+
"description": "item is null when WorkManager no longer has the work, such as after a prune, while the tab still has events of it. 404 with field id when neither has it. 503 with code work_not_initialized while the app has not initialized WorkManager.",
|
|
107
|
+
"parameters": [
|
|
108
|
+
{
|
|
109
|
+
"name": "id",
|
|
110
|
+
"in": "path",
|
|
111
|
+
"required": true,
|
|
112
|
+
"schema": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"format": "uuid"
|
|
115
|
+
},
|
|
116
|
+
"description": "The work's id. 400 with field id when it is not a UUID."
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"responses": {
|
|
120
|
+
"200": {
|
|
121
|
+
"description": "The work.",
|
|
122
|
+
"content": {
|
|
123
|
+
"application/json": {
|
|
124
|
+
"schema": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"required": [
|
|
127
|
+
"item",
|
|
128
|
+
"events",
|
|
129
|
+
"state"
|
|
130
|
+
],
|
|
131
|
+
"properties": {
|
|
132
|
+
"item": {
|
|
133
|
+
"oneOf": [
|
|
134
|
+
{
|
|
135
|
+
"$ref": "#/components/schemas/WorkItem"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "null"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"events": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"items": {
|
|
145
|
+
"$ref": "#/components/schemas/WorkEvent"
|
|
146
|
+
},
|
|
147
|
+
"description": "The events of the work that the buffer still holds, oldest first."
|
|
148
|
+
},
|
|
149
|
+
"metrics": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"items": {
|
|
152
|
+
"$ref": "#/components/schemas/WorkPeriod"
|
|
153
|
+
},
|
|
154
|
+
"description": "The periods of the work in work-analytics, oldest first. Only when the app passed a repository."
|
|
155
|
+
},
|
|
156
|
+
"state": {
|
|
157
|
+
"$ref": "#/components/schemas/WorkTabState"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"additionalProperties": false
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"400": {
|
|
166
|
+
"$ref": "#/components/responses/Error"
|
|
167
|
+
},
|
|
168
|
+
"401": {
|
|
169
|
+
"$ref": "#/components/responses/Error"
|
|
170
|
+
},
|
|
171
|
+
"403": {
|
|
172
|
+
"$ref": "#/components/responses/Error"
|
|
173
|
+
},
|
|
174
|
+
"404": {
|
|
175
|
+
"$ref": "#/components/responses/Error"
|
|
176
|
+
},
|
|
177
|
+
"413": {
|
|
178
|
+
"$ref": "#/components/responses/Error"
|
|
179
|
+
},
|
|
180
|
+
"500": {
|
|
181
|
+
"$ref": "#/components/responses/Error"
|
|
182
|
+
},
|
|
183
|
+
"503": {
|
|
184
|
+
"$ref": "#/components/responses/Error"
|
|
185
|
+
},
|
|
186
|
+
"504": {
|
|
187
|
+
"$ref": "#/components/responses/Error"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"/api/v1/work/events": {
|
|
193
|
+
"get": {
|
|
194
|
+
"operationId": "listWorkEvents",
|
|
195
|
+
"summary": "Poll the events of WorkManager's listeners: the events after the cursor, filtered.",
|
|
196
|
+
"description": "A stream envelope. The first poll gets status=reset with the last events that pass the filters, at most limit of them. A poll with the returned cursor gets status=delta with only the events after it, oldest first, or status=unchanged. When more than limit events are new, the delta has the oldest limit of them, and the next poll goes on from there. The filters leave events out of items; the cursor still moves past them. The tab records the events from Lustro.start() to Lustro.stop(), also in the background, and keeps them on the heap, so the events of a process that the system started in the background and stopped are lost; work-analytics keeps a history on disk. state.listeners says whether there are events at all.",
|
|
197
|
+
"parameters": [
|
|
198
|
+
{
|
|
199
|
+
"name": "cursor",
|
|
200
|
+
"in": "query",
|
|
201
|
+
"required": false,
|
|
202
|
+
"schema": {
|
|
203
|
+
"type": "string"
|
|
204
|
+
},
|
|
205
|
+
"description": "Opaque cursor from the previous response. Omit on the first poll."
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "id",
|
|
209
|
+
"in": "query",
|
|
210
|
+
"required": false,
|
|
211
|
+
"schema": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"format": "uuid"
|
|
214
|
+
},
|
|
215
|
+
"description": "Only the events of the work with this id. 400 with field id when it is not a UUID."
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "class",
|
|
219
|
+
"in": "query",
|
|
220
|
+
"required": false,
|
|
221
|
+
"schema": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
},
|
|
224
|
+
"description": "Only events of this worker class: its full name, or its simple name."
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "type",
|
|
228
|
+
"in": "query",
|
|
229
|
+
"required": false,
|
|
230
|
+
"schema": {
|
|
231
|
+
"type": "string"
|
|
232
|
+
},
|
|
233
|
+
"description": "One or more event types, comma-separated: finished,exception. 400 with field type for any other value."
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"name": "limit",
|
|
237
|
+
"in": "query",
|
|
238
|
+
"required": false,
|
|
239
|
+
"schema": {
|
|
240
|
+
"type": "integer",
|
|
241
|
+
"format": "int32",
|
|
242
|
+
"minimum": 1,
|
|
243
|
+
"maximum": 5000,
|
|
244
|
+
"default": 500
|
|
245
|
+
},
|
|
246
|
+
"description": "The most events in one response. 400 when it is not a whole number from 1 to 5000."
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"responses": {
|
|
250
|
+
"200": {
|
|
251
|
+
"description": "Stream envelope.",
|
|
252
|
+
"content": {
|
|
253
|
+
"application/json": {
|
|
254
|
+
"schema": {
|
|
255
|
+
"$ref": "#/components/schemas/WorkStreamEnvelope"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"400": {
|
|
261
|
+
"$ref": "#/components/responses/Error"
|
|
262
|
+
},
|
|
263
|
+
"401": {
|
|
264
|
+
"$ref": "#/components/responses/Error"
|
|
265
|
+
},
|
|
266
|
+
"403": {
|
|
267
|
+
"$ref": "#/components/responses/Error"
|
|
268
|
+
},
|
|
269
|
+
"413": {
|
|
270
|
+
"$ref": "#/components/responses/Error"
|
|
271
|
+
},
|
|
272
|
+
"503": {
|
|
273
|
+
"$ref": "#/components/responses/Error"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"/api/v1/work/metrics": {
|
|
279
|
+
"get": {
|
|
280
|
+
"operationId": "listWorkMetrics",
|
|
281
|
+
"summary": "The history that work-analytics keeps on disk, also of the runs of earlier processes.",
|
|
282
|
+
"description": "Only when the app passed its WorkMetricsInfoRepository to WorkDebugTab.createWithMetrics: otherwise 404 with code metrics_off. work-analytics keeps the periods for 7 days by default. Oldest first, by enqueue time.",
|
|
283
|
+
"parameters": [
|
|
284
|
+
{
|
|
285
|
+
"name": "id",
|
|
286
|
+
"in": "query",
|
|
287
|
+
"required": false,
|
|
288
|
+
"schema": {
|
|
289
|
+
"type": "string",
|
|
290
|
+
"format": "uuid"
|
|
291
|
+
},
|
|
292
|
+
"description": "Only the periods of the work with this id. 400 with field id when it is not a UUID."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "tag",
|
|
296
|
+
"in": "query",
|
|
297
|
+
"required": false,
|
|
298
|
+
"schema": {
|
|
299
|
+
"type": "string"
|
|
300
|
+
},
|
|
301
|
+
"description": "Only periods of work with this tag."
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"name": "class",
|
|
305
|
+
"in": "query",
|
|
306
|
+
"required": false,
|
|
307
|
+
"schema": {
|
|
308
|
+
"type": "string"
|
|
309
|
+
},
|
|
310
|
+
"description": "Only periods of this worker class: its full name, or its simple name."
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "state",
|
|
314
|
+
"in": "query",
|
|
315
|
+
"required": false,
|
|
316
|
+
"schema": {
|
|
317
|
+
"type": "string"
|
|
318
|
+
},
|
|
319
|
+
"description": "One or more WorkMetricsInfo.State names, comma-separated, in any case. 400 with field state for any other value."
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "from",
|
|
323
|
+
"in": "query",
|
|
324
|
+
"required": false,
|
|
325
|
+
"schema": {
|
|
326
|
+
"type": "integer",
|
|
327
|
+
"format": "int64",
|
|
328
|
+
"minimum": 0
|
|
329
|
+
},
|
|
330
|
+
"description": "Only periods enqueued at or after this time, in milliseconds since the epoch. 400 with field from when it is not a whole number."
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "to",
|
|
334
|
+
"in": "query",
|
|
335
|
+
"required": false,
|
|
336
|
+
"schema": {
|
|
337
|
+
"type": "integer",
|
|
338
|
+
"format": "int64",
|
|
339
|
+
"minimum": 0
|
|
340
|
+
},
|
|
341
|
+
"description": "Only periods enqueued at or before this time, in milliseconds since the epoch. 400 with field to when it is not a whole number, or is before from."
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"responses": {
|
|
345
|
+
"200": {
|
|
346
|
+
"description": "The periods.",
|
|
347
|
+
"content": {
|
|
348
|
+
"application/json": {
|
|
349
|
+
"schema": {
|
|
350
|
+
"type": "object",
|
|
351
|
+
"required": [
|
|
352
|
+
"items"
|
|
353
|
+
],
|
|
354
|
+
"properties": {
|
|
355
|
+
"items": {
|
|
356
|
+
"type": "array",
|
|
357
|
+
"items": {
|
|
358
|
+
"$ref": "#/components/schemas/WorkPeriod"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"additionalProperties": false
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"400": {
|
|
368
|
+
"$ref": "#/components/responses/Error"
|
|
369
|
+
},
|
|
370
|
+
"401": {
|
|
371
|
+
"$ref": "#/components/responses/Error"
|
|
372
|
+
},
|
|
373
|
+
"403": {
|
|
374
|
+
"$ref": "#/components/responses/Error"
|
|
375
|
+
},
|
|
376
|
+
"404": {
|
|
377
|
+
"$ref": "#/components/responses/Error"
|
|
378
|
+
},
|
|
379
|
+
"413": {
|
|
380
|
+
"$ref": "#/components/responses/Error"
|
|
381
|
+
},
|
|
382
|
+
"500": {
|
|
383
|
+
"$ref": "#/components/responses/Error"
|
|
384
|
+
},
|
|
385
|
+
"503": {
|
|
386
|
+
"$ref": "#/components/responses/Error"
|
|
387
|
+
},
|
|
388
|
+
"504": {
|
|
389
|
+
"$ref": "#/components/responses/Error"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"/api/v1/work/cancel": {
|
|
395
|
+
"post": {
|
|
396
|
+
"operationId": "cancelWork",
|
|
397
|
+
"summary": "Cancel work by its id, its unique work name, or a tag.",
|
|
398
|
+
"description": "The body names exactly one of id, name, and tag, as WorkManager's cancelWorkById, cancelUniqueWork, and cancelAllWorkByTag take them. WorkManager stops the work that runs, leaves finished work as it is, and cancels the work that depends on the cancelled work. In an app that sets a work-analytics 2.12.0 repository as its listeners, cancelling work that runs ends the app's process, through a bug of work-analytics, unless the app catches it, as the sample does. 400 with the field for any other key. 404 with the field when no work matches. 503 with code work_not_initialized while the app has not initialized WorkManager.",
|
|
399
|
+
"requestBody": {
|
|
400
|
+
"required": true,
|
|
401
|
+
"content": {
|
|
402
|
+
"application/json": {
|
|
403
|
+
"schema": {
|
|
404
|
+
"type": "object",
|
|
405
|
+
"properties": {
|
|
406
|
+
"id": {
|
|
407
|
+
"type": "string",
|
|
408
|
+
"format": "uuid"
|
|
409
|
+
},
|
|
410
|
+
"name": {
|
|
411
|
+
"type": "string",
|
|
412
|
+
"minLength": 1
|
|
413
|
+
},
|
|
414
|
+
"tag": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"minLength": 1
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
"minProperties": 1,
|
|
420
|
+
"maxProperties": 1,
|
|
421
|
+
"additionalProperties": false
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
"responses": {
|
|
427
|
+
"200": {
|
|
428
|
+
"description": "WorkManager cancelled the work.",
|
|
429
|
+
"content": {
|
|
430
|
+
"application/json": {
|
|
431
|
+
"schema": {
|
|
432
|
+
"type": "object",
|
|
433
|
+
"required": [
|
|
434
|
+
"status",
|
|
435
|
+
"cancelled"
|
|
436
|
+
],
|
|
437
|
+
"properties": {
|
|
438
|
+
"status": {
|
|
439
|
+
"const": "ok"
|
|
440
|
+
},
|
|
441
|
+
"cancelled": {
|
|
442
|
+
"type": "integer",
|
|
443
|
+
"minimum": 0,
|
|
444
|
+
"description": "How many of the matched work requests were not finished, which WorkManager cancelled; the dependent work is not counted."
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"additionalProperties": false
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"400": {
|
|
453
|
+
"$ref": "#/components/responses/Error"
|
|
454
|
+
},
|
|
455
|
+
"401": {
|
|
456
|
+
"$ref": "#/components/responses/Error"
|
|
457
|
+
},
|
|
458
|
+
"403": {
|
|
459
|
+
"$ref": "#/components/responses/Error"
|
|
460
|
+
},
|
|
461
|
+
"404": {
|
|
462
|
+
"$ref": "#/components/responses/Error"
|
|
463
|
+
},
|
|
464
|
+
"413": {
|
|
465
|
+
"$ref": "#/components/responses/Error"
|
|
466
|
+
},
|
|
467
|
+
"500": {
|
|
468
|
+
"$ref": "#/components/responses/Error"
|
|
469
|
+
},
|
|
470
|
+
"503": {
|
|
471
|
+
"$ref": "#/components/responses/Error"
|
|
472
|
+
},
|
|
473
|
+
"504": {
|
|
474
|
+
"$ref": "#/components/responses/Error"
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"/api/v1/work/prune": {
|
|
480
|
+
"post": {
|
|
481
|
+
"operationId": "pruneWork",
|
|
482
|
+
"summary": "Delete finished work, as WorkManager.pruneWork() does.",
|
|
483
|
+
"description": "WorkManager deletes the succeeded, failed, and cancelled work that no unfinished work depends on. The events in the tab's buffer stay. 503 with code work_not_initialized while the app has not initialized WorkManager.",
|
|
484
|
+
"responses": {
|
|
485
|
+
"200": {
|
|
486
|
+
"description": "WorkManager pruned the work.",
|
|
487
|
+
"content": {
|
|
488
|
+
"application/json": {
|
|
489
|
+
"schema": {
|
|
490
|
+
"type": "object",
|
|
491
|
+
"required": [
|
|
492
|
+
"status",
|
|
493
|
+
"pruned"
|
|
494
|
+
],
|
|
495
|
+
"properties": {
|
|
496
|
+
"status": {
|
|
497
|
+
"const": "ok"
|
|
498
|
+
},
|
|
499
|
+
"pruned": {
|
|
500
|
+
"type": "integer",
|
|
501
|
+
"minimum": 0,
|
|
502
|
+
"description": "How many finished work requests are gone."
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
"additionalProperties": false
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
"401": {
|
|
511
|
+
"$ref": "#/components/responses/Error"
|
|
512
|
+
},
|
|
513
|
+
"403": {
|
|
514
|
+
"$ref": "#/components/responses/Error"
|
|
515
|
+
},
|
|
516
|
+
"413": {
|
|
517
|
+
"$ref": "#/components/responses/Error"
|
|
518
|
+
},
|
|
519
|
+
"500": {
|
|
520
|
+
"$ref": "#/components/responses/Error"
|
|
521
|
+
},
|
|
522
|
+
"503": {
|
|
523
|
+
"$ref": "#/components/responses/Error"
|
|
524
|
+
},
|
|
525
|
+
"504": {
|
|
526
|
+
"$ref": "#/components/responses/Error"
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
"components": {
|
|
533
|
+
"responses": {
|
|
534
|
+
"Error": {
|
|
535
|
+
"description": "Error envelope.",
|
|
536
|
+
"content": {
|
|
537
|
+
"application/json": {
|
|
538
|
+
"schema": {
|
|
539
|
+
"$ref": "#/components/schemas/ErrorEnvelope"
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"schemas": {
|
|
546
|
+
"ErrorEnvelope": {
|
|
547
|
+
"type": "object",
|
|
548
|
+
"required": [
|
|
549
|
+
"error",
|
|
550
|
+
"message"
|
|
551
|
+
],
|
|
552
|
+
"properties": {
|
|
553
|
+
"error": {
|
|
554
|
+
"type": "string",
|
|
555
|
+
"enum": [
|
|
556
|
+
"bad_request",
|
|
557
|
+
"unauthorized",
|
|
558
|
+
"forbidden",
|
|
559
|
+
"not_found",
|
|
560
|
+
"method_not_allowed",
|
|
561
|
+
"conflict",
|
|
562
|
+
"payload_too_large",
|
|
563
|
+
"unprocessable_entity",
|
|
564
|
+
"too_many_requests",
|
|
565
|
+
"internal_error",
|
|
566
|
+
"unavailable",
|
|
567
|
+
"timeout",
|
|
568
|
+
"error"
|
|
569
|
+
],
|
|
570
|
+
"description": "Machine error type, e.g. bad_request, not_found, timeout."
|
|
571
|
+
},
|
|
572
|
+
"message": {
|
|
573
|
+
"type": "string"
|
|
574
|
+
},
|
|
575
|
+
"code": {
|
|
576
|
+
"type": "string"
|
|
577
|
+
},
|
|
578
|
+
"field": {
|
|
579
|
+
"type": "string"
|
|
580
|
+
},
|
|
581
|
+
"hint": {
|
|
582
|
+
"type": "string"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
"additionalProperties": false
|
|
586
|
+
},
|
|
587
|
+
"WorkState": {
|
|
588
|
+
"type": "string",
|
|
589
|
+
"enum": [
|
|
590
|
+
"ENQUEUED",
|
|
591
|
+
"RUNNING",
|
|
592
|
+
"SUCCEEDED",
|
|
593
|
+
"FAILED",
|
|
594
|
+
"BLOCKED",
|
|
595
|
+
"CANCELLED"
|
|
596
|
+
],
|
|
597
|
+
"description": "WorkInfo.State, by its name."
|
|
598
|
+
},
|
|
599
|
+
"WorkData": {
|
|
600
|
+
"type": "object",
|
|
601
|
+
"description": "The values of a WorkManager Data object, by key, sorted by key. A boolean, a number, or a string is that JSON value, and an array of them is an array. A long beyond 2^53 - 1 (in either direction), a NaN, and an infinity are strings.",
|
|
602
|
+
"additionalProperties": {
|
|
603
|
+
"type": [
|
|
604
|
+
"boolean",
|
|
605
|
+
"number",
|
|
606
|
+
"string",
|
|
607
|
+
"array",
|
|
608
|
+
"null"
|
|
609
|
+
]
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
"StopReason": {
|
|
613
|
+
"type": "object",
|
|
614
|
+
"required": [
|
|
615
|
+
"code",
|
|
616
|
+
"name"
|
|
617
|
+
],
|
|
618
|
+
"properties": {
|
|
619
|
+
"code": {
|
|
620
|
+
"type": "integer",
|
|
621
|
+
"description": "The value of a WorkInfo.STOP_REASON_* constant, as WorkManager reports it."
|
|
622
|
+
},
|
|
623
|
+
"name": {
|
|
624
|
+
"type": "string",
|
|
625
|
+
"enum": [
|
|
626
|
+
"NOT_STOPPED",
|
|
627
|
+
"UNKNOWN",
|
|
628
|
+
"FOREGROUND_SERVICE_TIMEOUT",
|
|
629
|
+
"CANCELLED_BY_APP",
|
|
630
|
+
"PREEMPT",
|
|
631
|
+
"TIMEOUT",
|
|
632
|
+
"DEVICE_STATE",
|
|
633
|
+
"CONSTRAINT_BATTERY_NOT_LOW",
|
|
634
|
+
"CONSTRAINT_CHARGING",
|
|
635
|
+
"CONSTRAINT_CONNECTIVITY",
|
|
636
|
+
"CONSTRAINT_DEVICE_IDLE",
|
|
637
|
+
"CONSTRAINT_STORAGE_NOT_LOW",
|
|
638
|
+
"QUOTA",
|
|
639
|
+
"BACKGROUND_RESTRICTION",
|
|
640
|
+
"APP_STANDBY",
|
|
641
|
+
"USER",
|
|
642
|
+
"SYSTEM_PROCESSING",
|
|
643
|
+
"ESTIMATED_APP_LAUNCH_TIME_CHANGED",
|
|
644
|
+
"OTHER"
|
|
645
|
+
],
|
|
646
|
+
"description": "The name of the constant without STOP_REASON_. NOT_STOPPED (-256) when the work was never stopped, UNKNOWN (-512) when WorkManager does not know why, as after the process died, and OTHER for a code that this version of the tab does not know."
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
"additionalProperties": false
|
|
650
|
+
},
|
|
651
|
+
"WorkConstraints": {
|
|
652
|
+
"type": "object",
|
|
653
|
+
"required": [
|
|
654
|
+
"network",
|
|
655
|
+
"requiresCharging",
|
|
656
|
+
"requiresDeviceIdle",
|
|
657
|
+
"requiresBatteryNotLow",
|
|
658
|
+
"requiresStorageNotLow"
|
|
659
|
+
],
|
|
660
|
+
"properties": {
|
|
661
|
+
"network": {
|
|
662
|
+
"type": "string",
|
|
663
|
+
"description": "The NetworkType name, such as NOT_REQUIRED, CONNECTED, or UNMETERED. NOT_REQUIRED when the work needs a NetworkRequest instead: see networkRequest."
|
|
664
|
+
},
|
|
665
|
+
"networkRequest": {
|
|
666
|
+
"type": "object",
|
|
667
|
+
"description": "Only when the work needs a NetworkRequest, which Constraints.Builder.setRequiredNetworkRequest sets from API 28 in place of a NetworkType. The names of the NetworkCapabilities constants that the request has, without their TRANSPORT_ and NET_CAPABILITY_ prefixes, in the order of their values; a value that this version of Lustro does not know is its number as a string.",
|
|
668
|
+
"required": [
|
|
669
|
+
"transports",
|
|
670
|
+
"capabilities"
|
|
671
|
+
],
|
|
672
|
+
"properties": {
|
|
673
|
+
"transports": {
|
|
674
|
+
"type": "array",
|
|
675
|
+
"description": "Such as WIFI, CELLULAR, ETHERNET, or VPN. Empty when the request takes any transport.",
|
|
676
|
+
"items": {
|
|
677
|
+
"type": "string"
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
"capabilities": {
|
|
681
|
+
"type": "array",
|
|
682
|
+
"description": "Such as INTERNET, NOT_METERED, or VALIDATED.",
|
|
683
|
+
"items": {
|
|
684
|
+
"type": "string"
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
"additionalProperties": false
|
|
689
|
+
},
|
|
690
|
+
"requiresCharging": {
|
|
691
|
+
"type": "boolean"
|
|
692
|
+
},
|
|
693
|
+
"requiresDeviceIdle": {
|
|
694
|
+
"type": "boolean"
|
|
695
|
+
},
|
|
696
|
+
"requiresBatteryNotLow": {
|
|
697
|
+
"type": "boolean"
|
|
698
|
+
},
|
|
699
|
+
"requiresStorageNotLow": {
|
|
700
|
+
"type": "boolean"
|
|
701
|
+
},
|
|
702
|
+
"contentUriTriggers": {
|
|
703
|
+
"type": "array",
|
|
704
|
+
"description": "Only when the work has content URI triggers.",
|
|
705
|
+
"items": {
|
|
706
|
+
"type": "object",
|
|
707
|
+
"required": [
|
|
708
|
+
"uri",
|
|
709
|
+
"descendants"
|
|
710
|
+
],
|
|
711
|
+
"properties": {
|
|
712
|
+
"uri": {
|
|
713
|
+
"type": "string"
|
|
714
|
+
},
|
|
715
|
+
"descendants": {
|
|
716
|
+
"type": "boolean"
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
"additionalProperties": false
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
"additionalProperties": false
|
|
724
|
+
},
|
|
725
|
+
"WorkItem": {
|
|
726
|
+
"type": "object",
|
|
727
|
+
"description": "One work request as WorkManager's WorkInfo has it now.",
|
|
728
|
+
"required": [
|
|
729
|
+
"id",
|
|
730
|
+
"workerClass",
|
|
731
|
+
"state",
|
|
732
|
+
"tags",
|
|
733
|
+
"runAttempts",
|
|
734
|
+
"generation",
|
|
735
|
+
"stopReason",
|
|
736
|
+
"output",
|
|
737
|
+
"progress",
|
|
738
|
+
"constraints",
|
|
739
|
+
"initialDelayMillis"
|
|
740
|
+
],
|
|
741
|
+
"properties": {
|
|
742
|
+
"id": {
|
|
743
|
+
"type": "string",
|
|
744
|
+
"format": "uuid"
|
|
745
|
+
},
|
|
746
|
+
"workerClass": {
|
|
747
|
+
"type": [
|
|
748
|
+
"string",
|
|
749
|
+
"null"
|
|
750
|
+
],
|
|
751
|
+
"description": "The worker's class name, as WorkInfo.workerClassName has it. null when WorkManager does not know it."
|
|
752
|
+
},
|
|
753
|
+
"state": {
|
|
754
|
+
"$ref": "#/components/schemas/WorkState"
|
|
755
|
+
},
|
|
756
|
+
"tags": {
|
|
757
|
+
"type": "array",
|
|
758
|
+
"items": {
|
|
759
|
+
"type": "string"
|
|
760
|
+
},
|
|
761
|
+
"description": "Sorted. WorkManager adds the worker's class name as a tag of its own."
|
|
762
|
+
},
|
|
763
|
+
"uniqueName": {
|
|
764
|
+
"type": "string",
|
|
765
|
+
"description": "The unique work name that the app enqueued the work with. WorkInfo has none, so the tab reads it from WorkManager's own database; when the app's WorkManager does not have the call that reads it, only for a name that the app registered with uniqueNames, or the name that the request asked for with name."
|
|
766
|
+
},
|
|
767
|
+
"prerequisites": {
|
|
768
|
+
"type": "array",
|
|
769
|
+
"items": {
|
|
770
|
+
"type": "string",
|
|
771
|
+
"format": "uuid"
|
|
772
|
+
},
|
|
773
|
+
"minItems": 1,
|
|
774
|
+
"description": "The ids of the work that this work waits for: the work before it in a chain of beginWith() and then(), sorted. WorkManager runs blocked work when all of it has succeeded, and fails or cancels it when one fails or is cancelled. WorkInfo has none, so the tab reads them from WorkManager's own database, as it reads uniqueName. WorkManager records them when the app enqueues the work, and the tab reads them once for each work. Absent when the work has none, and when the app's WorkManager does not have the call that reads them."
|
|
775
|
+
},
|
|
776
|
+
"runAttempts": {
|
|
777
|
+
"type": "integer",
|
|
778
|
+
"minimum": 0,
|
|
779
|
+
"description": "WorkInfo.runAttemptCount: how often the work started. A retry and a stop by the system each start it again. For periodic work, the attempts of the current period: WorkManager sets the count back to 0 when a period ends, also after a run that succeeded."
|
|
780
|
+
},
|
|
781
|
+
"generation": {
|
|
782
|
+
"type": "integer",
|
|
783
|
+
"minimum": 0,
|
|
784
|
+
"description": "How often the app updated the work with updateWork."
|
|
785
|
+
},
|
|
786
|
+
"stopReason": {
|
|
787
|
+
"$ref": "#/components/schemas/StopReason",
|
|
788
|
+
"description": "Why the last run stopped."
|
|
789
|
+
},
|
|
790
|
+
"output": {
|
|
791
|
+
"$ref": "#/components/schemas/WorkData",
|
|
792
|
+
"description": "The output of finished work; empty before."
|
|
793
|
+
},
|
|
794
|
+
"progress": {
|
|
795
|
+
"$ref": "#/components/schemas/WorkData",
|
|
796
|
+
"description": "The progress that running work set; empty otherwise."
|
|
797
|
+
},
|
|
798
|
+
"constraints": {
|
|
799
|
+
"$ref": "#/components/schemas/WorkConstraints"
|
|
800
|
+
},
|
|
801
|
+
"initialDelayMillis": {
|
|
802
|
+
"type": "integer",
|
|
803
|
+
"minimum": 0
|
|
804
|
+
},
|
|
805
|
+
"periodicity": {
|
|
806
|
+
"type": "object",
|
|
807
|
+
"required": [
|
|
808
|
+
"repeatIntervalMillis",
|
|
809
|
+
"flexIntervalMillis"
|
|
810
|
+
],
|
|
811
|
+
"properties": {
|
|
812
|
+
"repeatIntervalMillis": {
|
|
813
|
+
"type": "integer"
|
|
814
|
+
},
|
|
815
|
+
"flexIntervalMillis": {
|
|
816
|
+
"type": "integer"
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
"additionalProperties": false,
|
|
820
|
+
"description": "Only for periodic work."
|
|
821
|
+
},
|
|
822
|
+
"nextScheduleTimeMillis": {
|
|
823
|
+
"type": "integer",
|
|
824
|
+
"description": "When WorkManager plans to run the work next, in milliseconds since the epoch. Left out when it has no next run, as for finished work."
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
"additionalProperties": false
|
|
828
|
+
},
|
|
829
|
+
"WorkTabState": {
|
|
830
|
+
"type": "object",
|
|
831
|
+
"description": "The tab's view of the app's WorkManager, sent with every list and event response.",
|
|
832
|
+
"required": [
|
|
833
|
+
"listeners",
|
|
834
|
+
"initialized",
|
|
835
|
+
"metrics",
|
|
836
|
+
"uniqueNames",
|
|
837
|
+
"bufferBytes"
|
|
838
|
+
],
|
|
839
|
+
"properties": {
|
|
840
|
+
"listeners": {
|
|
841
|
+
"type": "string",
|
|
842
|
+
"enum": [
|
|
843
|
+
"installed",
|
|
844
|
+
"missing",
|
|
845
|
+
"unsupported"
|
|
846
|
+
],
|
|
847
|
+
"description": "installed: WorkManager runs with the tab's listeners, or will when the app initializes it. missing: the app's WorkManager configuration did not go through configure(), or WorkManager runs with another configuration, so there are no events. unsupported: the app's WorkManager has listener methods or calls that this version of the tab does not know, so the tab set no listeners."
|
|
848
|
+
},
|
|
849
|
+
"reason": {
|
|
850
|
+
"type": "string",
|
|
851
|
+
"description": "Why the listeners are not installed, and what to change. Only when they are not."
|
|
852
|
+
},
|
|
853
|
+
"initialized": {
|
|
854
|
+
"type": "boolean",
|
|
855
|
+
"description": "Whether the app has initialized WorkManager. Before it does, items, cancel, and prune answer 503 with code work_not_initialized: the tab never initializes WorkManager."
|
|
856
|
+
},
|
|
857
|
+
"metrics": {
|
|
858
|
+
"type": "boolean",
|
|
859
|
+
"description": "Whether the app passed a work-analytics WorkMetricsInfoRepository, so that GET metrics answers."
|
|
860
|
+
},
|
|
861
|
+
"uniqueNames": {
|
|
862
|
+
"type": "array",
|
|
863
|
+
"items": {
|
|
864
|
+
"type": "string"
|
|
865
|
+
},
|
|
866
|
+
"description": "The unique work names that the app registered; items label their work with the name."
|
|
867
|
+
},
|
|
868
|
+
"bufferBytes": {
|
|
869
|
+
"type": "integer",
|
|
870
|
+
"description": "The size of the event buffer."
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
"additionalProperties": false
|
|
874
|
+
},
|
|
875
|
+
"WorkCursorEnvelope": {
|
|
876
|
+
"type": "object",
|
|
877
|
+
"required": [
|
|
878
|
+
"cursor",
|
|
879
|
+
"status",
|
|
880
|
+
"state"
|
|
881
|
+
],
|
|
882
|
+
"properties": {
|
|
883
|
+
"cursor": {
|
|
884
|
+
"type": "string",
|
|
885
|
+
"description": "Opaque cursor token. Echo it on the next poll with the same filters."
|
|
886
|
+
},
|
|
887
|
+
"status": {
|
|
888
|
+
"type": "string",
|
|
889
|
+
"enum": [
|
|
890
|
+
"delta",
|
|
891
|
+
"unchanged",
|
|
892
|
+
"reset"
|
|
893
|
+
]
|
|
894
|
+
},
|
|
895
|
+
"items": {
|
|
896
|
+
"type": "array",
|
|
897
|
+
"items": {
|
|
898
|
+
"$ref": "#/components/schemas/WorkItem"
|
|
899
|
+
},
|
|
900
|
+
"description": "Every work item that passes the filters, in the order that WorkManager returns them. Omitted for unchanged."
|
|
901
|
+
},
|
|
902
|
+
"state": {
|
|
903
|
+
"$ref": "#/components/schemas/WorkTabState"
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
"additionalProperties": false
|
|
907
|
+
},
|
|
908
|
+
"WorkException": {
|
|
909
|
+
"type": "object",
|
|
910
|
+
"required": [
|
|
911
|
+
"type",
|
|
912
|
+
"stackTrace"
|
|
913
|
+
],
|
|
914
|
+
"properties": {
|
|
915
|
+
"type": {
|
|
916
|
+
"type": "string",
|
|
917
|
+
"description": "The throwable's class name."
|
|
918
|
+
},
|
|
919
|
+
"message": {
|
|
920
|
+
"type": "string",
|
|
921
|
+
"description": "Only when the throwable has a message. At most 4096 characters."
|
|
922
|
+
},
|
|
923
|
+
"stackTrace": {
|
|
924
|
+
"type": "string",
|
|
925
|
+
"description": "As Throwable.printStackTrace writes it, causes included, at most 16384 characters."
|
|
926
|
+
},
|
|
927
|
+
"truncated": {
|
|
928
|
+
"const": true,
|
|
929
|
+
"description": "Only when the stack trace or the message was longer and is cut."
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
"additionalProperties": false
|
|
933
|
+
},
|
|
934
|
+
"WorkEvent": {
|
|
935
|
+
"type": "object",
|
|
936
|
+
"description": "One event of WorkManager's execution or schedule listener, with the work as WorkInfo had it at the event.",
|
|
937
|
+
"required": [
|
|
938
|
+
"seq",
|
|
939
|
+
"at",
|
|
940
|
+
"type",
|
|
941
|
+
"id",
|
|
942
|
+
"workerClass",
|
|
943
|
+
"state",
|
|
944
|
+
"runAttempts",
|
|
945
|
+
"generation"
|
|
946
|
+
],
|
|
947
|
+
"properties": {
|
|
948
|
+
"seq": {
|
|
949
|
+
"type": "integer",
|
|
950
|
+
"minimum": 0,
|
|
951
|
+
"description": "The event's place in the stream of this process, from 0."
|
|
952
|
+
},
|
|
953
|
+
"at": {
|
|
954
|
+
"type": "integer",
|
|
955
|
+
"description": "When the tab recorded the event, in milliseconds since the epoch."
|
|
956
|
+
},
|
|
957
|
+
"type": {
|
|
958
|
+
"type": "string",
|
|
959
|
+
"enum": [
|
|
960
|
+
"enqueued",
|
|
961
|
+
"unblocked",
|
|
962
|
+
"updated",
|
|
963
|
+
"cancelled",
|
|
964
|
+
"prerequisiteFailed",
|
|
965
|
+
"started",
|
|
966
|
+
"stopped",
|
|
967
|
+
"finished",
|
|
968
|
+
"exception"
|
|
969
|
+
],
|
|
970
|
+
"description": "enqueued, unblocked (the work waits for no work before it: WorkManager sends it at the time of enqueued for work that has no prerequisites, or whose prerequisites all succeeded, and else when the last one succeeds), updated (updateWork), cancelled, and prerequisiteFailed (a step before it in the chain failed or was cancelled) come from the schedule listener; started, stopped, finished, and exception from the execution listener. A worker that throws ends its run with exception, not finished. WorkManager also sends cancelled, with the state CANCELLED, for finished work that an enqueue with APPEND_OR_REPLACE deletes because work of its unique name failed or was cancelled."
|
|
971
|
+
},
|
|
972
|
+
"id": {
|
|
973
|
+
"type": "string",
|
|
974
|
+
"format": "uuid"
|
|
975
|
+
},
|
|
976
|
+
"workerClass": {
|
|
977
|
+
"type": [
|
|
978
|
+
"string",
|
|
979
|
+
"null"
|
|
980
|
+
],
|
|
981
|
+
"description": "The worker's class name, as WorkInfo.workerClassName has it. null when WorkManager does not know it."
|
|
982
|
+
},
|
|
983
|
+
"state": {
|
|
984
|
+
"$ref": "#/components/schemas/WorkState"
|
|
985
|
+
},
|
|
986
|
+
"runAttempts": {
|
|
987
|
+
"type": "integer",
|
|
988
|
+
"minimum": 0,
|
|
989
|
+
"description": "WorkInfo.runAttemptCount at the event, as runAttempts of an item. The finished event of a run of periodic work has 0: WorkManager sets the count back to 0 before it sends the event. The started event of the run has the attempt."
|
|
990
|
+
},
|
|
991
|
+
"generation": {
|
|
992
|
+
"type": "integer",
|
|
993
|
+
"minimum": 0
|
|
994
|
+
},
|
|
995
|
+
"result": {
|
|
996
|
+
"type": "string",
|
|
997
|
+
"description": "For finished: success, failure, or retry, from the class name of the worker's ListenableWorker.Result."
|
|
998
|
+
},
|
|
999
|
+
"output": {
|
|
1000
|
+
"$ref": "#/components/schemas/WorkData",
|
|
1001
|
+
"description": "For finished: the output data of the Result."
|
|
1002
|
+
},
|
|
1003
|
+
"stopReason": {
|
|
1004
|
+
"$ref": "#/components/schemas/StopReason",
|
|
1005
|
+
"description": "For stopped: why WorkManager stopped the run."
|
|
1006
|
+
},
|
|
1007
|
+
"exception": {
|
|
1008
|
+
"$ref": "#/components/schemas/WorkException",
|
|
1009
|
+
"description": "For exception: what the worker threw."
|
|
1010
|
+
},
|
|
1011
|
+
"previousGeneration": {
|
|
1012
|
+
"type": "integer",
|
|
1013
|
+
"description": "For updated: the generation before the update."
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
"additionalProperties": false
|
|
1017
|
+
},
|
|
1018
|
+
"WorkStreamEnvelope": {
|
|
1019
|
+
"type": "object",
|
|
1020
|
+
"required": [
|
|
1021
|
+
"cursor",
|
|
1022
|
+
"status",
|
|
1023
|
+
"state"
|
|
1024
|
+
],
|
|
1025
|
+
"properties": {
|
|
1026
|
+
"cursor": {
|
|
1027
|
+
"type": "string",
|
|
1028
|
+
"description": "Opaque cursor token."
|
|
1029
|
+
},
|
|
1030
|
+
"status": {
|
|
1031
|
+
"type": "string",
|
|
1032
|
+
"enum": [
|
|
1033
|
+
"delta",
|
|
1034
|
+
"unchanged",
|
|
1035
|
+
"reset"
|
|
1036
|
+
]
|
|
1037
|
+
},
|
|
1038
|
+
"items": {
|
|
1039
|
+
"type": "array",
|
|
1040
|
+
"items": {
|
|
1041
|
+
"$ref": "#/components/schemas/WorkEvent"
|
|
1042
|
+
},
|
|
1043
|
+
"description": "Oldest first. For reset, the last events that pass the filters; for delta, the events after the cursor."
|
|
1044
|
+
},
|
|
1045
|
+
"dropped": {
|
|
1046
|
+
"type": "integer",
|
|
1047
|
+
"minimum": 0,
|
|
1048
|
+
"description": "For delta: events that the buffer evicted before this client got them."
|
|
1049
|
+
},
|
|
1050
|
+
"state": {
|
|
1051
|
+
"$ref": "#/components/schemas/WorkTabState"
|
|
1052
|
+
}
|
|
1053
|
+
},
|
|
1054
|
+
"additionalProperties": false
|
|
1055
|
+
},
|
|
1056
|
+
"WorkPeriod": {
|
|
1057
|
+
"type": "object",
|
|
1058
|
+
"description": "One period of a work's history in work-analytics: one run of one-time work, or one interval of periodic work. A time that work-analytics has not seen yet is left out.",
|
|
1059
|
+
"required": [
|
|
1060
|
+
"id",
|
|
1061
|
+
"generation",
|
|
1062
|
+
"workerClass",
|
|
1063
|
+
"tags",
|
|
1064
|
+
"state",
|
|
1065
|
+
"runAttempts",
|
|
1066
|
+
"explicitRetries",
|
|
1067
|
+
"stopReasons"
|
|
1068
|
+
],
|
|
1069
|
+
"properties": {
|
|
1070
|
+
"id": {
|
|
1071
|
+
"type": "string",
|
|
1072
|
+
"format": "uuid"
|
|
1073
|
+
},
|
|
1074
|
+
"generation": {
|
|
1075
|
+
"type": "integer",
|
|
1076
|
+
"minimum": 0
|
|
1077
|
+
},
|
|
1078
|
+
"workerClass": {
|
|
1079
|
+
"type": [
|
|
1080
|
+
"string",
|
|
1081
|
+
"null"
|
|
1082
|
+
],
|
|
1083
|
+
"description": "The worker's class name, as WorkInfo.workerClassName has it. null when WorkManager does not know it."
|
|
1084
|
+
},
|
|
1085
|
+
"tags": {
|
|
1086
|
+
"type": "array",
|
|
1087
|
+
"items": {
|
|
1088
|
+
"type": "string"
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
"state": {
|
|
1092
|
+
"type": "string",
|
|
1093
|
+
"enum": [
|
|
1094
|
+
"ENQUEUED_BLOCKED",
|
|
1095
|
+
"ENQUEUED_PENDING",
|
|
1096
|
+
"RUNNING",
|
|
1097
|
+
"SUCCEEDED",
|
|
1098
|
+
"FAILED",
|
|
1099
|
+
"CANCELLED",
|
|
1100
|
+
"OBSOLETE_UPDATED"
|
|
1101
|
+
],
|
|
1102
|
+
"description": "WorkMetricsInfo.State, by its name."
|
|
1103
|
+
},
|
|
1104
|
+
"enqueueTimeMillis": {
|
|
1105
|
+
"type": "integer",
|
|
1106
|
+
"description": "Milliseconds since the epoch."
|
|
1107
|
+
},
|
|
1108
|
+
"unblockTimeMillis": {
|
|
1109
|
+
"type": "integer",
|
|
1110
|
+
"description": "Milliseconds since the epoch."
|
|
1111
|
+
},
|
|
1112
|
+
"firstStartTimeMillis": {
|
|
1113
|
+
"type": "integer",
|
|
1114
|
+
"description": "Milliseconds since the epoch."
|
|
1115
|
+
},
|
|
1116
|
+
"finishTimeMillis": {
|
|
1117
|
+
"type": "integer",
|
|
1118
|
+
"description": "Milliseconds since the epoch."
|
|
1119
|
+
},
|
|
1120
|
+
"workerDurationMillis": {
|
|
1121
|
+
"type": "integer",
|
|
1122
|
+
"description": "How long the worker ran in the run that finished the period."
|
|
1123
|
+
},
|
|
1124
|
+
"totalRuntimeMillis": {
|
|
1125
|
+
"type": "integer",
|
|
1126
|
+
"description": "How long the worker ran in all attempts of the period."
|
|
1127
|
+
},
|
|
1128
|
+
"runAttempts": {
|
|
1129
|
+
"type": "integer",
|
|
1130
|
+
"minimum": 0
|
|
1131
|
+
},
|
|
1132
|
+
"explicitRetries": {
|
|
1133
|
+
"type": "integer",
|
|
1134
|
+
"minimum": 0,
|
|
1135
|
+
"description": "How often the worker returned Result.retry()."
|
|
1136
|
+
},
|
|
1137
|
+
"stopReasons": {
|
|
1138
|
+
"type": "array",
|
|
1139
|
+
"description": "How often each stop reason stopped a run of the period, by code.",
|
|
1140
|
+
"items": {
|
|
1141
|
+
"type": "object",
|
|
1142
|
+
"required": [
|
|
1143
|
+
"code",
|
|
1144
|
+
"name",
|
|
1145
|
+
"count"
|
|
1146
|
+
],
|
|
1147
|
+
"properties": {
|
|
1148
|
+
"code": {
|
|
1149
|
+
"type": "integer"
|
|
1150
|
+
},
|
|
1151
|
+
"name": {
|
|
1152
|
+
"type": "string",
|
|
1153
|
+
"enum": [
|
|
1154
|
+
"NOT_STOPPED",
|
|
1155
|
+
"UNKNOWN",
|
|
1156
|
+
"FOREGROUND_SERVICE_TIMEOUT",
|
|
1157
|
+
"CANCELLED_BY_APP",
|
|
1158
|
+
"PREEMPT",
|
|
1159
|
+
"TIMEOUT",
|
|
1160
|
+
"DEVICE_STATE",
|
|
1161
|
+
"CONSTRAINT_BATTERY_NOT_LOW",
|
|
1162
|
+
"CONSTRAINT_CHARGING",
|
|
1163
|
+
"CONSTRAINT_CONNECTIVITY",
|
|
1164
|
+
"CONSTRAINT_DEVICE_IDLE",
|
|
1165
|
+
"CONSTRAINT_STORAGE_NOT_LOW",
|
|
1166
|
+
"QUOTA",
|
|
1167
|
+
"BACKGROUND_RESTRICTION",
|
|
1168
|
+
"APP_STANDBY",
|
|
1169
|
+
"USER",
|
|
1170
|
+
"SYSTEM_PROCESSING",
|
|
1171
|
+
"ESTIMATED_APP_LAUNCH_TIME_CHANGED",
|
|
1172
|
+
"OTHER"
|
|
1173
|
+
]
|
|
1174
|
+
},
|
|
1175
|
+
"count": {
|
|
1176
|
+
"type": "integer",
|
|
1177
|
+
"minimum": 1
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
"additionalProperties": false
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1184
|
+
"additionalProperties": false
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
}
|