ruby-libstorj 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.gitmodules +3 -0
  4. data/.rspec +1 -0
  5. data/Gemfile +23 -0
  6. data/Gemfile.lock +111 -0
  7. data/Guardfile +21 -0
  8. data/LICENSE +502 -0
  9. data/README.md +262 -0
  10. data/Rakefile +76 -0
  11. data/ext/libstorj/.gitignore +47 -0
  12. data/ext/libstorj/.travis.yml +27 -0
  13. data/ext/libstorj/Doxyfile +2427 -0
  14. data/ext/libstorj/LICENSE +502 -0
  15. data/ext/libstorj/Makefile.am +6 -0
  16. data/ext/libstorj/README.md +198 -0
  17. data/ext/libstorj/autogen.sh +3 -0
  18. data/ext/libstorj/configure.ac +64 -0
  19. data/ext/libstorj/depends/Makefile +153 -0
  20. data/ext/libstorj/depends/config.guess +1462 -0
  21. data/ext/libstorj/depends/config.sub +1823 -0
  22. data/ext/libstorj/depends/extract-osx-sdk.sh +33 -0
  23. data/ext/libstorj/depends/packages/cctools.mk +7 -0
  24. data/ext/libstorj/depends/packages/clang.mk +7 -0
  25. data/ext/libstorj/depends/packages/gmp.mk +23 -0
  26. data/ext/libstorj/depends/packages/gnutls.mk +25 -0
  27. data/ext/libstorj/depends/packages/json-c.mk +7 -0
  28. data/ext/libstorj/depends/packages/libcurl.mk +39 -0
  29. data/ext/libstorj/depends/packages/libmicrohttpd.mk +7 -0
  30. data/ext/libstorj/depends/packages/libuv.mk +7 -0
  31. data/ext/libstorj/depends/packages/nettle.mk +30 -0
  32. data/ext/libstorj/libstorj.pc.in +11 -0
  33. data/ext/libstorj/src/Makefile.am +23 -0
  34. data/ext/libstorj/src/bip39.c +233 -0
  35. data/ext/libstorj/src/bip39.h +64 -0
  36. data/ext/libstorj/src/bip39_english.h +2074 -0
  37. data/ext/libstorj/src/cli.c +1494 -0
  38. data/ext/libstorj/src/crypto.c +525 -0
  39. data/ext/libstorj/src/crypto.h +178 -0
  40. data/ext/libstorj/src/downloader.c +1923 -0
  41. data/ext/libstorj/src/downloader.h +163 -0
  42. data/ext/libstorj/src/http.c +688 -0
  43. data/ext/libstorj/src/http.h +175 -0
  44. data/ext/libstorj/src/rs.c +962 -0
  45. data/ext/libstorj/src/rs.h +99 -0
  46. data/ext/libstorj/src/storj.c +1523 -0
  47. data/ext/libstorj/src/storj.h +1014 -0
  48. data/ext/libstorj/src/uploader.c +2736 -0
  49. data/ext/libstorj/src/uploader.h +181 -0
  50. data/ext/libstorj/src/utils.c +336 -0
  51. data/ext/libstorj/src/utils.h +65 -0
  52. data/ext/libstorj/test/Makefile.am +27 -0
  53. data/ext/libstorj/test/mockbridge.c +260 -0
  54. data/ext/libstorj/test/mockbridge.json +687 -0
  55. data/ext/libstorj/test/mockbridgeinfo.json +1836 -0
  56. data/ext/libstorj/test/mockfarmer.c +358 -0
  57. data/ext/libstorj/test/storjtests.h +41 -0
  58. data/ext/libstorj/test/tests.c +1617 -0
  59. data/ext/libstorj/test/tests_rs.c +869 -0
  60. data/ext/ruby-libstorj/extconf.rb +8 -0
  61. data/ext/ruby-libstorj/ruby-libstorj.cc +17 -0
  62. data/lib/ruby-libstorj.rb +1 -0
  63. data/lib/ruby-libstorj/arg_forwarding_task.rb +58 -0
  64. data/lib/ruby-libstorj/env.rb +178 -0
  65. data/lib/ruby-libstorj/ext/bucket.rb +71 -0
  66. data/lib/ruby-libstorj/ext/create_bucket_request.rb +53 -0
  67. data/lib/ruby-libstorj/ext/curl_code.rb +139 -0
  68. data/lib/ruby-libstorj/ext/ext.rb +71 -0
  69. data/lib/ruby-libstorj/ext/file.rb +84 -0
  70. data/lib/ruby-libstorj/ext/get_bucket_request.rb +45 -0
  71. data/lib/ruby-libstorj/ext/json_request.rb +51 -0
  72. data/lib/ruby-libstorj/ext/list_files_request.rb +63 -0
  73. data/lib/ruby-libstorj/ext/types.rb +226 -0
  74. data/lib/ruby-libstorj/ext/upload_options.rb +38 -0
  75. data/lib/ruby-libstorj/libstorj.rb +22 -0
  76. data/lib/ruby-libstorj/mixins/storj.rb +27 -0
  77. data/lib/ruby-libstorj/struct.rb +42 -0
  78. data/ruby-libstorj.gemspec +57 -0
  79. data/spec/helpers/options.yml.example +22 -0
  80. data/spec/helpers/shared_rake_examples.rb +132 -0
  81. data/spec/helpers/storj_options.rb +96 -0
  82. data/spec/helpers/upload.data +3 -0
  83. data/spec/helpers/upload.data.sha256 +1 -0
  84. data/spec/libstorj_spec.rb +0 -0
  85. data/spec/ruby-libstorj/arg_forwarding_task_spec.rb +311 -0
  86. data/spec/ruby-libstorj/env_spec.rb +353 -0
  87. data/spec/ruby-libstorj/ext_spec.rb +75 -0
  88. data/spec/ruby-libstorj/json_request_spec.rb +13 -0
  89. data/spec/ruby-libstorj/libstorj_spec.rb +81 -0
  90. data/spec/ruby-libstorj/struct_spec.rb +64 -0
  91. data/spec/spec_helper.rb +113 -0
  92. metadata +136 -0
