-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
227 lines (227 loc) · 5.8 KB
/
openapi.yaml
File metadata and controls
227 lines (227 loc) · 5.8 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
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
---
openapi: 3.0.2
info:
title: Famedly hookd
version: 1.0.0
paths:
/hook/{name}:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateConfig'
required: true
responses:
"200":
description: UUID of the running hook
parameters:
- name: name
description: Name of the hook to be triggered.
schema:
type: string
in: path
required: true
/status/{id}:
summary: Reads the status of an instance
get:
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Info'
description: Information about the hook instance
parameters:
- examples:
UUID:
value: '"89462579-eb68-401f-b597-61ca7a74f44a"'
name: id
description: ID of the instance to check the status for
schema:
type: string
in: path
required: true
/status/{id}/stdout:
get:
responses:
"200":
content:
text/plain:
schema:
type: string
description: stdout of the requested instance
parameters:
- name: id
description: ID of the instance to check the status for
in: path
required: true
/status/{id}/stderr:
get:
responses:
"200":
content:
text/plain:
schema:
type: string
description: stdout of the requested instance
parameters:
- name: id
description: ID of the instance to check the status for
in: path
required: true
components:
schemas:
CreateConfig:
title: Root Type for Creation
description: ""
required:
- vars
type: object
properties:
vars:
description: Map of env vars that are supposed to be set on the hook process
properties:
NAME:
type: string
HEIGHT:
type: string
example:
vars:
NAME: Franklin
HEIGHT: 183cm
Request:
title: Root Type for Request
description: Request parameters of a hook instance spawning request
type: object
properties:
uri:
type: string
method:
type: string
version:
type: string
headers:
type: object
properties:
content-type:
type: string
host:
type: string
accept:
type: string
user-agent:
type: string
content-length:
type: string
peer_addr:
type: string
example:
uri: /hook/ls
method: POST
version: HTTP/1.1
headers:
content-type: application/json
host: localhost:9320
accept: '*/*'
user-agent: curl/7.77.0
content-length: "11"
peer_addr: 127.0.0.1:40398
Info:
title: Root Type for Info
description: Information about a hook instance
required:
- request
- config
- running
- started
type: object
properties:
request:
$ref: '#/components/schemas/Request'
description: Description of the request that was used to create this instance
properties:
uri:
type: string
method:
type: string
version:
type: string
headers:
type: object
properties:
content-type:
type: string
host:
type: string
accept:
type: string
user-agent:
type: string
content-length:
type: string
peer_addr:
type: string
config:
$ref: '#/components/schemas/Config'
description: Configuration of the hook
properties:
command:
type: string
work_dir:
type: string
allowed_keys:
type: array
items: {}
running:
description: Whether the instance is still running
type: boolean
started:
format: date-time
description: Time when the instance was started
type: string
finished:
format: date-time
description: "Present if the hook instance has finished, is set to the time\
\ when it finished"
type: string
success:
description: Whether the instance succeeded. Is present once the hook has
finished.
type: boolean
example:
request:
uri: /hook/ls
method: POST
version: HTTP/1.1
headers:
content-type: application/json
host: localhost:9320
accept: '*/*'
user-agent: curl/7.77.0
content-length: "11"
peer_addr: 127.0.0.1:40398
config:
command: /home/jcgruenhage/dev/famedly/services/hookd/test.sh
work_dir: /home/jcgruenhage/dev/famedly
allowed_keys: []
running: true
started: 2021-06-01T19:38:38.990236243Z
finished: 2021-06-01T19:38:38.990236243Z
success: true
Config:
title: Root Type for Config
description: Config for a hook
type: object
properties:
command:
type: string
work_dir:
type: string
allowed_keys:
type: array
items: {}
example:
command: /path/to/some-webhook-command
work_dir: /some/directory
allowed_keys: []