This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
164 lines (164 loc) · 5.45 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
openapi: 3.0.3
info:
title: Motion Data Storage and Retrieval API
description: This is the API for exchanging data with Filecoin network via Motion.
version: 0.0.0
servers:
- url: 'http://localhost:40080'
paths:
/v0/blob:
post:
summary: 'Uploads data to the server.'
description: 'This endpoint allows data blob to be uploaded to the server.'
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'201':
description: 'Data successfully created.'
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: 'Unique, opaque identifier for the created data blob.'
examples:
default:
value:
id: 'unique-blob-id'
'500':
description: 'An internal server error occurred.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'503':
description: 'Service temporarily unavailable. Please try again later.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
/v0/blob/{id}:
get:
summary: 'Retrieves blob by ID.'
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: 'Data successfully retrieved.'
content:
application/octet-stream:
schema:
type: string
format: binary
'404':
description: 'No blob found for the given ID.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'500':
description: 'An internal server error occurred.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'503':
description: 'Service temporarily unavailable. Please try again later.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
/v0/blob/{id}/status:
get:
summary: 'Gets the status of blob for a given ID.'
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: 'Data status successfully retrieved.'
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: 'ID associated with the blob.'
replicas:
type: array
items:
type: object
properties:
provider:
type: string
description: 'ID of the Filecoin storage provider.'
pieces:
type: array
items:
type: object
properties:
expiration:
type: string
format: date-time
description: 'Expiration time of the blob storage. Follows the RFC 3339 format.'
lastVerified:
type: string
format: date-time
description: 'Last verification time of the replica. Follows the RFC 3339 format.'
pieceCid:
type: string
description: 'Piece CID identifying this piece.'
status:
type: string
description: 'Status of this replica. Can be "active", "slashed" or "expired".'
examples:
default:
value:
id: 'unique-blob-id'
replica:
provider: 'f0xxxx'
pieces:
- expiration: '2023-06-29T00:00:00Z'
lastVerified: '2023-05-29T00:00:00Z'
pieceCid: 'baguqexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
status: 'active'
'404':
description: 'No status found for the given ID.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'500':
description: 'An internal server error occurred.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'503':
description: 'Service temporarily unavailable. Please try again later.'
content:
application/json:
schema:
$ref: '#/components/schemas/error'
components:
schemas:
error:
type: object
properties:
error:
type: string