zou 0.20.72__py3-none-any.whl → 0.20.74__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.
@@ -22,8 +22,19 @@ class IndexResource(Resource):
22
22
  tags:
23
23
  - Index
24
24
  responses:
25
- 200:
26
- description: API name and version
25
+ '200':
26
+ description: API name and version
27
+ content:
28
+ application/json:
29
+ schema:
30
+ type: object
31
+ properties:
32
+ api:
33
+ type: string
34
+ example: "Zou"
35
+ version:
36
+ type: string
37
+ example: "0.20.0"
27
38
  """
28
39
  return {"api": config.APP_NAME, "version": __version__}
29
40
 
@@ -100,8 +111,34 @@ class StatusResource(BaseStatusResource):
100
111
  tags:
101
112
  - Index
102
113
  responses:
103
- 200:
104
- description: API name, version and status
114
+ '200':
115
+ description: API name, version and status
116
+ content:
117
+ application/json:
118
+ schema:
119
+ type: object
120
+ properties:
121
+ name:
122
+ type: string
123
+ example: "Zou"
124
+ version:
125
+ type: string
126
+ example: "0.20.0"
127
+ database-up:
128
+ type: boolean
129
+ example: true
130
+ key-value-store-up:
131
+ type: boolean
132
+ example: true
133
+ event-stream-up:
134
+ type: boolean
135
+ example: true
136
+ job-queue-up:
137
+ type: boolean
138
+ example: true
139
+ indexer-up:
140
+ type: boolean
141
+ example: true
105
142
  """
