-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrest.yaml
More file actions
159 lines (157 loc) · 4.41 KB
/
Copy pathrest.yaml
File metadata and controls
159 lines (157 loc) · 4.41 KB
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
openapi: 3.0.3
info:
title: Edge Toolkit REST API
description: "ws-server HTTP surface: health probe, module discovery, module assets, per-agent storage."
version: 0.1.0
servers:
- url: http://localhost:8080
description: Default ws-server bind address
paths:
/health:
get:
tags:
- health
summary: Liveness probe.
description: |-
Returns a small JSON document identifying the service so external
monitors can confirm the server is reachable and serving requests.
operationId: health
responses:
"200":
description: Server is up
content:
application/json:
schema:
$ref: "#/components/schemas/HealthResponse"
/modules/:
get:
tags:
- modules
summary: List the names of every module the server is currently serving.
operationId: list_modules_handler
responses:
"200":
description: Names of available modules
content:
application/json:
schema:
type: array
items:
type: string
/modules/{name}/{path}:
get:
tags:
- modules
summary: Fetch a file from a module's bundled static assets.
description: |-
`path` is resolved relative to the module's bundle root; an unknown
module or missing file returns 404.
operationId: get_module_file
parameters:
- in: path
name: name
description: Module name
required: true
schema:
type: string
style: simple
- in: path
name: path
description: Path of the file within the module bundle
required: true
schema:
type: string
style: simple
responses:
"200":
description: Static module asset
content:
application/octet-stream: {}
"404":
description: No such module or file
/storage/{agent_id}/{filename}:
get:
tags:
- storage
summary: Download a file previously written to the named agent's storage bucket.
operationId: get_file
parameters:
- in: path
name: agent_id
description: Agent identifier
required: true
schema:
type: string
style: simple
- in: path
name: filename
description: Stored filename
required: true
schema:
type: string
style: simple
responses:
"200":
description: Stored file contents
content:
application/octet-stream: {}
"404":
description: No such file
put:
tags:
- storage
summary: Upload a file to an agent's storage bucket.
description: |-
Only the agent that owns the bucket may write to it (the agent must
currently be connected); the path component must be a single
filename, not a nested path.
operationId: put_file
parameters:
- in: path
name: agent_id
description: Agent identifier (must be a connected agent)
required: true
schema:
type: string
style: simple
- in: path
name: filename
description: Single-segment filename to write
required: true
schema:
type: string
style: simple
requestBody:
description: Raw file bytes
content:
application/octet-stream:
schema:
description: |-
Phantom type used to label binary request/response bodies as `string`/`binary`.
Never constructed at runtime; only exists under the `openapi-spec` feature
so the `utoipa::ToSchema` derive has something to attach to.
type: string
format: binary
required: true
responses:
"200":
description: File stored
"400":
description: Invalid filename
"404":
description: Agent not found
components:
schemas:
HealthResponse:
description: |-
Server liveness probe response.
Returned by `GET /health`.
type: object
properties:
service:
type: string
status:
type: string
required:
- status
- service