source: TFP-WebServer/WebServer/src/WebAPI/APIs/Log.openapi.yaml@ 466

Last change on this file since 466 was 460, checked in by alloc, 16 months ago

More OpenAPI specs added
OpenAPI specs cleanup to have everything validate fine
Added CORS support to API endpoints

File size: 3.0 KB
Line 
1openapi: 3.1.0
2info:
3 title: Log
4 version: '1'
5
6components:
7 schemas:
8 LogEntry:
9 type: object
10 properties:
11 msg:
12 type: string
13 examples:
14 - 'Version: Alpha 21 (b48) Compatibility Version: Alpha 21, Build: WindowsPlayer 64 Bit'
15 description: Message
16 type:
17 type: string
18 enum:
19 - Error
20 - Assert
21 - Warning
22 - Log
23 - Exception
24 description: Severity type
25 trace:
26 type: string
27 description: Stacktrace if entry is an Exception
28 isotime:
29 type: string
30 format: date-time
31 uptime:
32 type: string
33 examples:
34 - '87123'
35 description: Time since server was started in milliseconds.
36 required:
37 - msg
38 - type
39 - trace
40 - isotime
41 - uptime
42
43 LogData:
44 type: object
45 properties:
46 entries:
47 type: array
48 items:
49 $ref: '#/components/schemas/LogEntry'
50 firstLine:
51 type: integer
52 examples:
53 - 47
54 description: Number of first line retrieved
55 lastLine:
56 type: integer
57 examples:
58 - 48
59 description: Number of next line to retrieve to follow up without missing entries
60 required:
61 - entries
62 - firstLine
63 - lastLine
64
65
66 parameters:
67 LogCountParameter:
68 name: count
69 in: query
70 required: false
71 schema:
72 type: integer
73 description: Number of lines to fetch. If negative fetches count lines from the firstLine. Defaults to 50.
74
75 LogFirstLineParameter:
76 name: firstLine
77 in: query
78 required: false
79 schema:
80 type: integer
81 description: First line number to fetch. Defaults to the oldest stored log line if count is positive. Defaults to the most recent log line if count is negative.
82
83paths:
84 /api/Log:
85 get:
86 tags:
87 - Log
88 summary: Log
89 description: Get an amount of lines from the server log
90 operationId: log.get
91 parameters:
92 - $ref: '#/components/parameters/LogCountParameter'
93 - $ref: '#/components/parameters/LogFirstLineParameter'
94 responses:
95 200:
96 description: Log information
97 content:
98 application/json:
99 schema:
100 type: object
101 properties:
102 data:
103 $ref: '#/components/schemas/LogData'
104 meta:
105 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
106 required:
107 - data
108 - meta
109 403:
110 $ref: './openapi.yaml#/components/responses/Unauthorized'
111 security:
112 - apiTokenName: []
113 apiTokenSecret: []
114 - sessionCookie: []
Note: See TracBrowser for help on using the repository browser.