-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspec.yaml
271 lines (269 loc) · 9.53 KB
/
spec.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
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
openapi: 3.0.0
info:
version: 1.0.0
title: Restful DCP API Documentation
servers:
- url: https://dcp-rest.diana.distributive.network/api/v0/
- url: http://localhost:1234/api/v0/
paths:
/job:
post:
summary: Job - Deploy
description: Deploys a job to the DCP scheduler for computation. Only required fields are <work> and <account>. Currently supported Worktimes are map-basic and pyodide, but more are coming soon!
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
work:
type: object
properties:
runtime:
type: object
description: The Worktime specified for the job to execute in (for example Pyodide)
properties:
name:
type: string
version:
type: string
custom:
type: boolean
required:
- name
function:
type: string
required:
- runtime
- function
account:
type: object
properties:
address:
type: string
description: Oauth-Identity flow-> Portal Payment Account Address
label:
type: string
description: Oauth-Identity flow-> Portal Payment Account Name
json:
type: string
description: Non Oauth-Identity flow-> An arbitrary payment account keystore
password:
type: string
slices:
oneOf:
- type: array
items:
type: object
additionalProperties: true
- type: object
properties:
remoteDataSet:
type: array
items:
type: string
args:
type: array
items:
type: string
description: extra parameters to pass to the workfunction's arguments. Added to the end of the arguments to call the work function
computeGroups:
type: array
items:
type: object
properties:
joinKey:
type: string
joinSecret:
type: string
slicePaymentOffer:
type: string
description: which is a decimal number or MARKET_VALUE
requirements:
type: object
description: An object that describes the requirements a worker must have to be eligible for the job.
packages:
type: array
items:
type: string
description: list of packages to use for this job
public:
type: object
properties:
name:
type: string
description:
type: string
link:
type: string
responses:
201:
description: The job has been created. This will return a JobId handle for other requests
content:
application/json:
schema:
type: object
properties:
jobId:
type: string
400:
description: Bad request. Invalid input or missing required properties.
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: A detailed error message.
401:
description: Unauthorized. Missing or invalid authentication token.
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: A detailed error message.
403:
description: Forbidden. You do not have permission to access this resource.
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: A detailed error message.
500:
description: An error occurred on the server.
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: A detailed error message.
/job/{jobId}/slices:
post:
summary: Job - Add Slices
description: Adds slices to a running job.
responses:
201:
description: Successfully added slices.
'404':
description: Job not found.
/job/{jobId}/result:
get:
summary: Job - Results
description: Retrieves the results that have been completed so far.
parameters:
- in: query
name: range
schema:
type: string
description: (Optional). Inclusive range from m to n. For example `?range=1-10&range=15-17` would attempt to fetch the values [1,10] ∪ [15,17]. If no range is specified, it attempts to fetch all slices.
responses:
200:
description: Successfully retrieved job result.
content:
application/json:
schema:
type: object
properties:
results:
type: array
items:
type: object
properties:
sliceNumber:
type: integer
value:
type: object
totalSlices:
type: integer
completedSlices:
type: integer
activeSlices:
type: integer
'404':
description: Job not found.
/job/{jobId}:
get:
summary: Job - Status
description: Retrieves the status of a specific job.
responses:
'200':
description: Successfully retrieved job status.
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Current status of the job. (estimation, running, cancelled, corrupted, paused, completed).
totalSlices:
type: number
description: Total slices deployed so far.
activeSlices:
type: number
description: Current slices active.
completedSlices:
type: number
description: Slices completed so far.
totalCPUTime:
type: number
description: TODO
totalGPUTime:
type: number
description: TODO
'404':
description: Job not found.
delete:
summary: Job - Cancel
description: Cancels a running job, no more slices will be computed
responses:
204:
description: Successfully cancelled job.
'404':
description: Job not found.
/accounts:
get:
summary: User - List Bank Accounts
description: Retrieves a list of bank accounts associated with the user.
responses:
'200':
description: Successfully retrieved bank accounts.
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Name given to the banka ccount.
address:
type: string
description: Hex address for the bank account, use this when deploying jobs.
balance:
type: string
description: The current balance in DCCs.
'404':
description: No user found.
components:
securitySchemes:
bearerAuth:
type: http
description: "Use your dcp-rest api token"
scheme: Bearer <dcp-rest api token>
basicAuth:
type: http
scheme: Basic <idkeystore:idkeystorepassword>
description: "Create a header consisting of an id keystore and the password to it. Encode that in base 64 and prepend it with `Basic `. For example: `Basic ${btoa('idKeystoreJSON' + ':' + 'idKeystorePassword'}`. This lets you use any id keystore you want to make requests to supported dcp-rest endpoints."
security:
- bearerAuth: []
- basicAuth: []