forked from rejetto/hfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
194 lines (194 loc) · 5.38 KB
/
openapi.yaml
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
---
openapi: 3.0.0
info:
title: HFS REST API
contact:
name: Massimo Melina
email: [email protected]
version: 1.0.0
servers:
- url: /
paths:
/~/api/get_file_list:
get:
tags:
- Front-end
description: returns all files of a specified folder
parameters:
- name: uri
in: query
description: path to the folder containing the files. Default is `/`
required: false
style: form
explode: true
schema:
type: string
- name: offset
in: query
description: number of records to skip
required: false
style: form
explode: true
schema:
type: number
- name: limit
in: query
description: max number of records to return
required: false
style: form
explode: true
schema:
type: number
- name: search
in: query
description: "search for files with the specified pattern, also in subfolders."
required: false
style: form
explode: true
schema:
type: string
- name: c
in: query
description: "request separated `c` and `m` properties in entries. Pass any string to turn it on. By default only `m` is provided, and when missing it is copied from `c`."
required: false
style: form
explode: true
schema:
type: string
responses:
"200":
description: all files accordingly to the specified parameters
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_200'
/{folder}:
post:
tags:
- Front-end
summary: Uploads a file to a specific folder
description: Equivalent to curl -F upload=@FILE FOLDER/
parameters:
- name: folder
in: path
description: The folder path where the file will be uploaded
required: true
style: simple
explode: false
schema:
type: string
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/folder_body'
encoding:
file:
contentType: application/octet-stream
headers:
Content-Disposition:
style: simple
explode: false
schema:
type: string
description: "Form field name and filename, e.g., 'form-data; name=\"file\"; filename=\"example.txt\"'"
style: form
required: true
responses:
"200":
description: File uploaded successfully
"400":
description: Bad request
/{folder}/{file}:
put:
tags:
- Front-end
summary: Uploads a file to a specific folder
description: Equivalent to curl -T FILE URL/
parameters:
- name: folder
in: path
description: The folder path where the file will be uploaded
required: true
style: simple
explode: false
schema:
type: string
- name: file
in: path
description: The uploaded file name
required: true
style: simple
explode: false
schema:
type: string
requestBody:
content:
application/octet-stream: {}
required: true
responses:
"200":
description: File uploaded successfully
components:
schemas:
DirEntry:
required:
- "n"
type: object
properties:
"n":
type: string
description: name of the entry. Can be a relative path in case you used `search`.
c:
type: string
description: creation time
format: date-time
m:
type: string
description: modification time
format: date-time
s:
type: number
description: "size, in bytes"
p:
pattern: "[rR]?[lL]?d?"
type: string
description: |
permissions, only when are different from the parent folder.
Meaning of each character:
- r: cannot be downloaded
- R: can be downloaded only with other credentials
- l: folder cannot be listed
- L: folder can be listed only with other credetnials
- d: can be deleted
comment:
type: string
description: assigned comment
description: front-end list item format. Common properties are kept short to optimize space.
inline_response_200:
type: object
properties:
can_archive:
type: boolean
description: if you can download this folder as zip
can_upload:
type: boolean
description: if you can upload in this folder
can_delete:
type: boolean
description: if you can delete items in this folder
can_comment:
type: boolean
description: if you can coment items in this folder
list:
type: array
description: entries from this folder
items:
$ref: '#/components/schemas/DirEntry'
folder_body:
type: object
properties:
file:
type: string
description: The file to upload.
format: binary