|
47 | 47 | description: Types of runs (e.g. calibration kinds). |
48 | 48 | - name: CTP trigger counters |
49 | 49 | description: Counters of the central trigger processor, per run and trigger class. |
| 50 | + - name: Shifts |
| 51 | + description: Data used to fill end-of-shift reports. |
50 | 52 |
|
51 | 53 | paths: |
52 | 54 | /tags: |
@@ -394,6 +396,37 @@ paths: |
394 | 396 | errors: |
395 | 397 | - { status: 404, title: Not found, detail: Run with this run number (999999999) could not be found } |
396 | 398 |
|
| 399 | + /shift-data: |
| 400 | + get: |
| 401 | + tags: [Shifts] |
| 402 | + operationId: getShiftData |
| 403 | + summary: Get the data of the pending shift of the calling user |
| 404 | + description: | |
| 405 | + Returns what a shifter needs to write their end-of-shift (EoS) report for the **pending shift**: the current shift, or the previous one |
| 406 | + during the 30 minutes that follow its end. Shifts last 8 hours and are Night (23h-7h), Morning (7h-15h) and Afternoon (15h-23h) in the |
| 407 | + Geneva time zone. The shift is deduced from the current time and the calling user, not from a parameter. |
| 408 | +
|
| 409 | + `typeSpecific` depends on `shiftType`: `{ environments }` for `ECS`, `{ runs }` for `QC/PDP`, `{ runs, tagsCounters }` for `SL`, and `null` |
| 410 | + for `SLIMOS` and `DCS`. |
| 411 | + parameters: |
| 412 | + - name: shiftType |
| 413 | + in: query |
| 414 | + required: true |
| 415 | + description: Kind of shift. |
| 416 | + schema: { type: string, enum: [ECS, QC/PDP, SLIMOS, SL, DCS], examples: [ECS] } |
| 417 | + responses: |
| 418 | + '200': |
| 419 | + description: The shift data. |
| 420 | + content: |
| 421 | + application/json: |
| 422 | + schema: { $ref: '#/components/schemas/ShiftDataResponse' } |
| 423 | + '400': { $ref: '#/components/responses/ValidationError' } |
| 424 | + '404': |
| 425 | + description: The calling user is not known to Bookkeeping. |
| 426 | + content: |
| 427 | + application/json: |
| 428 | + schema: { $ref: '#/components/schemas/ErrorResponse' } |
| 429 | + |
397 | 430 | components: |
398 | 431 | securitySchemes: |
399 | 432 | jwtQuery: |
@@ -596,3 +629,43 @@ components: |
596 | 629 | data: |
597 | 630 | type: array |
598 | 631 | items: { $ref: '#/components/schemas/CtpTriggerCounters' } |
| 632 | + Shift: |
| 633 | + type: object |
| 634 | + required: [start, end, period] |
| 635 | + properties: |
| 636 | + start: { type: integer, description: Epoch milliseconds. } |
| 637 | + end: { type: integer, description: Epoch milliseconds. } |
| 638 | + period: { type: string, enum: [Night, Morning, Afternoon] } |
| 639 | + ShiftData: |
| 640 | + type: object |
| 641 | + required: [shift, issuesLogs, typeSpecific, infoFromPreviousShifter] |
| 642 | + properties: |
| 643 | + shift: { $ref: '#/components/schemas/Shift' } |
| 644 | + issuesLogs: |
| 645 | + type: array |
| 646 | + description: Log entries of the shift carrying the tags of the shift type, EoS reports excluded (see the Logs resource). |
| 647 | + items: { type: object, additionalProperties: true } |
| 648 | + typeSpecific: |
| 649 | + type: [object, 'null'] |
| 650 | + description: Depends on the shift type, see the operation description. |
| 651 | + properties: |
| 652 | + environments: { type: array, description: 'ECS shift only.', items: { type: object, additionalProperties: true } } |
| 653 | + runs: |
| 654 | + type: object |
| 655 | + description: QC/PDP and SL shifts only. Runs of the shift grouped by run definition. |
| 656 | + additionalProperties: { type: array, items: { type: object, additionalProperties: true } } |
| 657 | + tagsCounters: |
| 658 | + type: object |
| 659 | + description: SL shift only. Number of root logs of the shift per tag text, EoS reports excluded. |
| 660 | + additionalProperties: { type: integer } |
| 661 | + infoFromPreviousShifter: |
| 662 | + type: object |
| 663 | + description: The "For next shifter" section of the EoS report of the previous shift. Exactly one of the properties is set. |
| 664 | + properties: |
| 665 | + value: { type: string } |
| 666 | + errorMessage: { type: string, description: 'Why nothing could be retrieved (no report, several reports, empty section...).' } |
| 667 | + ShiftDataResponse: |
| 668 | + type: object |
| 669 | + required: [data] |
| 670 | + properties: |
| 671 | + data: { $ref: '#/components/schemas/ShiftData' } |
0 commit comments