source: TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/CommandPermissions.openapi.yaml@ 491

Last change on this file since 491 was 487, checked in by alloc, 5 months ago

1.1.0.1 Release for V 1.0

File size: 4.8 KB
Line 
1openapi: 3.1.0
2info:
3 title: Command Permissions
4 version: '1'
5
6components:
7 schemas:
8 TypeCommandName:
9 type: string
10 pattern: '^[a-zA-Z0-9_-]+$'
11 examples:
12 - listplayers
13 description: Name of the command. Can be any of the command name variants.
14
15 CommandPermissionElement:
16 type: object
17 properties:
18 command:
19 $ref: '#/components/schemas/TypeCommandName'
20 permissionLevel:
21 type: integer
22 description: Permission level of the command
23 default:
24 type: boolean
25 description: Whether the permission level is the default value for the command
26 required:
27 - command
28 - permissionLevel
29 - default
30
31 CommandPermissionList:
32 type: array
33 items:
34 $ref: '#/components/schemas/CommandPermissionElement'
35
36
37 requestBodies:
38 CommandPermissionBodyIn:
39 content:
40 application/json:
41 schema:
42 type: object
43 properties:
44 permissionLevel:
45 type: integer
46 required:
47 - permissionLevel
48 required: true
49
50
51 parameters:
52 CommandNamePathParameter:
53 name: command
54 in: path
55 required: true
56 schema:
57 $ref: '#/components/schemas/TypeCommandName'
58
59
60paths:
61 /api/commandpermissions:
62 get:
63 tags:
64 - Permissions
65 summary: Command permission list
66 description: Fetch a list of all command permissions
67 operationId: commandpermission.get
68 responses:
69 200:
70 description: List of command permissions
71 content:
72 application/json:
73 schema:
74 type: object
75 properties:
76 data:
77 $ref: '#/components/schemas/CommandPermissionList'
78 meta:
79 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
80 required:
81 - data
82 - meta
83 403:
84 $ref: './openapi.yaml#/components/responses/Unauthorized'
85 security:
86 - apiTokenName: [ ]
87 apiTokenSecret: [ ]
88 - sessionCookie: [ ]
89
90
91 /api/commandpermissions/{command}:
92# get:
93# tags:
94# - Permissions
95# summary: Marker show
96# description: Fetch a single defined map marker
97# operationId: blacklist.get.id
98# parameters:
99# - $ref: '#/components/parameters/MarkerIdParameter'
100# responses:
101# 200:
102# description: Single found marker
103# $ref: '#/components/responses/MarkersBodyOut'
104# 404:
105# description: Marker ID not found, errorCode will be 'ID_NOT_FOUND'
106# $ref: '#/components/responses/HttpEmptyEnvelopedResponse'
107
108 post:
109 tags:
110 - Permissions
111 summary: Command permission create
112 description: Create or update a command permission override
113 operationId: commandpermission.post.id
114 parameters:
115 - $ref: '#/components/parameters/CommandNamePathParameter'
116 requestBody:
117 $ref: '#/components/requestBodies/CommandPermissionBodyIn'
118 responses:
119 201:
120 description: Command permission override created or updated
121 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
122 400:
123 description: Invalid request body, errorCode will be one of 'NO_COMMAND' or 'NO_OR_INVALID_PERMISSION_LEVEL'
124 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
125 404:
126 description: Specified command not found, errorCode will be 'UNKNOWN_COMMAND'
127 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
128 403:
129 $ref: './openapi.yaml#/components/responses/Unauthorized'
130 security:
131 - apiTokenName: []
132 apiTokenSecret: []
133 - sessionCookie: []
134
135 delete:
136 tags:
137 - Permissions
138 summary: Command permission delete
139 description: Delete a single command permission override
140 operationId: commandpermission.delete.id
141 parameters:
142 - $ref: '#/components/parameters/CommandNamePathParameter'
143 responses:
144 204:
145 description: Deleted command permission override
146 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
147 404:
148 description: Command not found or no permission override defined so far
149 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
150 403:
151 $ref: './openapi.yaml#/components/responses/Unauthorized'
152 security:
153 - apiTokenName: []
154 apiTokenSecret: []
155 - sessionCookie: []
Note: See TracBrowser for help on using the repository browser.