-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
168 lines (168 loc) · 4.24 KB
/
openapi.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
openapi: "3.1.0"
info:
title: localton
version: 0.0.0
paths:
/v1/upload/limit:
get:
tags: [upload]
operationId: uploadGetLimitV1
summary: Get Upload Limit
responses:
200:
description: Success
content:
application/json:
schema:
type: object
properties:
file_size_limit:
type: integer
example: 2147483648
/v1/upload/start:
post:
tags: [upload]
operationId: uploadStartV1
summary: Start Upload
parameters:
- name: file_size
in: query
required: false
schema:
type: integer
responses:
200:
description: Upload session is started
content:
application/json:
schema:
type: object
properties:
token:
type: string
chunk_size:
type: integer
example: 524288
/v1/upload/chunk:
post:
tags: [upload]
operationId: uploadChunkV1
summary: Upload Chunk
parameters:
- name: token
in: query
required: true
schema:
type: string
- name: offset
in: query
required: true
schema:
type: integer
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
204:
description: Chunk is Accepted
/v1/upload/finalize:
post:
tags: [upload]
operationId: uploadFinalizeV1
summary: Finalize Upload
parameters:
- name: token
in: query
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
required: [name, md5]
properties:
name:
type: string
example: file.bin
md5:
type: string
description: THIS PROPERTY IS MIGHT NOT VERIFIED, DEPENDS ON FILE SIZE
example: d41d8cd98f00b204e9800998ecf8427e
responses:
200:
description: Successfly uploaded
content:
application/json:
schema:
type: object
properties:
ref:
type: string
/v1/files/{ref}/chunks/{offset}:
get:
tags: [file]
operationId: fetchFileChunkV1
summary: Acquire File Chunk
parameters:
- name: ref
in: path
required: true
schema:
type: string
- name: offset
in: path
required: true
description: should be divisible by 524288
schema:
type: integer
responses:
200:
description: "Contents of chunk"
content:
application/octet-stream:
schema:
type: string
format: binary
404:
description: "Something is wrong, and you can't get file with this ref"
409:
description: "Chunk reference is need to refresh"
headers:
X-New-Ref:
description: Refreshed chunk ref, for updating your database or something
schema:
type: string
429:
description: "Upstream server hates your request rate"
/v1/files/{ref}/meta:
get:
tags: [file]
operationId: fetchFileMetaV1
parameters:
- name: ref
in: path
required: true
schema:
type: string
responses:
200:
description: Get Chunk Info
content:
application/json:
schema:
type: object
properties:
file_size:
type: number
409:
description: "Chunk reference is need to refresh"
headers:
X-New-Ref:
description: Refreshed chunk ref, for updating your database or something
schema:
type: string