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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
|
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "bunny.net Edge Storage API",
"description": "\n\nLearn how to use the [bunny.net](https://bunny.net \"bunny.net - The content delivery platform that truly hops\") Edge Storage API. It allows you to easily upload, download and delete files with just a few lines of code.\n<h2>API libraries:</h2> \nThese libraries allow quick integration for bunny.net Edge Storage.\n\n<ul>\n <li><a rel=\"nofollow\" href=\"https://github.com/BunnyWay/BunnyCDN.PHP.Storage\">BunnyCDN.PHP.Storage</a> - Official PHP storage library</li>\n <li><a rel=\"nofollow\" href=\"https://github.com/BunnyWay/BunnyCDN.Net.Storage\">BunnyCDN.Net.Storage</a> - Official .NET storage library</li>\n <li><a rel=\"nofollow\" href=\"https://github.com/BunnyWay/BunnyCDN.Java.Storage\">BunnyCDN.Java.Storage</a> - Official Java storage library</li>\n \n <li><a rel=\"nofollow\" href=\"https://github.com/NiveditJain/BunnyCDNStorageLib\">Python Storage Library</a> - (Unofficial)</li>\n</ul>\n\n<h2>Storage Endpoints:</h2> \n\nThe storage API endpoint depends on the primary storage region of your storage zone. You can also find this in the FTP & HTTP API Information of your storage zone.\n<ul>\n <li><strong>Falkenstein</strong>: storage.bunnycdn.com</li>\n <li><strong>New York</strong>: la.storage.bunnycdn.com</li>\n <li><strong>Los Angeles</strong>: la.storage.bunnycdn.com</li>\n <li><strong>Singapore</strong>: sg.storage.bunnycdn.com</li>\n <li><strong>Sydney</strong>: syd.storage.bunnycdn.com</li>\n</ul>\n",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "bunny.net API Team",
"email": "support@bunny.net",
"url": "http://bunny.net"
},
"license": {
"name": "MIT",
"url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
}
},
"security": [
{
"AccessKeyAuthentication": []
}
],
"paths": {
"/{storageZoneName}/{path}/{fileName}": {
"get": {
"tags": [
"Manage Files"
],
"summary": "Download File",
"description": "Returns the stored file at the given path. If the file does not exist, a 404 response will be returned.\n",
"parameters": [
{
"name": "storageZoneName",
"in": "path",
"description": "The name of your storage zone where you are connecting to.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "path",
"in": "path",
"description": "The directory path to your file. If this is the root of your storage zone, you can ignore this parameter.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "fileName",
"in": "path",
"description": "The name of the file that you wish to download.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "AccessKey",
"in": "header",
"required": true,
"description": "The API AccessKey used for authentication.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Returns the file stored at the given path."
},
"404": {
"description": "The file on the given path does not exist.",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ErrorObject"
}
}
}
}
}
}
},
"put": {
"tags": [
"Manage Files"
],
"summary": "Upload File",
"description": "Upload a file to a storage zone based on the URL path. If the directory tree does not exist, it will be created automatically. **The file content should be sent as the body of the request without any type of encoding.**",
"responses": {
"201": {
"description": "The file upload was successful."
},
"400": {
"description": "Upload failed."
}
},
"requestBody": {
"description": "Raw request body should contain the contents of the file. This should be raw file data without any sort of encoding.",
"required": true,
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"parameters": [
{
"name": "storageZoneName",
"in": "path",
"description": "he name of your storage zone where you are connecting to.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "path",
"in": "path",
"description": "The directory path to where your file will be stored. If this is the root of your storage zone, you can ignore this parameter.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "fileName",
"in": "path",
"description": "The name that the file will be uploaded as.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "Checksum",
"in": "header",
"required": false,
"description": "The SHA256 checksum of the uploaded content in HEX format (UPPERCASE). The server will compare the final SHA256 to the checksum and reject the request in case the checksums do not match.",
"schema": {
"type": "string"
},
"example": "D7A8FBB307D7809469CA9ABCB0082E4F8D5651E46D3CDB762D02D0BF37C9E592"
},
{
"name": "AccessKey",
"in": "header",
"required": true,
"description": "The API AccessKey used for authentication.",
"schema": {
"type": "string"
}
}
]
},
"delete": {
"tags": [
"Manage Files"
],
"summary": "Delete File",
"description": "Delete an object from the storage zone. In case the object is a directory all the data in it will be recursively deleted as well.",
"parameters": [
{
"name": "storageZoneName",
"in": "path",
"description": "The name of your storage zone where you are connecting to.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "path",
"in": "path",
"description": "The directory path to your file. If this is the root of your storage zone, you can ignore this parameter.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "fileName",
"in": "path",
"description": "The name of the file that you wish to delete.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "AccessKey",
"in": "header",
"required": true,
"description": "The API AccessKey used for authentication.",
"schema": {
"type": "string"
}
},
{
"name": "allowRootDelete",
"in": "query",
"required": false,
"description": "Set to `true` to bypass the root directory deletion guard and delete the storage zone root (`/`).",
"schema": {
"type": "string",
"enum": [
"true"
]
}
},
{
"name": "allowRootDelete",
"in": "header",
"required": false,
"description": "Set to `true` to bypass the root directory deletion guard and delete the storage zone root.",
"schema": {
"type": "string",
"enum": [
"true"
]
}
}
],
"responses": {
"200": {
"description": "Object was successfully deleted"
},
"400": {
"description": "Object delete failed"
}
}
}
},
"/{storageZoneName}/{path}/": {
"get": {
"tags": [
"Browse Files"
],
"summary": "List Files",
"description": "Retrieve a list of files and directories located in the given directory.\n",
"parameters": [
{
"name": "storageZoneName",
"in": "path",
"description": "he name of your storage zone where you are connecting to.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "path",
"in": "path",
"description": "The directory path that you want to list.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A JSON encoded array of objects.",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StorageObject"
}
}
},
"application/json": {
"examples": {
"response": {
"value": [
{
"Guid": "d6445d80-a797-4535-bf0e-d3819bcdf928",
"StorageZoneName": "testfiles",
"Path": "/testfiles/images/",
"ObjectName": "300kb.jpg",
"Length": 300000,
"LastChanged": "2017-03-10T03:06:48.203",
"IsDirectory": false,
"ServerId": 24,
"UserId": "6eb577ca-556c-4e23-970c-a5afde191042",
"DateCreated": "2017-03-10T03:06:48.203",
"StorageZoneId": 18201
},
{
"Guid": "bc0f1128-fa88-4c53-a09d-fc59b442391d",
"StorageZoneName": "testfiles",
"Path": "/testfiles/images/",
"ObjectName": "300kb.jpg",
"Length": 300000,
"LastChanged": "2017-03-10T03:06:48.203",
"IsDirectory": false,
"ServerId": 24,
"UserId": "1e733d2d-c0a4-4462-be8e-f8e63888d154",
"DateCreated": "2017-03-10T03:06:48.203",
"StorageZoneId": 18201
}
]
}
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://storage.bunnycdn.com/"
}
],
"components": {
"securitySchemes": {
"AccessKeyAuthentication": {
"type": "apiKey",
"in": "header",
"name": "AccessKey",
"description": "The storage zone password also doubles as your API key. You can find it in your storage zone details page in the bunny.net dashboard."
}
},
"schemas": {
"ErrorObject": {
"type": "object",
"properties": {
"HttpCode": {
"type": "integer",
"description": "The error status code of the request"
},
"Message": {
"type": "string",
"description": "The error description message"
}
}
},
"StorageObject": {
"type": "object",
"properties": {
"Guid": {
"type": "string",
"format": "guid",
"description": "The unique Guid that represents the file"
},
"StorageZoneName": {
"type": "string",
"description": "The full hostname domain value"
},
"Path": {
"type": "string",
"description": "True directory path where the object is located"
},
"ObjectName": {
"type": "string",
"description": "The name of the object, file or directory name"
},
"Length": {
"type": "integer",
"format": "int64",
"description": "The size of the file"
},
"LastChanged": {
"type": "string",
"format": "datetime",
"description": "The time when the file was last changed"
},
"IsDirectory": {
"type": "boolean",
"description": "True if this is a directory object, false if it's a file"
},
"ServerId": {
"type": "integer",
"description": "The ID of the physical server that holds the file"
},
"UserId": {
"type": "string",
"description": "The ID of the user that holds the file"
},
"DateCreated": {
"type": "string",
"format": "datetime",
"description": "The date and time when the object was first created"
},
"StorageZoneId": {
"type": "integer",
"description": "The storage zone ID to which the file belongs"
}
}
}
}
},
"x-explorer-enabled": true,
"x-proxy-enabled": true,
"x-samples-enabled": true,
"x-samples-languages": [
"curl",
"node",
"ruby",
"javascript",
"python"
]
}
|