@@ -0,0 +1,1836 @@
1
+ {
2
+ "info": {
3
+ "swagger": "2.0",
4
+ "info": {
5
+ "title": "Storj Bridge",
6
+ "version": "2.2.0",
7
+ "description": "Access the Storj network using a simple REST API.",
8
+ "x-protocol-version": "0.10.0",
9
+ "x-core-version": "5.1.1"
10
+ },
11
+ "host": "0.0.0.0",
12
+ "basePath": "/",
13
+ "schemes": [
14
+ "https"
15
+ ],
16
+ "consumes": [
17
+ "application/json"
18
+ ],
19
+ "produces": [
20
+ "application/json"
21
+ ],
22
+ "securityDefinitions": {
23
+ "basic": {
24
+ "type": "basic",
25
+ "description": "Username should equal the registered email address and password must be SHA-256 hash of the cleartext password"
26
+ },
27
+ "ecdsa public key": {
28
+ "type": "apiKey",
29
+ "description": "See: https://github.com/Storj/bridge/blob/master/doc/auth.md",
30
+ "name": "x-pubkey",
31
+ "in": "header"
32
+ },
33
+ "ecdsa signature": {
34
+ "type": "apiKey",
35
+ "description": "See: https://github.com/Storj/bridge/blob/master/doc/auth.md",
36
+ "name": "x-signature",
37
+ "in": "header"
38
+ }
39
+ },
40
+ "tags": [
41
+ {
42
+ "name": "users",
43
+ "description": "User and account management operations"
44
+ },
45
+ {
46
+ "name": "keys",
47
+ "description": "Public key and authentication operations"
48
+ },
49
+ {
50
+ "name": "buckets",
51
+ "description": "Bucket or file operations"
52
+ },
53
+ {
54
+ "name": "frames",
55
+ "description": "File staging operations"
56
+ },
57
+ {
58
+ "name": "contacts",
59
+ "description": "Peer information operations"
60
+ }
61
+ ],
62
+ "paths": {
63
+ "/contacts": {
64
+ "get": {
65
+ "tags": [
66
+ "contacts"
67
+ ],
68
+ "summary": "Lists the contacts according to the supplied query",
69
+ "parameters": [
70
+ {
71
+ "name": "page",
72
+ "in": "query",
73
+ "required": false,
74
+ "type": "string",
75
+ "description": "Paginagtion indicator, defaults to 1"
76
+ },
77
+ {
78
+ "name": "address",
79
+ "in": "query",
80
+ "required": false,
81
+ "type": "string",
82
+ "description": "Hostname or IP address"
83
+ },
84
+ {
85
+ "name": "protocol",
86
+ "in": "query",
87
+ "required": false,
88
+ "type": "string",
89
+ "description": "SemVer protocol tag"
90
+ },
91
+ {
92
+ "name": "userAgent",
93
+ "in": "query",
94
+ "required": false,
95
+ "type": "string",
96
+ "description": "Storj user agent string for farming client"
97
+ },
98
+ {
99
+ "name": "connected",
100
+ "in": "query",
101
+ "required": false,
102
+ "type": "string",
103
+ "description": "Filter results by connection status (true/false)"
104
+ }
105
+ ],
106
+ "responses": {
107
+ "200": {
108
+ "description": "Contacts successfully listed",
109
+ "schema": {
110
+ "type": "array",
111
+ "items": {
112
+ "type": "object",
113
+ "properties": {
114
+ "address": {
115
+ "description": "IP address or hostname of the contact",
116
+ "type": "string",
117
+ "example": "api.storj.io"
118
+ },
119
+ "port": {
120
+ "description": "Port number the contact is listening on",
121
+ "type": "number",
122
+ "example": 8443
123
+ },
124
+ "nodeID": {
125
+ "description": "ECDSA pubkeyhash identifier",
126
+ "type": "string",
127
+ "example": "32033d2dc11b877df4b1caefbffba06495ae6b18"
128
+ },
129
+ "lastSeen": {
130
+ "description": "Timestamp when we last encountered this peer",
131
+ "type": "string",
132
+ "example": "2016-05-24T15:16:01.139Z"
133
+ },
134
+ "protocol": {
135
+ "description": "Protocol version this contact is running",
136
+ "type": "string",
137
+ "example": "0.7.0"
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "/contacts/{nodeID}": {
147
+ "get": {
148
+ "tags": [
149
+ "contacts"
150
+ ],
151
+ "summary": "Performs a lookup for the contact information of a nodeID",
152
+ "parameters": [
153
+ {
154
+ "name": "nodeID",
155
+ "in": "path",
156
+ "type": "string",
157
+ "description": "Node ID of the contact to lookup",
158
+ "required": true
159
+ }
160
+ ],
161
+ "responses": {
162
+ "200": {
163
+ "description": "Contact lookup succeeded",
164
+ "schema": {
165
+ "type": "object",
166
+ "properties": {
167
+ "address": {
168
+ "description": "IP address or hostname of the contact",
169
+ "type": "string",
170
+ "example": "api.storj.io"
171
+ },
172
+ "port": {
173
+ "description": "Port number the contact is listening on",
174
+ "type": "number",
175
+ "example": 8443
176
+ },
177
+ "nodeID": {
178
+ "description": "ECDSA pubkeyhash identifier",
179
+ "type": "string",
180
+ "example": "32033d2dc11b877df4b1caefbffba06495ae6b18"
181
+ },
182
+ "lastSeen": {
183
+ "description": "Timestamp when we last encountered this peer",
184
+ "type": "string",
185
+ "example": "2016-05-24T15:16:01.139Z"
186
+ },
187
+ "protocol": {
188
+ "description": "Protocol version this contact is running",
189
+ "type": "string",
190
+ "example": "0.7.0"
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+ }
197
+ },
198
+ "/users": {
199
+ "post": {
200
+ "tags": [
201
+ "users"
202
+ ],
203
+ "summary": "Registers a new user account with Storj Bridge",
204
+ "parameters": [
205
+ {
206
+ "name": "user",
207
+ "in": "body",
208
+ "required": true,
209
+ "schema": {
210
+ "type": "object",
211
+ "properties": {
212
+ "email": {
213
+ "description": "Email address for account activation and login",
214
+ "type": "string"
215
+ },
216
+ "password": {
217
+ "description": "SHA-256 hash of your plaintext password",
218
+ "type": "string"
219
+ },
220
+ "pubkey": {
221
+ "description": "ECDSA key to initially register",
222
+ "type": "string"
223
+ }
224
+ }
225
+ }
226
+ }
227
+ ],
228
+ "responses": {
229
+ "201": {
230
+ "description": "User successfully registered and activation email sent",
231
+ "schema": {
232
+ "type": "object",
233
+ "properties": {
234
+ "email": {
235
+ "type": "string",
236
+ "example": "gordon@storj.io"
237
+ },
238
+ "created": {
239
+ "type": "string",
240
+ "example": "2016-03-04T17:01:02.629Z"
241
+ },
242
+ "activated": {
243
+ "type": "boolean",
244
+ "example": false
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+ },
252
+ "/users/{email}": {
253
+ "patch": {
254
+ "tags": [
255
+ "users"
256
+ ],
257
+ "summary": "Requests the reset of the account password",
258
+ "parameters": [
259
+ {
260
+ "name": "email",
261
+ "in": "path",
262
+ "type": "string",
263
+ "description": "The email address of the account for password reset (yours)",
264
+ "required": true
265
+ },
266
+ {
267
+ "name": "body",
268
+ "in": "body",
269
+ "required": true,
270
+ "schema": {
271
+ "properties": {
272
+ "password": {
273
+ "type": "string",
274
+ "description": "Hex encoded SHA-256 hash of the desired password"
275
+ },
276
+ "redirect": {
277
+ "type": "string",
278
+ "description": "Optional redirect URL for successful deletion"
279
+ }
280
+ }
281
+ }
282
+ }
283
+ ],
284
+ "responses": {
285
+ "200": {
286
+ "description": "Account password reset email sent",
287
+ "schema": {
288
+ "type": "object",
289
+ "properties": {
290
+ "email": {
291
+ "type": "string",
292
+ "example": "gordon@storj.io"
293
+ },
294
+ "created": {
295
+ "type": "string",
296
+ "example": "2016-03-04T17:01:02.629Z"
297
+ },
298
+ "activated": {
299
+ "type": "boolean",
300
+ "example": true
301
+ }
302
+ }
303
+ }
304
+ }
305
+ }
306
+ },
307
+ "delete": {
308
+ "tags": [
309
+ "users"
310
+ ],
311
+ "summary": "Requests the deletion of the account",
312
+ "parameters": [
313
+ {
314
+ "name": "email",
315
+ "in": "path",
316
+ "type": "string",
317
+ "description": "The email address of the account to delete (yours)",
318
+ "required": true
319
+ },
320
+ {
321
+ "name": "options",
322
+ "in": "body",
323
+ "required": false,
324
+ "schema": {
325
+ "type": "object",
326
+ "properties": {
327
+ "redirect": {
328
+ "description": "Optional redirect URL for successful deletion",
329
+ "type": "string"
330
+ }
331
+ }
332
+ }
333
+ }
334
+ ],
335
+ "responses": {
336
+ "200": {
337
+ "description": "Account deletion email sent",
338
+ "schema": {
339
+ "type": "object",
340
+ "properties": {
341
+ "email": {
342
+ "type": "string",
343
+ "example": "gordon@storj.io"
344
+ },
345
+ "created": {
346
+ "type": "string",
347
+ "example": "2016-03-04T17:01:02.629Z"
348
+ },
349
+ "activated": {
350
+ "type": "boolean",
351
+ "example": true
352
+ }
353
+ }
354
+ }
355
+ }
356
+ }
357
+ }
358
+ },
359
+ "/resets/{token}": {
360
+ "get": {
361
+ "tags": [
362
+ "users"
363
+ ],
364
+ "summary": "Confirms the password reset and optionally redirects",
365
+ "parameters": [
366
+ {
367
+ "name": "token",
368
+ "in": "path",
369
+ "type": "string",
370
+ "description": "Confirmation token sent to user's email address",
371
+ "required": true
372
+ },
373
+ {
374
+ "name": "redirect",
375
+ "in": "query",
376
+ "type": "string",
377
+ "description": "Optional redirect URL for successful confirmation"
378
+ }
379
+ ],
380
+ "responses": {
381
+ "200": {
382
+ "description": "Password successfully reset",
383
+ "schema": {
384
+ "type": "object",
385
+ "properties": {
386
+ "email": {
387
+ "type": "string",
388
+ "example": "gordon@storj.io"
389
+ },
390
+ "created": {
391
+ "type": "string",
392
+ "example": "2016-03-04T17:01:02.629Z"
393
+ },
394
+ "activated": {
395
+ "type": "boolean",
396
+ "example": true
397
+ }
398
+ }
399
+ }
400
+ }
401
+ }
402
+ }
403
+ },
404
+ "/activations/{token}": {
405
+ "post": {
406
+ "tags": [
407
+ "users"
408
+ ],
409
+ "summary": "Sends the user an activation email for reactivating a disabled account",
410
+ "parameters": [
411
+ {
412
+ "name": "token",
413
+ "in": "path",
414
+ "type": "string",
415
+ "description": "Deactivation token sent to user's email address",
416
+ "required": true
417
+ },
418
+ {
419
+ "name": "user",
420
+ "in": "body",
421
+ "required": true,
422
+ "schema": {
423
+ "type": "object",
424
+ "properties": {
425
+ "email": {
426
+ "description": "Email address for account activation and login",
427
+ "type": "string"
428
+ },
429
+ "redirect": {
430
+ "description": "URL for redirect in email confirmation",
431
+ "type": "string"
432
+ }
433
+ }
434
+ }
435
+ }
436
+ ],
437
+ "responses": {
438
+ "201": {
439
+ "description": "User activation email sent",
440
+ "schema": {
441
+ "type": "object",
442
+ "properties": {
443
+ "email": {
444
+ "type": "string",
445
+ "example": "gordon@storj.io"
446
+ },
447
+ "created": {
448
+ "type": "string",
449
+ "example": "2016-03-04T17:01:02.629Z"
450
+ },
451
+ "activated": {
452
+ "type": "boolean",
453
+ "example": false
454
+ }
455
+ }
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "get": {
461
+ "tags": [
462
+ "users"
463
+ ],
464
+ "summary": "Activates a registered user and optionally redirects",
465
+ "parameters": [
466
+ {
467
+ "name": "token",
468
+ "in": "path",
469
+ "type": "string",
470
+ "description": "Activation token sent to user's email address",
471
+ "required": true
472
+ },
473
+ {
474
+ "name": "redirect",
475
+ "in": "query",
476
+ "type": "string",
477
+ "description": "Optional redirect URL for successful activation"
478
+ }
479
+ ],
480
+ "responses": {
481
+ "200": {
482
+ "description": "User successfully activated",
483
+ "schema": {
484
+ "type": "object",
485
+ "properties": {
486
+ "email": {
487
+ "type": "string",
488
+ "example": "gordon@storj.io"
489
+ },
490
+ "created": {
491
+ "type": "string",
492
+ "example": "2016-03-04T17:01:02.629Z"
493
+ },
494
+ "activated": {
495
+ "type": "boolean",
496
+ "example": true
497
+ }
498
+ }
499
+ }
500
+ }
501
+ }
502
+ }
503
+ },
504
+ "/deactivations/{token}": {
505
+ "get": {
506
+ "tags": [
507
+ "users"
508
+ ],
509
+ "summary": "Deactivates a registered user and optionally redirects",
510
+ "parameters": [
511
+ {
512
+ "name": "token",
513
+ "in": "path",
514
+ "type": "string",
515
+ "description": "Deactivation token sent to user's email address",
516
+ "required": true
517
+ },
518
+ {
519
+ "name": "redirect",
520
+ "in": "query",
521
+ "type": "string",
522
+ "description": "Optional redirect URL for successful deactivation"
523
+ }
524
+ ],
525
+ "responses": {
526
+ "200": {
527
+ "description": "User successfully deactivated",
528
+ "schema": {
529
+ "type": "object",
530
+ "properties": {
531
+ "email": {
532
+ "type": "string",
533
+ "example": "gordon@storj.io"
534
+ },
535
+ "created": {
536
+ "type": "string",
537
+ "example": "2016-03-04T17:01:02.629Z"
538
+ },
539
+ "activated": {
540
+ "type": "boolean",
541
+ "example": false
542
+ }
543
+ }
544
+ }
545
+ }
546
+ }
547
+ }
548
+ },
549
+ "/keys": {
550
+ "get": {
551
+ "tags": [
552
+ "keys"
553
+ ],
554
+ "security": [
555
+ {
556
+ "basic": []
557
+ },
558
+ {
559
+ "ecdsa public key": []
560
+ },
561
+ {
562
+ "ecdsa signature": []
563
+ }
564
+ ],
565
+ "summary": "Lists the public ECDSA keys associated with the user",
566
+ "responses": {
567
+ "200": {
568
+ "description": "Keys successfully returned",
569
+ "schema": {
570
+ "type": "array",
571
+ "items": {
572
+ "type": "object",
573
+ "properties": {
574
+ "key": {
575
+ "type": "string",
576
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
577
+ },
578
+ "user": {
579
+ "type": "string",
580
+ "example": "gordon@storj.io"
581
+ }
582
+ }
583
+ }
584
+ }
585
+ }
586
+ }
587
+ },
588
+ "post": {
589
+ "tags": [
590
+ "keys"
591
+ ],
592
+ "security": [
593
+ {
594
+ "basic": []
595
+ },
596
+ {
597
+ "ecdsa public key": []
598
+ },
599
+ {
600
+ "ecdsa signature": []
601
+ }
602
+ ],
603
+ "summary": "Registers a ECDSA public key for the user account",
604
+ "parameters": [
605
+ {
606
+ "name": "key",
607
+ "in": "body",
608
+ "required": true,
609
+ "schema": {
610
+ "type": "object",
611
+ "properties": {
612
+ "key": {
613
+ "description": "Hexidecimal encoded ECDSA public key",
614
+ "type": "string"
615
+ }
616
+ }
617
+ }
618
+ }
619
+ ],
620
+ "responses": {
621
+ "200": {
622
+ "description": "Key successfully registered",
623
+ "schema": {
624
+ "type": "object",
625
+ "properties": {
626
+ "key": {
627
+ "type": "string",
628
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
629
+ },
630
+ "user": {
631
+ "type": "string",
632
+ "example": "gordon@storj.io"
633
+ }
634
+ }
635
+ }
636
+ }
637
+ }
638
+ }
639
+ },
640
+ "/keys/{pubkey}": {
641
+ "delete": {
642
+ "tags": [
643
+ "keys"
644
+ ],
645
+ "security": [
646
+ {
647
+ "basic": []
648
+ },
649
+ {
650
+ "ecdsa public key": []
651
+ },
652
+ {
653
+ "ecdsa signature": []
654
+ }
655
+ ],
656
+ "summary": "Destroys a ECDSA public key for the user account",
657
+ "parameters": [
658
+ {
659
+ "name": "pubkey",
660
+ "in": "path",
661
+ "type": "string",
662
+ "required": true
663
+ }
664
+ ],
665
+ "responses": {
666
+ "204": {
667
+ "description": "Key successfully destroyed"
668
+ }
669
+ }
670
+ }
671
+ },
672
+ "/frames": {
673
+ "get": {
674
+ "tags": [
675
+ "frames"
676
+ ],
677
+ "security": [
678
+ {
679
+ "basic": []
680
+ },
681
+ {
682
+ "ecdsa public key": []
683
+ },
684
+ {
685
+ "ecdsa signature": []
686
+ }
687
+ ],
688
+ "summary": "Returns all of the open file stages for the caller",
689
+ "responses": {
690
+ "200": {
691
+ "description": "Frames successfully returned",
692
+ "schema": {
693
+ "type": "array",
694
+ "items": {
695
+ "type": "object",
696
+ "description": "The list of file staging frames",
697
+ "properties": {
698
+ "created": {
699
+ "type": "string",
700
+ "description": "The date and time the frame was created",
701
+ "example": "2016-03-04T17:01:02.629Z"
702
+ },
703
+ "id": {
704
+ "type": "string",
705
+ "description": "The unique identifier of the frame",
706
+ "example": "507f1f77bcf86cd799439011"
707
+ }
708
+ }
709
+ }
710
+ }
711
+ }
712
+ }
713
+ },
714
+ "post": {
715
+ "tags": [
716
+ "frames"
717
+ ],
718
+ "security": [
719
+ {
720
+ "basic": []
721
+ },
722
+ {
723
+ "ecdsa public key": []
724
+ },
725
+ {
726
+ "ecdsa signature": []
727
+ }
728
+ ],
729
+ "summary": "Creates a new file staging frame",
730
+ "parameters": [],
731
+ "responses": {
732
+ "200": {
733
+ "description": "File staging frame successfully created",
734
+ "schema": {
735
+ "type": "object",
736
+ "properties": {
737
+ "created": {
738
+ "type": "string",
739
+ "description": "The date and time the frame was created",
740
+ "example": "2016-03-04T17:01:02.629Z"
741
+ },
742
+ "id": {
743
+ "type": "string",
744
+ "description": "The unique identifier of the frame",
745
+ "example": "507f1f77bcf86cd799439011"
746
+ }
747
+ }
748
+ }
749
+ }
750
+ }
751
+ }
752
+ },
753
+ "/frames/{frame_id}": {
754
+ "get": {
755
+ "tags": [
756
+ "frames"
757
+ ],
758
+ "security": [
759
+ {
760
+ "basic": []
761
+ },
762
+ {
763
+ "ecdsa public key": []
764
+ },
765
+ {
766
+ "ecdsa signature": []
767
+ }
768
+ ],
769
+ "summary": "Fetches the file staging frame by it's unique ID",
770
+ "parameters": [
771
+ {
772
+ "name": "frame_id",
773
+ "in": "path",
774
+ "type": "string",
775
+ "required": true
776
+ }
777
+ ],
778
+ "responses": {
779
+ "200": {
780
+ "description": "File staging frame successfully returned",
781
+ "schema": {
782
+ "type": "object",
783
+ "properties": {
784
+ "created": {
785
+ "type": "string",
786
+ "description": "The date and time the frame was created",
787
+ "example": "2016-03-04T17:01:02.629Z"
788
+ },
789
+ "id": {
790
+ "type": "string",
791
+ "description": "The unique identifier of the frame",
792
+ "example": "507f1f77bcf86cd799439011"
793
+ },
794
+ "shards": {
795
+ "type": "array",
796
+ "items": {
797
+ "type": "object",
798
+ "description": "Metadata for a shard in the frame",
799
+ "properties": {
800
+ "hash": {
801
+ "type": "string",
802
+ "description": "The RIPEMD-160 SHA-256 hash of the shard",
803
+ "example": "fde400fe0b6a5488e10d7317274a096aaa57914d"
804
+ },
805
+ "size": {
806
+ "type": "number",
807
+ "description": "The number of bytes in the shard",
808
+ "example": 4096
809
+ },
810
+ "index": {
811
+ "type": "number",
812
+ "description": "The order index of the shard in the file",
813
+ "example": 0
814
+ }
815
+ }
816
+ }
817
+ }
818
+ }
819
+ }
820
+ }
821
+ }
822
+ },
823
+ "put": {
824
+ "tags": [
825
+ "frames"
826
+ ],
827
+ "security": [
828
+ {
829
+ "basic": []
830
+ },
831
+ {
832
+ "ecdsa public key": []
833
+ },
834
+ {
835
+ "ecdsa signature": []
836
+ }
837
+ ],
838
+ "summary": "Adds a shard item to the staging frame and negotiates a storage contract",
839
+ "parameters": [
840
+ {
841
+ "name": "frame_id",
842
+ "in": "path",
843
+ "type": "string",
844
+ "required": true
845
+ },
846
+ {
847
+ "name": "shard",
848
+ "in": "body",
849
+ "required": true,
850
+ "schema": {
851
+ "type": "object",
852
+ "properties": {
853
+ "hash": {
854
+ "type": "string",
855
+ "description": "The RIPEMD-160 SHA-256 hash of the shard",
856
+ "example": "fde400fe0b6a5488e10d7317274a096aaa57914d"
857
+ },
858
+ "size": {
859
+ "type": "number",
860
+ "description": "The number of bytes in the shard",
861
+ "example": 4096
862
+ },
863
+ "index": {
864
+ "type": "number",
865
+ "description": "The order index of the shard in the file",
866
+ "example": 0
867
+ },
868
+ "challenges": {
869
+ "type": "array",
870
+ "description": "Series of audit challenges",
871
+ "items": {
872
+ "type": "string",
873
+ "example": "2128bc38ed5140bb9ba8ddac16183eecc4c9ef63b0cd46b30f49b578737a7a52"
874
+ }
875
+ },
876
+ "tree": {
877
+ "type": "array",
878
+ "description": "The bottom leaves of the audit merkle tree",
879
+ "items": {
880
+ "type": "string",
881
+ "example": "507f1f77bcf86cd799439011"
882
+ }
883
+ },
884
+ "exclude": {
885
+ "type": "array",
886
+ "description": "Farmer node IDs to blacklist from offers",
887
+ "items": {
888
+ "type": "string",
889
+ "example": "def400fe0b6a5488e10d7317274a096aaa57914d"
890
+ }
891
+ }
892
+ }
893
+ }
894
+ }
895
+ ],
896
+ "responses": {
897
+ "200": {
898
+ "description": "The shard was successfully added and contract negotiated",
899
+ "schema": {
900
+ "type": "object",
901
+ "properties": {
902
+ "token": {
903
+ "type": "string",
904
+ "description": "The datachannel token for authorizing transfer to the farmer",
905
+ "example": "032130ba09cbac408d48a60a190c65b592b59853"
906
+ },
907
+ "hash": {
908
+ "type": "string",
909
+ "description": "The shard's RIPEMD-160 SHA-256 hash",
910
+ "example": "fde400fe0b6a5488e10d7317274a096aaa57914d"
911
+ },
912
+ "operation": {
913
+ "type": "string",
914
+ "description": "The operation type (PUSH or PULL)",
915
+ "example": "PUSH"
916
+ },
917
+ "channel": {
918
+ "type": "string",
919
+ "description": "The farmer datachannel URI for storing the shard",
920
+ "example": "ws://farmer.hostname:1337"
921
+ }
922
+ }
923
+ }
924
+ }
925
+ }
926
+ },
927
+ "delete": {
928
+ "tags": [
929
+ "frames"
930
+ ],
931
+ "security": [
932
+ {
933
+ "basic": []
934
+ },
935
+ {
936
+ "ecdsa public key": []
937
+ },
938
+ {
939
+ "ecdsa signature": []
940
+ }
941
+ ],
942
+ "summary": "Destroys the file staging frame by it's unique ID",
943
+ "parameters": [
944
+ {
945
+ "name": "frame_id",
946
+ "in": "path",
947
+ "type": "string",
948
+ "required": true
949
+ }
950
+ ],
951
+ "responses": {
952
+ "204": {
953
+ "description": "File staging frame successfully destroyed",
954
+ "schema": {}
955
+ }
956
+ }
957
+ }
958
+ },
959
+ "/buckets/{id}/mirrors": {
960
+ "post": {
961
+ "tags": [
962
+ "buckets"
963
+ ],
964
+ "security": [
965
+ {
966
+ "basic": []
967
+ },
968
+ {
969
+ "ecdsa public key": []
970
+ },
971
+ {
972
+ "ecdsa signature": []
973
+ }
974
+ ],
975
+ "summary": "Establishes a series of mirrors for the given file",
976
+ "parameters": [
977
+ {
978
+ "name": "id",
979
+ "in": "path",
980
+ "type": "string",
981
+ "required": true
982
+ },
983
+ {
984
+ "name": "replicas",
985
+ "in": "body",
986
+ "required": true,
987
+ "schema": {
988
+ "type": "object",
989
+ "properties": {
990
+ "file": {
991
+ "type": "string",
992
+ "description": "The unique file ID",
993
+ "example": "507f1f77bcf86cd799439011"
994
+ },
995
+ "redundancy": {
996
+ "type": "number",
997
+ "description": "The number of mirrors requested",
998
+ "example": 3
999
+ }
1000
+ }
1001
+ }
1002
+ }
1003
+ ],
1004
+ "responses": {
1005
+ "200": {
1006
+ "description": "The shard was successfully added and contract negotiated",
1007
+ "schema": {
1008
+ "type": "object",
1009
+ "properties": {
1010
+ "hash": {
1011
+ "type": "string",
1012
+ "description": "The shard's RIPEMD-160 SHA-256 hash",
1013
+ "example": "fde400fe0b6a5488e10d7317274a096aaa57914d"
1014
+ },
1015
+ "mirrors": {
1016
+ "type": "number",
1017
+ "description": "The number of requested mirrors",
1018
+ "example": 3
1019
+ },
1020
+ "status": {
1021
+ "type": "string",
1022
+ "description": "The operation status",
1023
+ "example": "pending"
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ },
1031
+ "/buckets": {
1032
+ "get": {
1033
+ "tags": [
1034
+ "buckets"
1035
+ ],
1036
+ "security": [
1037
+ {
1038
+ "basic": []
1039
+ },
1040
+ {
1041
+ "ecdsa public key": []
1042
+ },
1043
+ {
1044
+ "ecdsa signature": []
1045
+ }
1046
+ ],
1047
+ "summary": "Lists all of the buckets belonging to the user",
1048
+ "responses": {
1049
+ "200": {
1050
+ "description": "Buckets successfully returned",
1051
+ "schema": {
1052
+ "type": "array",
1053
+ "items": {
1054
+ "type": "object",
1055
+ "properties": {
1056
+ "storage": {
1057
+ "type": "number",
1058
+ "description": "Amount of storage space in GB",
1059
+ "example": 10
1060
+ },
1061
+ "transfer": {
1062
+ "type": "number",
1063
+ "description": "Amount of transfer in GB",
1064
+ "example": 30
1065
+ },
1066
+ "status": {
1067
+ "type": "string",
1068
+ "description": "State of the bucket",
1069
+ "example": "Active"
1070
+ },
1071
+ "pubkeys": {
1072
+ "type": "array",
1073
+ "items": {
1074
+ "type": "string",
1075
+ "description": "Public ECDSA keys associated with the bucket",
1076
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
1077
+ }
1078
+ },
1079
+ "user": {
1080
+ "type": "string",
1081
+ "description": "User account to which the bucket belongs",
1082
+ "example": "gordon@storj.io"
1083
+ },
1084
+ "name": {
1085
+ "type": "string",
1086
+ "description": "Name of the bucket",
1087
+ "default": "New Bucket"
1088
+ },
1089
+ "created": {
1090
+ "type": "string",
1091
+ "description": "The date and time the bucket was created",
1092
+ "example": "2016-03-04T17:01:02.629Z"
1093
+ },
1094
+ "id": {
1095
+ "type": "string",
1096
+ "description": "Unique ID for the bucket",
1097
+ "example": "507f1f77bcf86cd799439011"
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+ }
1103
+ }
1104
+ },
1105
+ "post": {
1106
+ "tags": [
1107
+ "buckets"
1108
+ ],
1109
+ "security": [
1110
+ {
1111
+ "basic": []
1112
+ },
1113
+ {
1114
+ "ecdsa public key": []
1115
+ },
1116
+ {
1117
+ "ecdsa signature": []
1118
+ }
1119
+ ],
1120
+ "summary": "Creates a new bucket with the given parameters",
1121
+ "parameters": [
1122
+ {
1123
+ "name": "bucket",
1124
+ "in": "body",
1125
+ "required": true,
1126
+ "schema": {
1127
+ "type": "object",
1128
+ "properties": {
1129
+ "pubkeys": {
1130
+ "type": "array",
1131
+ "items": {
1132
+ "type": "string",
1133
+ "description": "Public ECDSA keys associated with the bucket",
1134
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
1135
+ }
1136
+ },
1137
+ "name": {
1138
+ "type": "string",
1139
+ "description": "Name of the bucket",
1140
+ "default": "New Bucket"
1141
+ }
1142
+ }
1143
+ }
1144
+ }
1145
+ ],
1146
+ "responses": {
1147
+ "201": {
1148
+ "description": "Bucket successfully created",
1149
+ "schema": {
1150
+ "type": "object",
1151
+ "properties": {
1152
+ "storage": {
1153
+ "type": "number",
1154
+ "description": "Amount of storage space in GB",
1155
+ "example": 10
1156
+ },
1157
+ "transfer": {
1158
+ "type": "number",
1159
+ "description": "Amount of transfer in GB",
1160
+ "example": 30
1161
+ },
1162
+ "status": {
1163
+ "type": "string",
1164
+ "description": "State of the bucket",
1165
+ "example": "Active"
1166
+ },
1167
+ "pubkeys": {
1168
+ "type": "array",
1169
+ "items": {
1170
+ "type": "string",
1171
+ "description": "Public ECDSA keys associated with the bucket",
1172
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
1173
+ }
1174
+ },
1175
+ "user": {
1176
+ "type": "string",
1177
+ "description": "User account to which the bucket belongs",
1178
+ "example": "gordon@storj.io"
1179
+ },
1180
+ "name": {
1181
+ "type": "string",
1182
+ "description": "Name of the bucket",
1183
+ "default": "New Bucket"
1184
+ },
1185
+ "created": {
1186
+ "type": "string",
1187
+ "description": "The date and time the bucket was created",
1188
+ "example": "2016-03-04T17:01:02.629Z"
1189
+ },
1190
+ "id": {
1191
+ "type": "string",
1192
+ "description": "Unique ID for the bucket",
1193
+ "example": "507f1f77bcf86cd799439011"
1194
+ }
1195
+ }
1196
+ }
1197
+ }
1198
+ }
1199
+ }
1200
+ },
1201
+ "/buckets/{id}": {
1202
+ "get": {
1203
+ "tags": [
1204
+ "buckets"
1205
+ ],
1206
+ "security": [
1207
+ {
1208
+ "basic": []
1209
+ },
1210
+ {
1211
+ "ecdsa public key": []
1212
+ },
1213
+ {
1214
+ "ecdsa signature": []
1215
+ }
1216
+ ],
1217
+ "summary": "Returns the bucket object by the given ID",
1218
+ "parameters": [
1219
+ {
1220
+ "name": "id",
1221
+ "type": "string",
1222
+ "in": "path",
1223
+ "description": "Unique ID of the bucket to retrieve",
1224
+ "required": true
1225
+ }
1226
+ ],
1227
+ "responses": {
1228
+ "200": {
1229
+ "description": "Bucket successfully returned",
1230
+ "schema": {
1231
+ "type": "object",
1232
+ "properties": {
1233
+ "storage": {
1234
+ "type": "number",
1235
+ "description": "Amount of storage space in GB",
1236
+ "example": 30
1237
+ },
1238
+ "transfer": {
1239
+ "type": "number",
1240
+ "description": "Amount of transfer in GB",
1241
+ "example": 50
1242
+ },
1243
+ "status": {
1244
+ "type": "string",
1245
+ "description": "State of the bucket",
1246
+ "example": "Active"
1247
+ },
1248
+ "pubkeys": {
1249
+ "type": "array",
1250
+ "items": {
1251
+ "type": "string",
1252
+ "description": "Public ECDSA keys associated with the bucket",
1253
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
1254
+ }
1255
+ },
1256
+ "user": {
1257
+ "type": "string",
1258
+ "description": "User account to which the bucket belongs",
1259
+ "example": "gordon@storj.io"
1260
+ },
1261
+ "name": {
1262
+ "type": "string",
1263
+ "description": "Name of the bucket",
1264
+ "default": "New Bucket"
1265
+ },
1266
+ "created": {
1267
+ "type": "string",
1268
+ "description": "The date and time the bucket was created",
1269
+ "example": "2016-03-04T17:01:02.629Z"
1270
+ },
1271
+ "id": {
1272
+ "type": "string",
1273
+ "description": "Unique ID for the bucket",
1274
+ "example": "507f1f77bcf86cd799439011"
1275
+ }
1276
+ }
1277
+ }
1278
+ }
1279
+ }
1280
+ },
1281
+ "patch": {
1282
+ "tags": [
1283
+ "buckets"
1284
+ ],
1285
+ "security": [
1286
+ {
1287
+ "basic": []
1288
+ },
1289
+ {
1290
+ "ecdsa public key": []
1291
+ },
1292
+ {
1293
+ "ecdsa signature": []
1294
+ }
1295
+ ],
1296
+ "summary": "Updates the bucket with the given properties",
1297
+ "parameters": [
1298
+ {
1299
+ "name": "id",
1300
+ "type": "string",
1301
+ "in": "path",
1302
+ "description": "Unique ID of the bucket to update",
1303
+ "required": true
1304
+ },
1305
+ {
1306
+ "name": "bucket",
1307
+ "in": "body",
1308
+ "schema": {
1309
+ "type": "object",
1310
+ "properties": {
1311
+ "pubkeys": {
1312
+ "type": "array",
1313
+ "items": {
1314
+ "type": "string",
1315
+ "description": "Public ECDSA keys associated with the bucket",
1316
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
1317
+ }
1318
+ },
1319
+ "name": {
1320
+ "type": "string",
1321
+ "description": "Name of the bucket",
1322
+ "default": "New Bucket"
1323
+ }
1324
+ }
1325
+ }
1326
+ }
1327
+ ],
1328
+ "responses": {
1329
+ "200": {
1330
+ "description": "Bucket successfully updated",
1331
+ "schema": {
1332
+ "type": "object",
1333
+ "properties": {
1334
+ "storage": {
1335
+ "type": "number",
1336
+ "description": "Amount of storage space in GB",
1337
+ "example": 30
1338
+ },
1339
+ "transfer": {
1340
+ "type": "number",
1341
+ "description": "Amount of transfer in GB",
1342
+ "example": 50
1343
+ },
1344
+ "status": {
1345
+ "type": "string",
1346
+ "description": "State of the bucket",
1347
+ "example": "Active"
1348
+ },
1349
+ "pubkeys": {
1350
+ "type": "array",
1351
+ "items": {
1352
+ "type": "string",
1353
+ "description": "Public ECDSA keys associated with the bucket",
1354
+ "example": "031a259ee122414f57a63bbd6887ee17960e9106b0adcf89a298cdad2108adf4d9"
1355
+ }
1356
+ },
1357
+ "user": {
1358
+ "type": "string",
1359
+ "description": "User account to which the bucket belongs",
1360
+ "example": "gordon@storj.io"
1361
+ },
1362
+ "name": {
1363
+ "type": "string",
1364
+ "description": "Name of the bucket",
1365
+ "default": "New Bucket"
1366
+ },
1367
+ "created": {
1368
+ "type": "string",
1369
+ "description": "The date and time the bucket was created",
1370
+ "example": "2016-03-04T17:01:02.629Z"
1371
+ },
1372
+ "id": {
1373
+ "type": "string",
1374
+ "description": "Unique ID for the bucket",
1375
+ "example": "507f1f77bcf86cd799439011"
1376
+ }
1377
+ }
1378
+ }
1379
+ }
1380
+ }
1381
+ },
1382
+ "delete": {
1383
+ "tags": [
1384
+ "buckets"
1385
+ ],
1386
+ "security": [
1387
+ {
1388
+ "basic": []
1389
+ },
1390
+ {
1391
+ "ecdsa public key": []
1392
+ },
1393
+ {
1394
+ "ecdsa signature": []
1395
+ }
1396
+ ],
1397
+ "summary": "Destroys the bucket with the given ID",
1398
+ "parameters": [
1399
+ {
1400
+ "name": "id",
1401
+ "type": "string",
1402
+ "in": "path",
1403
+ "required": true,
1404
+ "description": "Unique ID of the bucket to destroy"
1405
+ }
1406
+ ],
1407
+ "responses": {
1408
+ "204": {
1409
+ "description": "Bucket successfully destroyed"
1410
+ }
1411
+ }
1412
+ }
1413
+ },
1414
+ "/buckets/{id}/tokens": {
1415
+ "post": {
1416
+ "tags": [
1417
+ "buckets"
1418
+ ],
1419
+ "security": [
1420
+ {
1421
+ "basic": []
1422
+ },
1423
+ {
1424
+ "ecdsa public key": []
1425
+ },
1426
+ {
1427
+ "ecdsa signature": []
1428
+ }
1429
+ ],
1430
+ "summary": "Creates a token for the specified operation",
1431
+ "parameters": [
1432
+ {
1433
+ "name": "id",
1434
+ "type": "string",
1435
+ "in": "path",
1436
+ "description": "Unique ID of the bucket for the desired token",
1437
+ "required": true
1438
+ },
1439
+ {
1440
+ "name": "operation",
1441
+ "in": "body",
1442
+ "schema": {
1443
+ "type": "object",
1444
+ "properties": {
1445
+ "operation": {
1446
+ "type": "string",
1447
+ "description": "PUSH or PULL operation"
1448
+ }
1449
+ }
1450
+ }
1451
+ }
1452
+ ],
1453
+ "responses": {
1454
+ "201": {
1455
+ "description": "Token successfully created",
1456
+ "schema": {
1457
+ "type": "object",
1458
+ "properties": {
1459
+ "token": {
1460
+ "type": "string",
1461
+ "description": "The unique one-time-use token"
1462
+ },
1463
+ "bucket": {
1464
+ "type": "string",
1465
+ "description": "The bucket ID the token is for"
1466
+ },
1467
+ "expires": {
1468
+ "type": "string",
1469
+ "description": "The time the token will expire"
1470
+ },
1471
+ "operation": {
1472
+ "type": "string",
1473
+ "description": "The operation the token is for"
1474
+ },
1475
+ "encryptionKey": {
1476
+ "type": "string",
1477
+ "description": "Bucket encryption key if the bucket is public"
1478
+ }
1479
+ }
1480
+ }
1481
+ }
1482
+ }
1483
+ }
1484
+ },
1485
+ "/buckets/{id}/files": {
1486
+ "post": {
1487
+ "consumes": [
1488
+ "application/json"
1489
+ ],
1490
+ "tags": [
1491
+ "buckets"
1492
+ ],
1493
+ "security": [
1494
+ {
1495
+ "basic": []
1496
+ },
1497
+ {
1498
+ "ecdsa public key": []
1499
+ },
1500
+ {
1501
+ "ecdsa signature": []
1502
+ }
1503
+ ],
1504
+ "summary": "Store a file in the Storj network through Storj Bridge",
1505
+ "parameters": [
1506
+ {
1507
+ "type": "string",
1508
+ "in": "path",
1509
+ "name": "id",
1510
+ "description": "The unique bucket ID for the request",
1511
+ "required": true
1512
+ },
1513
+ {
1514
+ "in": "body",
1515
+ "name": "file",
1516
+ "description": "File object metadata to add to bucket",
1517
+ "required": true,
1518
+ "schema": {
1519
+ "type": "object",
1520
+ "properties": {
1521
+ "frame": {
1522
+ "type": "string",
1523
+ "description": "The unique frame ID to create file object from",
1524
+ "example": "507f1f77bcf86cd799439012"
1525
+ },
1526
+ "mimetype": {
1527
+ "type": "string",
1528
+ "description": "A valid mimetype for the file",
1529
+ "example": "video/mpeg"
1530
+ },
1531
+ "filename": {
1532
+ "type": "string",
1533
+ "description": "A file name to show in the bucket",
1534
+ "example": "big_buck_bunny.mp4"
1535
+ }
1536
+ }
1537
+ }
1538
+ }
1539
+ ],
1540
+ "responses": {
1541
+ "200": {
1542
+ "description": "File successfully created",
1543
+ "schema": {
1544
+ "type": "object",
1545
+ "properties": {
1546
+ "id": {
1547
+ "type": "string",
1548
+ "example": "507f1f77bcf86cd799439012"
1549
+ },
1550
+ "bucket": {
1551
+ "type": "string",
1552
+ "example": "507f1f77bcf86cd799439011"
1553
+ },
1554
+ "mimetype": {
1555
+ "type": "string",
1556
+ "example": "video/mpeg"
1557
+ },
1558
+ "filename": {
1559
+ "type": "string",
1560
+ "example": "big_buck_bunny.mp4"
1561
+ },
1562
+ "size": {
1563
+ "type": "number",
1564
+ "example": 5071076
1565
+ }
1566
+ }
1567
+ }
1568
+ }
1569
+ }
1570
+ },
1571
+ "get": {
1572
+ "tags": [
1573
+ "buckets"
1574
+ ],
1575
+ "security": [
1576
+ {
1577
+ "basic": []
1578
+ },
1579
+ {
1580
+ "ecdsa public key": []
1581
+ },
1582
+ {
1583
+ "ecdsa signature": []
1584
+ }
1585
+ ],
1586
+ "summary": "List the all the file metadata stored in the bucket",
1587
+ "parameters": [
1588
+ {
1589
+ "type": "string",
1590
+ "in": "path",
1591
+ "name": "id",
1592
+ "description": "The unique bucket ID for the request",
1593
+ "required": true
1594
+ }
1595
+ ],
1596
+ "responses": {
1597
+ "200": {
1598
+ "description": "Buckets successfully returned",
1599
+ "schema": {
1600
+ "type": "array",
1601
+ "items": {
1602
+ "type": "object",
1603
+ "properties": {
1604
+ "hash": {
1605
+ "type": "string",
1606
+ "example": "9c1185a5c5e9fc54612808977ee8f548b2258d31"
1607
+ },
1608
+ "bucket": {
1609
+ "type": "string",
1610
+ "example": "507f1f77bcf86cd799439011"
1611
+ },
1612
+ "mimetype": {
1613
+ "type": "string",
1614
+ "example": "video/mpeg"
1615
+ },
1616
+ "filename": {
1617
+ "type": "string",
1618
+ "example": "big_buck_bunny.mp4"
1619
+ },
1620
+ "size": {
1621
+ "type": "number",
1622
+ "example": 5071076
1623
+ }
1624
+ }
1625
+ }
1626
+ }
1627
+ }
1628
+ }
1629
+ }
1630
+ },
1631
+ "/buckets/{id}/files/{file_id}": {
1632
+ "get": {
1633
+ "tags": [
1634
+ "buckets"
1635
+ ],
1636
+ "security": [
1637
+ {
1638
+ "basic": []
1639
+ },
1640
+ {
1641
+ "ecdsa public key": []
1642
+ },
1643
+ {
1644
+ "ecdsa signature": []
1645
+ }
1646
+ ],
1647
+ "summary": "Retrieve a series of file pointers for retrieval of file from the Storj network",
1648
+ "parameters": [
1649
+ {
1650
+ "type": "string",
1651
+ "in": "path",
1652
+ "name": "id",
1653
+ "description": "The unique bucket ID for the request",
1654
+ "required": true
1655
+ },
1656
+ {
1657
+ "type": "string",
1658
+ "in": "path",
1659
+ "name": "file_id",
1660
+ "description": "The file ID to get pointers for",
1661
+ "required": true
1662
+ },
1663
+ {
1664
+ "type": "string",
1665
+ "in": "query",
1666
+ "name": "skip",
1667
+ "description": "The pointer index to start the file slice",
1668
+ "required": true
1669
+ },
1670
+ {
1671
+ "type": "string",
1672
+ "in": "query",
1673
+ "name": "limit",
1674
+ "description": "The number of pointers to resolve tokens for",
1675
+ "required": true
1676
+ },
1677
+ {
1678
+ "type": "string",
1679
+ "in": "query",
1680
+ "name": "exclude",
1681
+ "description": "Comma separated list of farmer nodeIDs to exclude from token retrieval",
1682
+ "required": false
1683
+ },
1684
+ {
1685
+ "type": "string",
1686
+ "in": "header",
1687
+ "name": "x-token",
1688
+ "description": "A valid PULL token for this bucket",
1689
+ "required": true
1690
+ }
1691
+ ],
1692
+ "responses": {
1693
+ "200": {
1694
+ "description": "File pointers successfully returned",
1695
+ "schema": {
1696
+ "type": "array",
1697
+ "items": {
1698
+ "type": "object",
1699
+ "properties": {
1700
+ "hash": {
1701
+ "type": "string",
1702
+ "example": "ba084d3f143f2896809d3f1d7dffed472b39d8de",
1703
+ "description": "The hash of the file to retrieve"
1704
+ },
1705
+ "token": {
1706
+ "type": "string",
1707
+ "example": "99cf1af00b552113a856f8ef44f58d22269389e8009d292bafd10af7cc30dcfa",
1708
+ "description": "The token the farmer expects for this operation"
1709
+ },
1710
+ "operation": {
1711
+ "type": "string",
1712
+ "example": "PULL",
1713
+ "description": "The operation type (PUSH or PULL)"
1714
+ },
1715
+ "channel": {
1716
+ "type": "string",
1717
+ "example": "ws://farmer.hostname:4000",
1718
+ "description": "The farmer's websocket URL for data channel"
1719
+ }
1720
+ }
1721
+ }
1722
+ }
1723
+ }
1724
+ }
1725
+ },
1726
+ "delete": {
1727
+ "tags": [
1728
+ "buckets"
1729
+ ],
1730
+ "security": [
1731
+ {
1732
+ "basic": []
1733
+ },
1734
+ {
1735
+ "ecdsa public key": []
1736
+ },
1737
+ {
1738
+ "ecdsa signature": []
1739
+ }
1740
+ ],
1741
+ "summary": "Destroy the file pointer from the bucket and allow data to expire in network",
1742
+ "parameters": [
1743
+ {
1744
+ "type": "string",
1745
+ "in": "path",
1746
+ "name": "id",
1747
+ "description": "The unique bucket ID for the request",
1748
+ "required": true
1749
+ },
1750
+ {
1751
+ "type": "string",
1752
+ "in": "path",
1753
+ "name": "file_id",
1754
+ "description": "The file ID to destroy pointers",
1755
+ "required": true
1756
+ }
1757
+ ],
1758
+ "responses": {
1759
+ "204": {
1760
+ "description": "File pointers successfully destroyed"
1761
+ }
1762
+ }
1763
+ }
1764
+ },
1765
+ "/buckets/{id}/files/{file_id}/info": {
1766
+ "get": {
1767
+ "tags": [
1768
+ "buckets"
1769
+ ],
1770
+ "security": [
1771
+ {
1772
+ "basic": []
1773
+ },
1774
+ {
1775
+ "ecdsa public key": []
1776
+ },
1777
+ {
1778
+ "ecdsa signature": []
1779
+ }
1780
+ ],
1781
+ "summary": "Get metadata about a file",
1782
+ "parameters": [
1783
+ {
1784
+ "type": "string",
1785
+ "in": "path",
1786
+ "name": "id",
1787
+ "description": "The unique bucket ID for the request",
1788
+ "required": true
1789
+ },
1790
+ {
1791
+ "type": "string",
1792
+ "in": "path",
1793
+ "name": "file_id",
1794
+ "description": "The file ID to get pointers for",
1795
+ "required": true
1796
+ }
1797
+ ],
1798
+ "responses": {
1799
+ "200": {
1800
+ "description": "File metadata successfully retrieved",
1801
+ "schema": {
1802
+ "type": "object",
1803
+ "properties": {
1804
+ "bucket": {
1805
+ "type": "string",
1806
+ "example": "507f1f77bcf86cd799439011"
1807
+ },
1808
+ "mimetype": {
1809
+ "type": "string",
1810
+ "example": "video/mpeg"
1811
+ },
1812
+ "filename": {
1813
+ "type": "string",
1814
+ "example": "big_buck_bunny.mp4"
1815
+ },
1816
+ "frame": {
1817
+ "type": "string",
1818
+ "example": "507f1f77bcf86cd799439191"
1819
+ },
1820
+ "id": {
1821
+ "type": "string",
1822
+ "example": "507f1f77bcf86cd799430909"
1823
+ },
1824
+ "size": {
1825
+ "type": "number",
1826
+ "example": 5071076
1827
+ }
1828
+ }
1829
+ }
1830
+ }
1831
+ }
1832
+ }
1833
+ }
1834
+ }
1835
+ }
1836
+ }