106
143
  (
107
144
  api_name,
@@ -132,8 +169,58 @@ class StatusResourcesResource(BaseStatusResource):
132
169
  tags:
133
170
  - Index
134
171
  responses:
135
- 200:
136
- description: Date and CPU, memory and jobs stats
172
+ '200':
173
+ description: Date and CPU, memory and jobs stats
174
+ content:
175
+ application/json:
176
+ schema:
177
+ type: object
178
+ properties:
179
+ date:
180
+ type: string
181
+ format: date-time
182
+ example: "2023-12-07T10:30:00.000Z"
183
+ cpu:
184
+ type: object
185
+ properties:
186
+ percent:
187
+ type: array
188
+ items:
189
+ type: number
190
+ example: [25.5, 30.2, 28.1]
191
+ loadavg:
192
+ type: object
193
+ properties:
194
+ "last 1 min":
195
+ type: number
196
+ example: 0.75
197
+ "last 5 min":
198
+ type: number
199
+ example: 0.82
200
+ "last 10 min":
201
+ type: number
202
+ example: 0.78
203
+ memory:
204
+ type: object
205
+ properties:
206
+ total:
207
+ type: integer
208
+ example: 8589934592
209
+ used:
210
+ type: integer
211
+ example: 4294967296
212
+ available:
213
+ type: integer
214
+ example: 4294967296
215
+ percent:
216
+ type: number
217
+ example: 50.0
218
+ jobs:
219
+ type: object
220
+ properties:
221
+ running_jobs:
222
+ type: integer
223
+ example: 3
137
224
  """
138
225
  loadavg = list(psutil.getloadavg())
139
226
 
@@ -179,8 +266,20 @@ class TxtStatusResource(BaseStatusResource):
179
266
  tags:
180
267
  - Index
181
268
  responses:
182
- 200:
183
- description: API name, version and status as txt
269
+ '200':
270
+ description: API name, version and status as txt
271
+ content:
272
+ text/plain:
273
+ schema:
274
+ type: string
275
+ example: |
276
+ name: Zou
277
+ version: 0.20.0
278
+ database-up: up
279
+ event-stream-up: up
280
+ key-value-store-up: up
281
+ job-queue-up: up
282
+ indexer-up: up
184
283
  """
185
284
  (
186
285
  api_name,
@@ -219,8 +318,32 @@ class InfluxStatusResource(BaseStatusResource):
219
318
  tags:
220
319
  - Index
221
320
  responses:
222
- 200:
223
- description: Status of database, key value, event stream, job queue and time
321
+ '200':
322
+ description: Status of database, key value, event stream, job queue and time
323
+ content:
324
+ application/json:
325
+ schema:
326
+ type: object
327
+ properties:
328
+ database-up:
329
+ type: integer
330
+ example: 1
331
+ key-value-store-up:
332
+ type: integer
333
+ example: 1
334
+ event-stream-up:
335
+ type: integer
336
+ example: 1
337
+ job-queue-up:
338
+ type: integer
339
+ example: 1
340
+ indexer-up:
341
+ type: integer
342
+ example: 1
343
+ time:
344
+ type: number
345
+ format: float
346
+ example: 1701948600.123
224
347
  """
225
348
  (
226
349
  _,
@@ -253,10 +376,28 @@ class StatsResource(Resource):
253
376
  tags:
254
377
  - Index
255
378
  responses:
256
- 403:
257
- description: Permission denied
258
- 200:
259
- description: Main stats
379
+ '200':
380
+ description: Main stats
381
+ content:
382
+ application/json:
383
+ schema:
384
+ type: object
385
+ properties:
386
+ projects:
387
+ type: integer
388
+ example: 15
389
+ assets:
390
+ type: integer
391
+ example: 1250
392
+ shots:
393
+ type: integer
394
+ example: 890
395
+ tasks:
396
+ type: integer
397
+ example: 5670
398
+ persons:
399
+ type: integer
400
+ example: 45
260
401
  """
261
402
  if not permissions.has_admin_permissions():
262
403
  abort(403)
@@ -271,10 +412,46 @@ class ConfigResource(Resource):
271
412
  tags:
272
413
  - Index
273
414
  responses:
274
- 200:
275
- description: Configuration object including self-hosted status,
276
- Crisp token, indexer configuration, SAML status, and dark
277
- theme status.
415
+ '200':
416
+ description: Configuration object including self-hosted status, Crisp token, indexer configuration, SAML status, and dark theme status
417
+ content:
418
+ application/json:
419
+ schema:
420
+ type: object
421
+ properties:
422
+ is_self_hosted:
423
+ type: boolean
424
+ example: true
425
+ crisp_token:
426
+ type: string
427
+ example: "abc123def456"
428
+ dark_theme_by_default:
429
+ type: boolean
430
+ example: false
431
+ indexer_configured:
432
+ type: boolean
433
+ example: true
434
+ saml_enabled:
435
+ type: boolean
436
+ example: false
437
+ saml_idp_name:
438
+ type: string
439
+ example: "My Company SSO"
440
+ default_locale:
441
+ type: string
442
+ example: "en_US"
443
+ default_timezone:
444
+ type: string
445
+ example: "UTC"
446
+ sentry:
447
+ type: object
448
+ properties:
449
+ dsn:
450
+ type: string
451
+ example: "https://example@sentry.io/123456"
452
+ sampleRate:
453
+ type: number
454
+ example: 0.1
278
455
  """
279
456
  organisation = persons_service.get_organisation()
280
457
  conf = {
@@ -303,8 +480,16 @@ class TestEventsResource(Resource):
303
480
  tags:
304
481
  - Index
305
482
  responses:
306
- 200:
307
- description: Success flage
483
+ '200':
484
+ description: Success flag
485
+ content:
486
+ application/json:
487
+ schema:
488
+ type: object
489
+ properties:
490
+ success:
491
+ type: boolean
492
+ example: true
308
493
  """
309
494
  from zou.app.utils import events
310
495
 
@@ -13,6 +13,7 @@ from zou.app.utils import permissions
13
13
 
14
14
 
15
15
  class NewsMixin(ArgsMixin):
16
+
16
17
  def get_news(self, project_ids=[]):
17
18
  (
18
19
  only_preview,
@@ -91,6 +92,7 @@ class NewsMixin(ArgsMixin):
91
92
 
92
93
 
93
94
  class ProjectNewsResource(Resource, NewsMixin, ArgsMixin):
95
+
94
96
  @jwt_required()
95
97
  def get(self, project_id):
96
98
  """
@@ -101,117 +103,225 @@ class ProjectNewsResource(Resource, NewsMixin, ArgsMixin):
101
103
  parameters:
102
104
  - in: path
103
105
  name: project_id
104
- required: True
105
- type: string
106
- format: uuid
106
+ required: true
107
+ schema:
108
+ type: string
109
+ format: uuid
107
110
  example: a24a6ea4-ce75-4665-a070-57453082c25
108
111
  - in: query
109
112
  name: before
110
- type: string
111
- format: date
113
+ required: false
114
+ schema:
115
+ type: string
116
+ format: date
112
117
  example: "2022-07-12"
113
118
  - in: query
114
119
  name: after
115
- type: string
116
- format: date
120
+ required: false
121
+ schema:
122
+ type: string
123
+ format: date
117
124
  example: "2022-07-12"
118
125
  - in: query
119
126
  name: page
120
- type: integer
127
+ required: false
128
+ schema:
129
+ type: integer
130
+ default: 1
121
131
  example: 1
122
132
  - in: query
123
133
  name: limit
124
- type: integer
134
+ required: false
135
+ schema:
136
+ type: integer
137
+ default: 50
125
138
  example: 50
126
139
  - in: query
127
140
  name: person_id
128
- type: string
129
- format: uuid
141
+ required: false
142
+ schema:
143
+ type: string
144
+ format: uuid
130
145
  example: a24a6ea4-ce75-4665-a070-57453082c25
131
146
  - in: query
132
147
  name: task_type_id
133
- type: string
134
- format: uuid
148
+ required: false
149
+ schema:
150
+ type: string
151
+ format: uuid
135
152
  example: a24a6ea4-ce75-4665-a070-57453082c25
136
153
  - in: query
137
154
  name: task_status_id
138
- type: string
139
- format: uuid
155
+ required: false
156
+ schema:
157
+ type: string
158
+ format: uuid
140
159
  example: a24a6ea4-ce75-4665-a070-57453082c25
141
160
  - in: query
142
161
  name: episode_id
143
- type: boolean
144
- default: False
162
+ required: false
163
+ schema:
164
+ type: string
165
+ format: uuid
166
+ example: a24a6ea4-ce75-4665-a070-57453082c25
145
167
  - in: query
146
168
  name: only_preview
147
- type: boolean
148
- default: False
169
+ required: false
170
+ schema:
171
+ type: boolean
172
+ default: false
173
+ example: false
149
174
  responses:
150
- 200:
151
- description: All news related to given project
175
+ '200':
176
+ description: All news related to given project
177
+ content:
178
+ application/json:
179
+ schema:
180
+ type: object
181
+ properties:
182
+ data:
183
+ type: array
184
+ items:
185
+ type: object
186
+ properties:
187
+ id:
188
+ type: string
189
+ format: uuid
190
+ title:
191
+ type: string
192
+ content:
193
+ type: string
194
+ created_at:
195
+ type: string
196
+ format: date-time
197
+ author_id:
198
+ type: string
199
+ format: uuid
200
+ stats:
201
+ type: object
202
+ properties:
203
+ total:
204
+ type: integer
205
+ '404':
206
+ description: Project not found
152
207
  """
153
208
  return self.get_news([project_id])
154
209
 
155
210
 
156
211
  class NewsResource(Resource, NewsMixin, ArgsMixin):
212
+
157
213
  @jwt_required()
158
214
  def get(self):
159
215
  """
160
- Retrieve all news related to a given project
216
+ Retrieve all news from user's open projects
161
217
  ---
162
218
  tags:
163
219
  - News
164
220
  parameters:
165
221
  - in: query
166
222
  name: project_id
167
- required: True
168
- type: string
169
- format: uuid
223
+ required: false
224
+ schema:
225
+ type: string
226
+ format: uuid
170
227
  example: a24a6ea4-ce75-4665-a070-57453082c25
171
228
  - in: query
172
229
  name: before
173
- type: string
174
- format: date
230
+ required: false
231
+ schema:
232
+ type: string
233
+ format: date
175
234
  example: "2022-07-12"
176
235
  - in: query
177
236
  name: after
178
- type: string
179
- format: date
237
+ required: false
238
+ schema:
239
+ type: string
240
+ format: date
180
241
  example: "2022-07-12"
181
242
  - in: query
182
243
  name: page
183
- type: integer
244
+ required: false
245
+ schema:
246
+ type: integer
247
+ default: 1
184
248
  example: 1
185
249
  - in: query
186
250
  name: limit
187
- type: integer
251
+ required: false
252
+ schema:
253
+ type: integer
254
+ default: 50
188
255
  example: 50
189
256
  - in: query
190
257
  name: person_id
191
- type: string
192
- format: uuid
258
+ required: false
259
+ schema:
260
+ type: string
261
+ format: uuid
193
262
  example: a24a6ea4-ce75-4665-a070-57453082c25
194
263
  - in: query
195
264
  name: task_type_id
196
- type: string
197
- format: uuid
265
+ required: false
266
+ schema:
267
+ type: string
268
+ format: uuid
198
269
  example: a24a6ea4-ce75-4665-a070-57453082c25
199
270
  - in: query
200
271
  name: task_status_id
201
- type: string
202
- format: uuid
272
+ required: false
273
+ schema:
274
+ type: string
275
+ format: uuid
203
276
  example: a24a6ea4-ce75-4665-a070-57453082c25
204
277
  - in: query
205
278
  name: episode_id
206
- type: boolean
207
- default: False
279
+ required: false
280
+ schema:
281
+ type: string
282
+ format: uuid
283
+ example: a24a6ea4-ce75-4665-a070-57453082c25
208
284
  - in: query
209
285
  name: only_preview
210
- type: boolean
211
- default: False
286
+ required: false
287
+ schema:
288
+ type: boolean
289
+ default: false
290
+ example: false
212
291
  responses:
213
- 200:
214
- description: All news from user open projects.
292
+ '200':
293
+ description: All news from user's open projects
294
+ content:
295
+ application/json:
296
+ schema:
297
+ type: object
298
+ properties:
299
+ data:
300
+ type: array
301
+ items:
302
+ type: object
303
+ properties:
304
+ id:
305
+ type: string
306
+ format: uuid
307
+ title:
308
+ type: string
309
+ content:
310
+ type: string
311
+ created_at:
312
+ type: string
313
+ format: date-time
314
+ author_id:
315
+ type: string
316
+ format: uuid
317
+ project_id:
318
+ type: string
319
+ format: uuid
320
+ stats:
321
+ type: object
322
+ properties:
323
+ total:
324
+ type: integer
215
325
  """
216
326
  open_project_ids = []
217
327
  if permissions.has_admin_permissions():
@@ -222,6 +332,7 @@ class NewsResource(Resource, NewsMixin, ArgsMixin):
222
332
 
223
333
 
224
334
  class ProjectSingleNewsResource(Resource):
335
+
225
336
  @jwt_required()
226
337
  def get(self, project_id, news_id):
227
338
  """
@@ -232,19 +343,44 @@ class ProjectSingleNewsResource(Resource):
232
343
  parameters:
233
344
  - in: path
234
345
  name: project_id
235
- required: True
236
- type: string
237
- format: uuid
346
+ required: true
347
+ schema:
348
+ type: string
349
+ format: uuid
238
350
  example: a24a6ea4-ce75-4665-a070-57453082c25
239
351
  - in: path
240
352
  name: news_id
241
- required: True
242
- type: string
243
- format: uuid
353
+ required: true
354
+ schema:
355
+ type: string
356
+ format: uuid
244
357
  example: a24a6ea4-ce75-4665-a070-57453082c25
245
358
  responses:
246
- 200:
247
- description: Single given news related to given project
359
+ '200':
360
+ description: Single given news related to given project
361
+ content:
362
+ application/json:
363
+ schema:
364
+ type: object
365
+ properties:
366
+ id:
367
+ type: string
368
+ format: uuid
369
+ title:
370
+ type: string
371
+ content:
372
+ type: string
373
+ created_at:
374
+ type: string
375
+ format: date-time
376
+ author_id:
377
+ type: string
378
+ format: uuid
379
+ project_id:
380
+ type: string
381
+ format: uuid
382
+ '404':
383
+ description: News or project not found
248
384
  """
249
385
  projects_service.get_project(project_id)
250
386
  user_service.check_project_access(project_id)