-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
endpoints.yml
198 lines (197 loc) · 5.63 KB
/
endpoints.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
swagger: '2.0'
info:
title: Arkitektonika Endpoint Definition
description: Collection of all available endpoints and their responses
version: 1.0.0
basePath: '/'
host: 'api.schematic.cloud'
paths:
/upload:
post:
summary: Upload a NBT file
consumes:
- 'multipart/form-data'
responses:
200:
description: 'The NBT file was persisted'
schema:
properties:
download_key:
type: string
deletion_key:
type: string
required:
- download_key
- deletion_key
400:
description: 'An user error occurred (No file attached / invalid NBT)'
schema:
properties:
error:
description: A more precise description of the error
type: string
required:
- error
413:
description: 'The uploaded schematic file is too big'
schema:
properties:
error:
description: Containing the error message including the max upload size
type: string
required:
- error
500:
$ref: '#/responses/500'
/download/{key}:
head:
summary: Simulate a download request to get the matching headers before retrieving the actual file
parameters:
- name: key
description: The generated download key for that file
type: string
in: path
required: true
maxLength: 32
minLength: 32
responses:
200:
description: The NBT file would be downloaded on a GET request
404:
description: 'No schematic was found for the passed download key'
schema:
properties:
error:
description: Informational
type: string
required:
- error
420:
description: 'The schematic file has already expired'
schema:
properties:
error:
description: Informational
type: string
required:
- error
500:
$ref: '#/responses/500'
get:
summary: Download an uploded NBT file
parameters:
- name: key
description: The generated download key for that file
type: string
in: path
required: true
maxLength: 32
minLength: 32
produces:
- 'application/json'
- 'application/octet-stream'
responses:
200:
description: The NBT file is present and sent in the response body
404:
description: 'No schematic was found for the passed download key'
schema:
properties:
error:
description: Informational
type: string
required:
- error
420:
description: 'The schematic file has already expired'
schema:
properties:
error:
description: Informational
type: string
required:
- error
500:
$ref: '#/responses/500'
/delete/{key}:
head:
summary: Simulate a delete request to get the matching headers before deleting the actual file
parameters:
- name: key
description: The generated deletion key for that file
type: string
in: path
required: true
maxLength: 32
minLength: 32
responses:
200:
description: The NBT file would be deleted on a DELETE request
404:
description: 'No schematic was found for the passed deletion key'
schema:
properties:
error:
description: Informational
type: string
required:
- error
420:
description: 'The schematic file has already expired'
schema:
properties:
error:
description: Informational
type: string
required:
- error
429:
description: 'Too many requests were sent'
500:
$ref: '#/responses/500'
get:
summary: Delete an uploaded NBT file
parameters:
- name: key
description: The generated deletion key for that file
type: string
in: path
required: true
maxLength: 32
minLength: 32
responses:
200:
description: The NBT file was deleted
404:
description: 'No schematic was found for the passed deletion key'
schema:
properties:
error:
description: Informational
type: string
required:
- error
420:
description: 'The schematic file has already expired'
schema:
properties:
error:
description: Informational
type: string
required:
- error
429:
description: 'Too many requests were sent'
500:
$ref: '#/responses/500'
responses:
500:
description: The request could not be handled, e.g. due to a database error
schema:
description: Basic structure of a 500 error
properties:
error:
description: Contains the component of Arkitektonika which is in charge of the error (Key-Generator / Database)
type: string
required:
- error