-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautomation.yaml
More file actions
269 lines (269 loc) · 7.05 KB
/
Copy pathautomation.yaml
File metadata and controls
269 lines (269 loc) · 7.05 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
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
openapi: 3.1.0
info:
title: Pmaster Automation API
version: 0.1.0
description: Shared automation contracts for the Pmaster-dev and pinkycollie ecosystem.
servers:
- url: /
description: Base URL resolved by each deployment environment
tags:
- name: Automation
- name: Runs
paths:
/automation/events/trigger:
post:
tags: [Automation]
summary: Trigger automation runs for an event
operationId: triggerAutomationEvent
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TriggerEventRequest'
responses:
'200':
description: Trigger processed
content:
application/json:
schema:
type: object
properties:
runs:
type: array
items:
$ref: '#/components/schemas/RunResult'
required: [runs]
/automation/definitions:
get:
tags: [Automation]
summary: List automation definitions
operationId: listAutomationDefinitions
responses:
'200':
description: Current definitions
content:
application/json:
schema:
type: object
properties:
definitions:
type: array
items:
$ref: '#/components/schemas/AutomationDefinition'
required: [definitions]
/automation/definitions/{name}:
put:
tags: [Automation]
summary: Create or replace an automation definition
operationId: upsertAutomationDefinition
parameters:
- $ref: '#/components/parameters/AutomationName'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AutomationDefinition'
responses:
'200':
description: Definition stored
delete:
tags: [Automation]
summary: Remove an automation definition
operationId: deleteAutomationDefinition
parameters:
- $ref: '#/components/parameters/AutomationName'
responses:
'204':
description: Definition removed
'404':
description: Definition not found
/automation/definitions/{name}/enable:
post:
tags: [Automation]
summary: Enable a definition
operationId: enableAutomationDefinition
parameters:
- $ref: '#/components/parameters/AutomationName'
responses:
'204':
description: Definition enabled
/automation/definitions/{name}/disable:
post:
tags: [Automation]
summary: Disable a definition
operationId: disableAutomationDefinition
parameters:
- $ref: '#/components/parameters/AutomationName'
responses:
'204':
description: Definition disabled
/automation/runs:
get:
tags: [Runs]
summary: List run history
operationId: listAutomationRuns
parameters:
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 1000
default: 50
responses:
'200':
description: Run history entries
content:
application/json:
schema:
type: object
properties:
runs:
type: array
items:
$ref: '#/components/schemas/RunResult'
required: [runs]
/automation/stats:
get:
tags: [Runs]
summary: Get aggregate automation stats
operationId: getAutomationStats
responses:
'200':
description: Aggregate counters by status
content:
application/json:
schema:
$ref: '#/components/schemas/AutomationStats'
components:
parameters:
AutomationName:
name: name
in: path
required: true
schema:
type: string
schemas:
TriggerEventRequest:
type: object
properties:
event_type:
type: string
payload:
description: Event payload forwarded to automation steps.
type: object
additionalProperties: true
nullable: true
metadata:
type: object
additionalProperties: true
default: {}
required: [event_type]
AutomationDefinition:
type: object
properties:
name:
type: string
triggers:
type: array
items:
type: string
steps:
type: array
description: Ordered component names to execute in sequence.
items:
type: string
variables:
type: array
description: Variable names resolved from the runtime variable registry.
items:
type: string
default: []
description:
type: string
default: ''
enabled:
type: boolean
default: true
required: [name, triggers, steps]
RunStatus:
type: string
enum: [pending, running, success, failed, skipped]
ComponentOutput:
type: object
properties:
component:
type: string
success:
type: boolean
result:
nullable: true
error:
type: string
nullable: true
metadata:
type: object
additionalProperties: true
default: {}
required: [component, success]
RunResult:
type: object
properties:
run_id:
type: string
trigger:
type: object
properties:
event_type:
type: string
event_id:
type: string
timestamp:
type: string
format: date-time
required: [event_type, event_id, timestamp]
status:
$ref: '#/components/schemas/RunStatus'
outputs:
type: array
items:
$ref: '#/components/schemas/ComponentOutput'
started_at:
type: string
format: date-time
nullable: true
finished_at:
type: string
format: date-time
nullable: true
duration_ms:
type: number
nullable: true
error:
type: string
nullable: true
required: [run_id, trigger, status, outputs]
AutomationStats:
type: object
properties:
total_runs:
type: integer
minimum: 0
automations:
type: integer
minimum: 0
components:
type: integer
minimum: 0
variables:
type: integer
minimum: 0
by_status:
type: object
additionalProperties:
type: integer
minimum: 0
required: [total_runs, automations, components, variables, by_status]