forked from Joystream/joystream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoperator.yml
119 lines (116 loc) · 3.07 KB
/
operator.yml
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
openapi: 3.0.3
info:
title: Distributor node operator API
description: Distributor node operator API
contact:
email: [email protected]
license:
name: GPL-3.0-only
url: https://spdx.org/licenses/GPL-3.0-only.html
version: 0.1.0
servers:
- url: http://localhost:3335/api/v1/
paths:
/stop-api:
post:
operationId: operator.stopApi
description: Turns off the public api.
responses:
200:
description: OK
401:
description: Not authorized
409:
description: Already stopped
500:
description: Unexpected server error
/start-api:
post:
operationId: operator.startApi
description: Turns on the public api.
responses:
200:
description: OK
401:
description: Not authorized
409:
description: Already started
500:
description: Unexpected server error
/shutdown:
post:
operationId: operator.shutdown
description: Shuts down the node.
responses:
200:
description: OK
401:
description: Not authorized
409:
description: Already shutting down
500:
description: Unexpected server error
/set-worker:
post:
operationId: operator.setWorker
description: Updates the operator worker id.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SetWorkerOperation'
responses:
200:
description: OK
401:
description: Not authorized
500:
description: Unexpected server error
/set-buckets:
post:
operationId: operator.setBuckets
description: Updates buckets supported by the node.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SetBucketsOperation'
responses:
200:
description: OK
401:
description: Not authorized
500:
description: Unexpected server error
components:
securitySchemes:
OperatorAuth:
type: http
scheme: bearer
bearerFormat:
"JWT signed with HMAC (HS256) secret key specified in distributor node's `config.operator.hmacSecret`.
The payload should include:
- `reqBody` - content of the request body
- `reqUrl` - request url (only pathname + query string, without origin. For example: `/api/v1/set-buckets`)"
schemas:
SetWorkerOperation:
type: object
required:
- workerId
properties:
workerId:
type: integer
minimum: 0
SetBucketsOperation:
type: object
properties:
buckets:
description: 'Set of bucket ids to be distributed by the node.
If not provided - all buckets assigned to currently configured worker will be distributed.'
type: array
minItems: 1
items:
type: string
pattern: ^[0-9]+:[0-9]+$
security:
- OperatorAuth: []